Skip to content

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

feat: fe connect rpc migration done (#16750)

p0nyf9d36dffbd6f
diff --git a/frontend/src/components/AuditLog/AuditLogDataTable.vue b/frontend/src/components/AuditLog/AuditLogDataTable.vue
index 754de61c45..360afcfbed 100644
--- a/frontend/src/components/AuditLog/AuditLogDataTable.vue
+++ b/frontend/src/components/AuditLog/AuditLogDataTable.vue
@@ -20,10 +20,9 @@ import { useProjectV1Store, useUserStore } from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { getDateForPbTimestampProtoEs } from "@/types";
import type { AuditLog } from "@/types/proto-es/v1/audit_log_service_pb";
-import { AuditDataSchema } from "@/types/proto-es/v1/audit_log_service_pb";
+import { AuditDataSchema, AuditLog_Severity } from "@/types/proto-es/v1/audit_log_service_pb";
import { SettingSchema } from "@/types/proto-es/v1/setting_service_pb";
import { extractProjectResourceName } from "@/utils";
-import { severityToString } from "@/utils/v1";
import JSONStringView from "./JSONStringView.vue";
type AuditDataTableColumn = DataTableColumn<AuditLog> & {
@@ -62,7 +61,7 @@ const columnList = computed((): AuditDataTableColumn[] => {
key: "severity",
width: 96,
title: t("audit-log.table.level"),
- render: (auditLog) => severityToString(auditLog.severity),
+ render: (auditLog) => (AuditLog_Severity[auditLog.severity]),
},
{
key: "project",
diff --git a/frontend/src/components/InstanceForm/context.ts b/frontend/src/components/InstanceForm/context.ts
index 2bda3c1c10..616e8536fd 100644
--- a/frontend/src/components/InstanceForm/context.ts
+++ b/frontend/src/components/InstanceForm/context.ts
@@ -5,7 +5,6 @@ import type { InjectionKey, Ref } from "vue";
import { computed, inject, provide, ref } from "vue";
import { useI18n } from "vue-i18n";
import { instanceServiceClientConnect } from "@/grpcweb";
-import { convertOldInstanceToNew, convertOldDataSourceToNew, convertNewInstanceToOld, convertNewDataSourceToOld } from "@/utils/v1/instance-conversions";
import { create } from "@bufbuild/protobuf";
import { createContextValues } from "@connectrpc/connect";
import { silentContextKey } from "@/grpcweb/context-key";
@@ -379,10 +378,8 @@ export const provideInstanceFormContext = (baseContext: {
const dataSourceCreate = extractDataSourceFromEdit(instance, editingDS);
instance.dataSources = [dataSourceCreate];
try {
- const oldInstance = convertNewInstanceToOld(instance);
- const newInstance = convertOldInstanceToNew(oldInstance);
const request = create(CreateInstanceRequestSchema, {
- instance: newInstance,
+ instance,
instanceId: extractInstanceResourceName(instance.name),
validateOnly: true,
});
@@ -400,11 +397,9 @@ export const provideInstanceFormContext = (baseContext: {
// When read-only data source is about to be created, use
// editingDataSource + AddDataSourceRequest.validateOnly = true
try {
- const oldDataSource = convertNewDataSourceToOld(ds);
- const newDataSource = convertOldDataSourceToNew(oldDataSource);
const request = create(AddDataSourceRequestSchema, {
name: instance.value!.name,
- dataSource: newDataSource,
+ dataSource: ds,
validateOnly: true,
});
await instanceServiceClientConnect.addDataSource(request, {
@@ -426,11 +421,9 @@ export const provideInstanceFormContext = (baseContext: {
throw new Error("should never reach this line");
}
const updateMask = calcDataSourceUpdateMask(ds, original, editingDS);
- const oldDataSource = convertNewDataSourceToOld(ds);
- const newDataSource = convertOldDataSourceToNew(oldDataSource);
const request = create(UpdateDataSourceRequestSchema, {
name: instance.value!.name,
- dataSource: newDataSource,
+ dataSource: ds,
updateMask: { paths: updateMask },
validateOnly: true,
});
diff --git a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
index 08b1dcc113..ee0aa8b8d2 100644
--- a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
@@ -70,7 +70,6 @@ import ErrorList from "@/components/misc/ErrorList.vue";
import { create } from "@bufbuild/protobuf";
import { planServiceClientConnect } from "@/grpcweb";
import { UpdatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
-import { convertExportFormatToNew, convertExportFormatToOld } from "@/utils/v1/common-conversions";
import { pushNotification } from "@/store";
import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
import {
@@ -119,10 +118,10 @@ const denyEditTaskReasons = computed(() =>
// Convert between old and new ExportFormat types
const convertedFormat = computed({
get() {
- return convertExportFormatToNew(state.config.format);
+ return state.config.format;
},
set(value) {
- state.config.format = convertExportFormatToOld(value);
+ state.config.format = value;
}
});
diff --git a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
index 80987ac66e..a0bdc142c0 100644
--- a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
@@ -79,7 +79,6 @@ import { issueServiceClientConnect } from "@/grpcweb";
import { emitWindowEvent } from "@/plugins";
import { pushNotification, useCurrentProjectV1 } from "@/store";
import { IssueSchema, UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertNewIssueToOld } from "@/utils/v1/issue-conversions";
import { isGrantRequestIssue } from "@/utils";
import { useIssueContext } from "../../logic";
@@ -132,8 +131,7 @@ const saveEdit = async () => {
}),
updateMask: { paths: ["description"] },
});
- const response = await issueServiceClientConnect.updateIssue(request);
- const updated = convertNewIssueToOld(response);
+ const updated = await issueServiceClientConnect.updateIssue(request);
Object.assign(issue.value, updated);
pushNotification({
module: "bytebase",
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
index 25ee7ff3ff..e540a564b9 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
@@ -26,7 +26,6 @@ import { issueServiceClientConnect } from "@/grpcweb";
import { emitWindowEvent } from "@/plugins";
import { pushNotification } from "@/store";
import { IssueSchema, UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertNewIssueToOld } from "@/utils/v1/issue-conversions";
import { useIssueContext } from "../../logic";
type ViewMode = "EDIT" | "VIEW";
@@ -85,8 +84,7 @@ const onBlur = async () => {
}),
updateMask: { paths: ["title"] },
});
- const response = await issueServiceClientConnect.updateIssue(request);
- const updated = convertNewIssueToOld(response);
+ const updated = await issueServiceClientConnect.updateIssue(request);
Object.assign(issue.value, updated);
pushNotification({
module: "bytebase",
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DurationCell.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DurationCell.vue
index 42cd555ec3..8f9d2ee301 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DurationCell.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DurationCell.vue
@@ -2,7 +2,7 @@
<div class="text-sm">
<NTooltip v-if="duration && entry.startTime && entry.endTime">
<template #trigger>
- <span class="cursor-default">{{ humanizeDurationV1(convertDurationToNew(duration)) }}</span>
+ <span class="cursor-default">{{ humanizeDurationV1(duration) }}</span>
</template>
<template #default>
<div>
@@ -28,7 +28,6 @@ import { DurationSchema } from "@bufbuild/protobuf/wkt";
import { humanizeDurationV1 } from "@/utils";
import type { FlattenLogEntry } from "./common";
import { create } from "@bufbuild/protobuf";
-import { convertDurationToNew, convertDurationToOld } from "@/utils/v1/common-conversions";
const props = defineProps<{
entry: FlattenLogEntry;
@@ -38,10 +37,10 @@ const toDuration = (startTime: Date, endTime: Date) => {
const ms = endTime.getTime() - startTime.getTime();
const seconds = Math.floor(ms / 1000);
const nanos = (ms % 1000) * 1e6;
- return convertDurationToOld(create(DurationSchema,{
+ return create(DurationSchema,{
seconds: BigInt(seconds),
nanos,
- }));
+ });
};
const duration = computed(() => {
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/RoleDescription.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/RoleDescription.vue
index ab14ae86a4..83bd72f1d1 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/RoleDescription.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/RoleDescription.vue
@@ -17,7 +17,6 @@ import { useRouter } from "vue-router";
import { create } from "@bufbuild/protobuf";
import { issueServiceClientConnect } from "@/grpcweb";
import { GetIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertNewIssueToOld } from "@/utils/v1/issue-conversions";
import { pushNotification } from "@/store";
import { UNKNOWN_ID } from "@/types";
import { isValidIssueName } from "@/utils";
@@ -44,8 +43,7 @@ const gotoIssuePage = async () => {
const request = create(GetIssueRequestSchema, {
name: `projects/-/issues/${issueUID.value}`,
});
- const newIssue = await issueServiceClientConnect.getIssue(request);
- const issue = convertNewIssueToOld(newIssue);
+ const issue = await issueServiceClientConnect.getIssue(request);
if (!isValidIssueName(issue.name)) {
pushNotification({
module: "bytebase",
diff --git a/frontend/src/components/SchemaEditorLite/common.ts b/frontend/src/components/SchemaEditorLite/common.ts
index b571112875..6cb42b5f69 100644
--- a/frontend/src/components/SchemaEditorLite/common.ts
+++ b/frontend/src/components/SchemaEditorLite/common.ts
@@ -4,9 +4,6 @@ import { createContextValues } from "@connectrpc/connect";
import { sqlServiceClientConnect } from "@/grpcweb";
import { silentContextKey } from "@/grpcweb/context-key";
-import {
- convertNewDiffMetadataResponseToOld,
-} from "@/utils/v1/sql-conversions";
import { t } from "@/plugins/i18n";
import { useSettingV1Store } from "@/store";
import type { ComposedDatabase } from "@/types";
@@ -72,10 +69,9 @@ export const generateDiffDDL = async ({
classificationFromConfig:
classificationConfig?.classificationFromConfig ?? false,
});
- const newResponse = await sqlServiceClientConnect.diffMetadata(newRequest, {
+ const diffResponse = await sqlServiceClientConnect.diffMetadata(newRequest, {
contextValues: createContextValues().set(silentContextKey, true),
});
- const diffResponse = convertNewDiffMetadataResponseToOld(newResponse);
const { diff } = diffResponse;
if (diff.length === 0) {
if (
diff --git a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
index 1f92e57473..9989d0a315 100644
--- a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
+++ b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
@@ -210,9 +210,6 @@ import {
} from "@/types/proto-es/v1/setting_service_pb";
import { create as createProto } from "@bufbuild/protobuf";
import { arraySwap, instanceV1AllowsReorderColumns } from "@/utils";
-import {
- convertOldTableCatalogToNew,
-} from "@/utils/v1/database-catalog-conversions";
import FieldTemplates from "@/views/SchemaTemplate/FieldTemplates.vue";
import { cloneDeep, isEqual, pull } from "lodash-es";
import { PencilIcon, PlusIcon, XIcon } from "lucide-vue-next";
@@ -353,7 +350,7 @@ const onSubmit = async () => {
const template = rebuildTableTemplateFromMetadata({
...editing.value,
tableCatalog: tableCatalog.value
- ? convertOldTableCatalogToNew(tableCatalog.value)
+ ? tableCatalog.value
: createProto(TableCatalogSchema, {}),
});
const setting = await settingStore.fetchSettingByName(
diff --git a/frontend/src/components/Sheet/DownloadSheetButton.vue b/frontend/src/components/Sheet/DownloadSheetButton.vue
index cc720fe743..4611a2b6d5 100644
--- a/frontend/src/components/Sheet/DownloadSheetButton.vue
+++ b/frontend/src/components/Sheet/DownloadSheetButton.vue
@@ -10,7 +10,6 @@ import { ref } from "vue";
import { create } from "@bufbuild/protobuf";
import { sheetServiceClientConnect } from "@/grpcweb";
import { GetSheetRequestSchema } from "@/types/proto-es/v1/sheet_service_pb";
-import { convertNewSheetToOld } from "@/utils/v1/sheet-conversions";
const props = defineProps<{
sheet: string;
@@ -26,8 +25,7 @@ const downloadSheet = async () => {
name: props.sheet,
raw: true,
});
- const newResponse = await sheetServiceClientConnect.getSheet(request);
- const response = convertNewSheetToOld(newResponse);
+ const response = await sheetServiceClientConnect.getSheet(request);
let filename = response.title;
if (!filename.endsWith(".sql")) {
diff --git a/frontend/src/plugins/ai/components/ChatPanel.vue b/frontend/src/plugins/ai/components/ChatPanel.vue
index c38ed5a340..84ebf4953c 100644
--- a/frontend/src/plugins/ai/components/ChatPanel.vue
+++ b/frontend/src/plugins/ai/components/ChatPanel.vue
@@ -34,12 +34,8 @@ import { storeToRefs } from "pinia";
import { reactive, watch } from "vue";
import { create as createProto } from "@bufbuild/protobuf";
import { sqlServiceClientConnect } from "@/grpcweb";
-import {
- convertOldAICompletionRequestToNew,
- convertNewAICompletionResponseToOld,
-} from "@/utils/v1/sql-conversions";
import { useSQLEditorTabStore } from "@/store";
-import { type AICompletionRequest_Message, AICompletionRequest_MessageSchema } from "@/types/proto-es/v1/sql_service_pb";
+import { type AICompletionRequest_Message, AICompletionRequest_MessageSchema, AICompletionRequestSchema } from "@/types/proto-es/v1/sql_service_pb";
import { nextAnimationFrame } from "@/utils";
import { onConnectionChanged, useAIContext, useCurrentChat } from "../logic";
import * as promptUtils from "../logic/prompt";
@@ -125,10 +121,8 @@ const requestAI = async (query: string) => {
});
state.loading = true;
try {
- const oldRequest = { messages };
- const newRequest = convertOldAICompletionRequestToNew(oldRequest);
- const newResponse = await sqlServiceClientConnect.aICompletion(newRequest);
- const response = convertNewAICompletionResponseToOld(newResponse);
+ const request = createProto(AICompletionRequestSchema, { messages });
+ const response = await sqlServiceClientConnect.aICompletion(request);
const text = head(head(response.candidates)?.content?.parts)?.text?.trim();
console.debug("[AI Assistant] answer:", text);
if (text) {
diff --git a/frontend/src/plugins/ai/logic/useDynamicSuggestions.ts b/frontend/src/plugins/ai/logic/useDynamicSuggestions.ts
index 89c7b4007a..b926c07c99 100644
--- a/frontend/src/plugins/ai/logic/useDynamicSuggestions.ts
+++ b/frontend/src/plugins/ai/logic/useDynamicSuggestions.ts
@@ -5,11 +5,7 @@ import { create as createProto } from "@bufbuild/protobuf";
import { hashCode } from "@/bbkit/BBUtil";
import { sqlServiceClientConnect } from "@/grpcweb";
-import {
- convertOldAICompletionRequestToNew,
- convertNewAICompletionResponseToOld,
-} from "@/utils/v1/sql-conversions";
-import { type AICompletionRequest_Message, AICompletionRequest_MessageSchema } from "@/types/proto-es/v1/sql_service_pb";
+import { type AICompletionRequest_Message, AICompletionRequest_MessageSchema, AICompletionRequestSchema } from "@/types/proto-es/v1/sql_service_pb";
import { WebStorageHelper } from "@/utils";
import { useAIContext } from "./context";
import * as promptUtils from "./prompt";
@@ -50,10 +46,8 @@ export const useDynamicSuggestions = () => {
const requestAI = async (messages: AICompletionRequest_Message[]) => {
await new Promise((resolve) => setTimeout(resolve, 1000));
try {
- const oldRequest = { messages };
- const newRequest = convertOldAICompletionRequestToNew(oldRequest);
- const newResponse = await sqlServiceClientConnect.aICompletion(newRequest);
- const response = convertNewAICompletionResponseToOld(newResponse);
+ const request = createProto(AICompletionRequestSchema, { messages });
+ const response = await sqlServiceClientConnect.aICompletion(request);
const text =
head(head(response.candidates)?.content?.parts)?.text?.trim() ?? "";
const card = JSON.parse(text) as Record<string, string>;
diff --git a/frontend/src/store/modules/v1/database.ts b/frontend/src/store/modules/v1/database.ts
index b926dbc261..70d9b730d2 100644
--- a/frontend/src/store/modules/v1/database.ts
+++ b/frontend/src/store/modules/v1/database.ts
@@ -26,8 +26,7 @@ import {
unknownEnvironment,
unknownInstanceResource,
} from "@/types";
-import type { Engine } from "@/types/proto-es/v1/common_pb";
-import { convertEngineToOld } from "@/utils/v1/common-conversions";
+import { Engine } from "@/types/proto-es/v1/common_pb";
import type {
Database,
UpdateDatabaseRequest,
@@ -90,13 +89,13 @@ const getListDatabaseFilter = (filter: DatabaseFilter): string => {
// engine filter should be:
// engine in ["MYSQL", "POSTGRES"]
params.push(
- `engine in [${filter.engines.map((e) => `"${convertEngineToOld(e)}"`).join(", ")}]`
+ `engine in [${filter.engines.map((e) => `"${Engine[e]}"`).join(", ")}]`
);
} else if (filter.excludeEngines && filter.excludeEngines.length > 0) {
// engine filter should be:
// !(engine in ["REDIS", "MONGODB"])
params.push(
- `!(engine in [${filter.excludeEngines.map((e) => `"${convertEngineToOld(e)}"`).join(", ")}])`
+ `!(engine in [${filter.excludeEngines.map((e) => `"${Engine[e]}"`).join(", ")}])`
);
}
if (!isNullOrUndefined(filter.drifted)) {
diff --git a/frontend/src/store/modules/v1/databaseCatalog.ts b/frontend/src/store/modules/v1/databaseCatalog.ts
index 18956e5ee4..70611a918a 100644
--- a/frontend/src/store/modules/v1/databaseCatalog.ts
+++ b/frontend/src/store/modules/v1/databaseCatalog.ts
@@ -18,9 +18,6 @@ import {
TableCatalog_ColumnsSchema,
ColumnCatalogSchema
} from "@/types/proto-es/v1/database_catalog_service_pb";
-import {
- convertOldDatabaseCatalogToNew
-} from "@/utils/v1/database-catalog-conversions";
import { extractDatabaseResourceName, hasProjectPermissionV2 } from "@/utils";
import { useDatabaseV1Store } from "./database";
@@ -87,9 +84,8 @@ export const useDatabaseCatalogV1Store = defineStore(
};
const updateDatabaseCatalog = async (catalog: DatabaseCatalog) => {
- const newCatalog = convertOldDatabaseCatalogToNew(catalog);
const request = create(UpdateDatabaseCatalogRequestSchema, {
- catalog: newCatalog,
+ catalog: catalog,
});
const response = await databaseCatalogServiceClientConnect.updateDatabaseCatalog(request);
setCache(response);
diff --git a/frontend/src/store/modules/v1/instance.ts b/frontend/src/store/modules/v1/instance.ts
index 3934e7138d..1d92a65c20 100644
--- a/frontend/src/store/modules/v1/instance.ts
+++ b/frontend/src/store/modules/v1/instance.ts
@@ -28,7 +28,7 @@ import {
isValidInstanceName,
isValidEnvironmentName,
} from "@/types";
-import type { Engine } from "@/types/proto-es/v1/common_pb";
+import { Engine } from "@/types/proto-es/v1/common_pb";
import { State } from "@/types/proto-es/v1/common_pb";
// Using proto-es types directly, no conversions needed for internal operations
import type {
@@ -73,7 +73,7 @@ const getListInstanceFilter = (params: InstanceFilter) => {
// engine filter should be:
// engine in ["MYSQL", "POSTGRES"]
list.push(
- `engine in [${params.engines.map((e) => `"${e}"`).join(", ")}]`
+ `engine in [${params.engines.map((e) => `"${Engine[e]}"`).join(", ")}]`
);
}
if (params.state === State.DELETED) {
diff --git a/frontend/src/types/proto/google/api/annotations.ts b/frontend/src/types/proto/google/api/annotations.ts
deleted file mode 100644
index d4bdd34e59..0000000000
--- a/frontend/src/types/proto/google/api/annotations.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/annotations.proto
-
-/* eslint-disable */
-
-export const protobufPackage = "google.api";
diff --git a/frontend/src/types/proto/google/api/client.ts b/frontend/src/types/proto/google/api/client.ts
deleted file mode 100644
index d15752f5e4..0000000000
--- a/frontend/src/types/proto/google/api/client.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/client.proto
-
-/* eslint-disable */
-
-export const protobufPackage = "google.api";
diff --git a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
deleted file mode 100644
index 1a6eeee526..0000000000
--- a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
+++ /dev/null
@@ -1,1500 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/expr/v1alpha1/syntax.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Duration } from "../../../protobuf/duration";
-import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber } from "../../../protobuf/struct";
-import { Timestamp } from "../../../protobuf/timestamp";
-
-export const protobufPackage = "google.api.expr.v1alpha1";
-
-/**
- * An abstract representation of a common expression.
- *
- * Expressions are abstractly represented as a collection of identifiers,
- * select statements, function calls, literals, and comprehensions. All
- * operators with the exception of the '.' operator are modelled as function
- * calls. This makes it easy to represent new operators into the existing AST.
- *
- * All references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at
- * type-check for an expression to be valid. A reference may either be a bare
- * identifier `name` or a qualified identifier `google.api.name`. References
- * may either refer to a value or a function declaration.
- *
- * For example, the expression `google.api.name.startsWith('expr')` references
- * the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and
- * the function declaration `startsWith`.
- */
-export interface Expr {
- /**
- * Required. An id assigned to this node by the parser which is unique in a
- * given expression tree. This is used to associate type information and other
- * attributes to a node in the parse tree.
- */
- id: Long;
- /** A literal expression. */
- constExpr?:
- | Constant
- | undefined;
- /** An identifier expression. */
- identExpr?:
- | Expr_Ident
- | undefined;
- /** A field selection expression, e.g. `request.auth`. */
- selectExpr?:
- | Expr_Select
- | undefined;
- /** A call expression, including calls to predefined functions and operators. */
- callExpr?:
- | Expr_Call
- | undefined;
- /** A list creation expression. */
- listExpr?:
- | Expr_CreateList
- | undefined;
- /** A map or message creation expression. */
- structExpr?:
- | Expr_CreateStruct
- | undefined;
- /** A comprehension expression. */
- comprehensionExpr?: Expr_Comprehension | undefined;
-}
-
-/** An identifier expression. e.g. `request`. */
-export interface Expr_Ident {
- /**
- * Required. Holds a single, unqualified identifier, possibly preceded by a
- * '.'.
- *
- * Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression.
- */
- name: string;
-}
-
-/** A field selection expression. e.g. `request.auth`. */
-export interface Expr_Select {
- /**
- * Required. The target of the selection expression.
- *
- * For example, in the select expression `request.auth`, the `request`
- * portion of the expression is the `operand`.
- */
- operand:
- | Expr
- | undefined;
- /**
- * Required. The name of the field to select.
- *
- * For example, in the select expression `request.auth`, the `auth` portion
- * of the expression would be the `field`.
- */
- field: string;
- /**
- * Whether the select is to be interpreted as a field presence test.
- *
- * This results from the macro `has(request.auth)`.
- */
- testOnly: boolean;
-}
-
-/**
- * A call expression, including calls to predefined functions and operators.
- *
- * For example, `value == 10`, `size(map_value)`.
- */
-export interface Expr_Call {
- /**
- * The target of an method call-style expression. For example, `x` in
- * `x.f()`.
- */
- target:
- | Expr
- | undefined;
- /** Required. The name of the function or method being called. */
- function: string;
- /** The arguments. */
- args: Expr[];
-}
-
-/**
- * A list creation expression.
- *
- * Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g.
- * `dyn([1, 'hello', 2.0])`
- */
-export interface Expr_CreateList {
- /** The elements part of the list. */
- elements: Expr[];
- /**
- * The indices within the elements list which are marked as optional
- * elements.
- *
- * When an optional-typed value is present, the value it contains
- * is included in the list. If the optional-typed value is absent, the list
- * element is omitted from the CreateList result.
- */
- optionalIndices: number[];
-}
-
-/**
- * A map or message creation expression.
- *
- * Maps are constructed as `{'key_name': 'value'}`. Message construction is
- * similar, but prefixed with a type name and composed of field ids:
- * `types.MyType{field_id: 'value'}`.
- */
-export interface Expr_CreateStruct {
- /**
- * The type name of the message to be created, empty when creating map
- * literals.
- */
- messageName: string;
- /** The entries in the creation expression. */
- entries: Expr_CreateStruct_Entry[];
-}
-
-/** Represents an entry. */
-export interface Expr_CreateStruct_Entry {
- /**
- * Required. An id assigned to this node by the parser which is unique
- * in a given expression tree. This is used to associate type
- * information and other attributes to the node.
- */
- id: Long;
- /** The field key for a message creator statement. */
- fieldKey?:
- | string
- | undefined;
- /** The key expression for a map creation statement. */
- mapKey?:
- | Expr
- | undefined;
- /**
- * Required. The value assigned to the key.
- *
- * If the optional_entry field is true, the expression must resolve to an
- * optional-typed value. If the optional value is present, the key will be
- * set; however, if the optional value is absent, the key will be unset.
- */
- value:
- | Expr
- | undefined;
- /** Whether the key-value pair is optional. */
- optionalEntry: boolean;
-}
-
-/**
- * A comprehension expression applied to a list or map.
- *
- * Comprehensions are not part of the core syntax, but enabled with macros.
- * A macro matches a specific call signature within a parsed AST and replaces
- * the call with an alternate AST block. Macro expansion happens at parse
- * time.
- *
- * The following macros are supported within CEL:
- *
- * Aggregate type macros may be applied to all elements in a list or all keys
- * in a map:
- *
- * * `all`, `exists`, `exists_one` - test a predicate expression against
- * the inputs and return `true` if the predicate is satisfied for all,
- * any, or only one value `list.all(x, x < 10)`.
- * * `filter` - test a predicate expression against the inputs and return
- * the subset of elements which satisfy the predicate:
- * `payments.filter(p, p > 1000)`.
- * * `map` - apply an expression to all elements in the input and return the
- * output aggregate type: `[1, 2, 3].map(i, i * i)`.
- *
- * The `has(m.x)` macro tests whether the property `x` is present in struct
- * `m`. The semantics of this macro depend on the type of `m`. For proto2
- * messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the
- * macro tests whether the property is set to its default. For map and struct
- * types, the macro tests whether the property `x` is defined on `m`.
- */
-export interface Expr_Comprehension {
- /** The name of the iteration variable. */
- iterVar: string;
- /** The range over which var iterates. */
- iterRange:
- | Expr
- | undefined;
- /** The name of the variable used for accumulation of the result. */
- accuVar: string;
- /** The initial value of the accumulator. */
- accuInit:
- | Expr
- | undefined;
- /**
- * An expression which can contain iter_var and accu_var.
- *
- * Returns false when the result has been computed and may be used as
- * a hint to short-circuit the remainder of the comprehension.
- */
- loopCondition:
- | Expr
- | undefined;
- /**
- * An expression which can contain iter_var and accu_var.
- *
- * Computes the next value of accu_var.
- */
- loopStep:
- | Expr
- | undefined;
- /**
- * An expression which can contain accu_var.
- *
- * Computes the result.
- */
- result: Expr | undefined;
-}
-
-/**
- * Represents a primitive literal.
- *
- * Named 'Constant' here for backwards compatibility.
- *
- * This is similar as the primitives supported in the well-known type
- * `google.protobuf.Value`, but richer so it can represent CEL's full range of
- * primitives.
- *
- * Lists and structs are not included as constants as these aggregate types may
- * contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant.
- *
- * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,
- * `true`, `null`.
- */
-export interface Constant {
- /** null value. */
- nullValue?:
- | NullValue
- | undefined;
- /** boolean value. */
- boolValue?:
- | boolean
- | undefined;
- /** int64 value. */
- int64Value?:
- | Long
- | undefined;
- /** uint64 value. */
- uint64Value?:
- | Long
- | undefined;
- /** double value. */
- doubleValue?:
- | number
- | undefined;
- /** string value. */
- stringValue?:
- | string
- | undefined;
- /** bytes value. */
- bytesValue?:
- | Uint8Array
- | undefined;
- /**
- * protobuf.Duration value.
- *
- * Deprecated: duration is no longer considered a builtin cel type.
- *
- * @deprecated
- */
- durationValue?:
- | Duration
- | undefined;
- /**
- * protobuf.Timestamp value.
- *
- * Deprecated: timestamp is no longer considered a builtin cel type.
- *
- * @deprecated
- */
- timestampValue?: Timestamp | undefined;
-}
-
-function createBaseExpr(): Expr {
- return {
- id: Long.ZERO,
- constExpr: undefined,
- identExpr: undefined,
- selectExpr: undefined,
- callExpr: undefined,
- listExpr: undefined,
- structExpr: undefined,
- comprehensionExpr: undefined,
- };
-}
-
-export const Expr: MessageFns<Expr> = {
- encode(message: Expr, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (!message.id.equals(Long.ZERO)) {
- writer.uint32(16).int64(message.id.toString());
- }
- if (message.constExpr !== undefined) {
- Constant.encode(message.constExpr, writer.uint32(26).fork()).join();
- }
- if (message.identExpr !== undefined) {
- Expr_Ident.encode(message.identExpr, writer.uint32(34).fork()).join();
- }
- if (message.selectExpr !== undefined) {
- Expr_Select.encode(message.selectExpr, writer.uint32(42).fork()).join();
- }
- if (message.callExpr !== undefined) {
- Expr_Call.encode(message.callExpr, writer.uint32(50).fork()).join();
- }
- if (message.listExpr !== undefined) {
- Expr_CreateList.encode(message.listExpr, writer.uint32(58).fork()).join();
- }
- if (message.structExpr !== undefined) {
- Expr_CreateStruct.encode(message.structExpr, writer.uint32(66).fork()).join();
- }
- if (message.comprehensionExpr !== undefined) {
- Expr_Comprehension.encode(message.comprehensionExpr, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.id = Long.fromString(reader.int64().toString());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.constExpr = Constant.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.identExpr = Expr_Ident.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.selectExpr = Expr_Select.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.callExpr = Expr_Call.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.listExpr = Expr_CreateList.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.structExpr = Expr_CreateStruct.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.comprehensionExpr = Expr_Comprehension.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr {
- return {
- id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
- constExpr: isSet(object.constExpr) ? Constant.fromJSON(object.constExpr) : undefined,
- identExpr: isSet(object.identExpr) ? Expr_Ident.fromJSON(object.identExpr) : undefined,
- selectExpr: isSet(object.selectExpr) ? Expr_Select.fromJSON(object.selectExpr) : undefined,
- callExpr: isSet(object.callExpr) ? Expr_Call.fromJSON(object.callExpr) : undefined,
- listExpr: isSet(object.listExpr) ? Expr_CreateList.fromJSON(object.listExpr) : undefined,
- structExpr: isSet(object.structExpr) ? Expr_CreateStruct.fromJSON(object.structExpr) : undefined,
- comprehensionExpr: isSet(object.comprehensionExpr)
- ? Expr_Comprehension.fromJSON(object.comprehensionExpr)
- : undefined,
- };
- },
-
- toJSON(message: Expr): unknown {
- const obj: any = {};
- if (!message.id.equals(Long.ZERO)) {
- obj.id = (message.id || Long.ZERO).toString();
- }
- if (message.constExpr !== undefined) {
- obj.constExpr = Constant.toJSON(message.constExpr);
- }
- if (message.identExpr !== undefined) {
- obj.identExpr = Expr_Ident.toJSON(message.identExpr);
- }
- if (message.selectExpr !== undefined) {
- obj.selectExpr = Expr_Select.toJSON(message.selectExpr);
- }
- if (message.callExpr !== undefined) {
- obj.callExpr = Expr_Call.toJSON(message.callExpr);
- }
- if (message.listExpr !== undefined) {
- obj.listExpr = Expr_CreateList.toJSON(message.listExpr);
- }
- if (message.structExpr !== undefined) {
- obj.structExpr = Expr_CreateStruct.toJSON(message.structExpr);
- }
- if (message.comprehensionExpr !== undefined) {
- obj.comprehensionExpr = Expr_Comprehension.toJSON(message.comprehensionExpr);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr>): Expr {
- return Expr.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr>): Expr {
- const message = createBaseExpr();
- message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO;
- message.constExpr = (object.constExpr !== undefined && object.constExpr !== null)
- ? Constant.fromPartial(object.constExpr)
- : undefined;
- message.identExpr = (object.identExpr !== undefined && object.identExpr !== null)
- ? Expr_Ident.fromPartial(object.identExpr)
- : undefined;
- message.selectExpr = (object.selectExpr !== undefined && object.selectExpr !== null)
- ? Expr_Select.fromPartial(object.selectExpr)
- : undefined;
- message.callExpr = (object.callExpr !== undefined && object.callExpr !== null)
- ? Expr_Call.fromPartial(object.callExpr)
- : undefined;
- message.listExpr = (object.listExpr !== undefined && object.listExpr !== null)
- ? Expr_CreateList.fromPartial(object.listExpr)
- : undefined;
- message.structExpr = (object.structExpr !== undefined && object.structExpr !== null)
- ? Expr_CreateStruct.fromPartial(object.structExpr)
- : undefined;
- message.comprehensionExpr = (object.comprehensionExpr !== undefined && object.comprehensionExpr !== null)
- ? Expr_Comprehension.fromPartial(object.comprehensionExpr)
- : undefined;
- return message;
- },
-};
-
-function createBaseExpr_Ident(): Expr_Ident {
- return { name: "" };
-}
-
-export const Expr_Ident: MessageFns<Expr_Ident> = {
- encode(message: Expr_Ident, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_Ident {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_Ident();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_Ident {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: Expr_Ident): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_Ident>): Expr_Ident {
- return Expr_Ident.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_Ident>): Expr_Ident {
- const message = createBaseExpr_Ident();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseExpr_Select(): Expr_Select {
- return { operand: undefined, field: "", testOnly: false };
-}
-
-export const Expr_Select: MessageFns<Expr_Select> = {
- encode(message: Expr_Select, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.operand !== undefined) {
- Expr.encode(message.operand, writer.uint32(10).fork()).join();
- }
- if (message.field !== "") {
- writer.uint32(18).string(message.field);
- }
- if (message.testOnly !== false) {
- writer.uint32(24).bool(message.testOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_Select {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_Select();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.operand = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.field = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.testOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_Select {
- return {
- operand: isSet(object.operand) ? Expr.fromJSON(object.operand) : undefined,
- field: isSet(object.field) ? globalThis.String(object.field) : "",
- testOnly: isSet(object.testOnly) ? globalThis.Boolean(object.testOnly) : false,
- };
- },
-
- toJSON(message: Expr_Select): unknown {
- const obj: any = {};
- if (message.operand !== undefined) {
- obj.operand = Expr.toJSON(message.operand);
- }
- if (message.field !== "") {
- obj.field = message.field;
- }
- if (message.testOnly !== false) {
- obj.testOnly = message.testOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_Select>): Expr_Select {
- return Expr_Select.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_Select>): Expr_Select {
- const message = createBaseExpr_Select();
- message.operand = (object.operand !== undefined && object.operand !== null)
- ? Expr.fromPartial(object.operand)
- : undefined;
- message.field = object.field ?? "";
- message.testOnly = object.testOnly ?? false;
- return message;
- },
-};
-
-function createBaseExpr_Call(): Expr_Call {
- return { target: undefined, function: "", args: [] };
-}
-
-export const Expr_Call: MessageFns<Expr_Call> = {
- encode(message: Expr_Call, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.target !== undefined) {
- Expr.encode(message.target, writer.uint32(10).fork()).join();
- }
- if (message.function !== "") {
- writer.uint32(18).string(message.function);
- }
- for (const v of message.args) {
- Expr.encode(v!, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_Call {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_Call();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.target = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.function = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.args.push(Expr.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_Call {
- return {
- target: isSet(object.target) ? Expr.fromJSON(object.target) : undefined,
- function: isSet(object.function) ? globalThis.String(object.function) : "",
- args: globalThis.Array.isArray(object?.args) ? object.args.map((e: any) => Expr.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: Expr_Call): unknown {
- const obj: any = {};
- if (message.target !== undefined) {
- obj.target = Expr.toJSON(message.target);
- }
- if (message.function !== "") {
- obj.function = message.function;
- }
- if (message.args?.length) {
- obj.args = message.args.map((e) => Expr.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_Call>): Expr_Call {
- return Expr_Call.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_Call>): Expr_Call {
- const message = createBaseExpr_Call();
- message.target = (object.target !== undefined && object.target !== null)
- ? Expr.fromPartial(object.target)
- : undefined;
- message.function = object.function ?? "";
- message.args = object.args?.map((e) => Expr.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseExpr_CreateList(): Expr_CreateList {
- return { elements: [], optionalIndices: [] };
-}
-
-export const Expr_CreateList: MessageFns<Expr_CreateList> = {
- encode(message: Expr_CreateList, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.elements) {
- Expr.encode(v!, writer.uint32(10).fork()).join();
- }
- writer.uint32(18).fork();
- for (const v of message.optionalIndices) {
- writer.int32(v);
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateList {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_CreateList();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.elements.push(Expr.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag === 16) {
- message.optionalIndices.push(reader.int32());
-
- continue;
- }
-
- if (tag === 18) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.optionalIndices.push(reader.int32());
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_CreateList {
- return {
- elements: globalThis.Array.isArray(object?.elements) ? object.elements.map((e: any) => Expr.fromJSON(e)) : [],
- optionalIndices: globalThis.Array.isArray(object?.optionalIndices)
- ? object.optionalIndices.map((e: any) => globalThis.Number(e))
- : [],
- };
- },
-
- toJSON(message: Expr_CreateList): unknown {
- const obj: any = {};
- if (message.elements?.length) {
- obj.elements = message.elements.map((e) => Expr.toJSON(e));
- }
- if (message.optionalIndices?.length) {
- obj.optionalIndices = message.optionalIndices.map((e) => Math.round(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_CreateList>): Expr_CreateList {
- return Expr_CreateList.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_CreateList>): Expr_CreateList {
- const message = createBaseExpr_CreateList();
- message.elements = object.elements?.map((e) => Expr.fromPartial(e)) || [];
- message.optionalIndices = object.optionalIndices?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseExpr_CreateStruct(): Expr_CreateStruct {
- return { messageName: "", entries: [] };
-}
-
-export const Expr_CreateStruct: MessageFns<Expr_CreateStruct> = {
- encode(message: Expr_CreateStruct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.messageName !== "") {
- writer.uint32(10).string(message.messageName);
- }
- for (const v of message.entries) {
- Expr_CreateStruct_Entry.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateStruct {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_CreateStruct();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.messageName = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.entries.push(Expr_CreateStruct_Entry.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_CreateStruct {
- return {
- messageName: isSet(object.messageName) ? globalThis.String(object.messageName) : "",
- entries: globalThis.Array.isArray(object?.entries)
- ? object.entries.map((e: any) => Expr_CreateStruct_Entry.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: Expr_CreateStruct): unknown {
- const obj: any = {};
- if (message.messageName !== "") {
- obj.messageName = message.messageName;
- }
- if (message.entries?.length) {
- obj.entries = message.entries.map((e) => Expr_CreateStruct_Entry.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_CreateStruct>): Expr_CreateStruct {
- return Expr_CreateStruct.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_CreateStruct>): Expr_CreateStruct {
- const message = createBaseExpr_CreateStruct();
- message.messageName = object.messageName ?? "";
- message.entries = object.entries?.map((e) => Expr_CreateStruct_Entry.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseExpr_CreateStruct_Entry(): Expr_CreateStruct_Entry {
- return { id: Long.ZERO, fieldKey: undefined, mapKey: undefined, value: undefined, optionalEntry: false };
-}
-
-export const Expr_CreateStruct_Entry: MessageFns<Expr_CreateStruct_Entry> = {
- encode(message: Expr_CreateStruct_Entry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (!message.id.equals(Long.ZERO)) {
- writer.uint32(8).int64(message.id.toString());
- }
- if (message.fieldKey !== undefined) {
- writer.uint32(18).string(message.fieldKey);
- }
- if (message.mapKey !== undefined) {
- Expr.encode(message.mapKey, writer.uint32(26).fork()).join();
- }
- if (message.value !== undefined) {
- Expr.encode(message.value, writer.uint32(34).fork()).join();
- }
- if (message.optionalEntry !== false) {
- writer.uint32(40).bool(message.optionalEntry);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateStruct_Entry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_CreateStruct_Entry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.id = Long.fromString(reader.int64().toString());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.fieldKey = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.mapKey = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.value = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.optionalEntry = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_CreateStruct_Entry {
- return {
- id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
- fieldKey: isSet(object.fieldKey) ? globalThis.String(object.fieldKey) : undefined,
- mapKey: isSet(object.mapKey) ? Expr.fromJSON(object.mapKey) : undefined,
- value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined,
- optionalEntry: isSet(object.optionalEntry) ? globalThis.Boolean(object.optionalEntry) : false,
- };
- },
-
- toJSON(message: Expr_CreateStruct_Entry): unknown {
- const obj: any = {};
- if (!message.id.equals(Long.ZERO)) {
- obj.id = (message.id || Long.ZERO).toString();
- }
- if (message.fieldKey !== undefined) {
- obj.fieldKey = message.fieldKey;
- }
- if (message.mapKey !== undefined) {
- obj.mapKey = Expr.toJSON(message.mapKey);
- }
- if (message.value !== undefined) {
- obj.value = Expr.toJSON(message.value);
- }
- if (message.optionalEntry !== false) {
- obj.optionalEntry = message.optionalEntry;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_CreateStruct_Entry>): Expr_CreateStruct_Entry {
- return Expr_CreateStruct_Entry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_CreateStruct_Entry>): Expr_CreateStruct_Entry {
- const message = createBaseExpr_CreateStruct_Entry();
- message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO;
- message.fieldKey = object.fieldKey ?? undefined;
- message.mapKey = (object.mapKey !== undefined && object.mapKey !== null)
- ? Expr.fromPartial(object.mapKey)
- : undefined;
- message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined;
- message.optionalEntry = object.optionalEntry ?? false;
- return message;
- },
-};
-
-function createBaseExpr_Comprehension(): Expr_Comprehension {
- return {
- iterVar: "",
- iterRange: undefined,
- accuVar: "",
- accuInit: undefined,
- loopCondition: undefined,
- loopStep: undefined,
- result: undefined,
- };
-}
-
-export const Expr_Comprehension: MessageFns<Expr_Comprehension> = {
- encode(message: Expr_Comprehension, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.iterVar !== "") {
- writer.uint32(10).string(message.iterVar);
- }
- if (message.iterRange !== undefined) {
- Expr.encode(message.iterRange, writer.uint32(18).fork()).join();
- }
- if (message.accuVar !== "") {
- writer.uint32(26).string(message.accuVar);
- }
- if (message.accuInit !== undefined) {
- Expr.encode(message.accuInit, writer.uint32(34).fork()).join();
- }
- if (message.loopCondition !== undefined) {
- Expr.encode(message.loopCondition, writer.uint32(42).fork()).join();
- }
- if (message.loopStep !== undefined) {
- Expr.encode(message.loopStep, writer.uint32(50).fork()).join();
- }
- if (message.result !== undefined) {
- Expr.encode(message.result, writer.uint32(58).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr_Comprehension {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr_Comprehension();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.iterVar = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.iterRange = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.accuVar = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.accuInit = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.loopCondition = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.loopStep = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.result = Expr.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr_Comprehension {
- return {
- iterVar: isSet(object.iterVar) ? globalThis.String(object.iterVar) : "",
- iterRange: isSet(object.iterRange) ? Expr.fromJSON(object.iterRange) : undefined,
- accuVar: isSet(object.accuVar) ? globalThis.String(object.accuVar) : "",
- accuInit: isSet(object.accuInit) ? Expr.fromJSON(object.accuInit) : undefined,
- loopCondition: isSet(object.loopCondition) ? Expr.fromJSON(object.loopCondition) : undefined,
- loopStep: isSet(object.loopStep) ? Expr.fromJSON(object.loopStep) : undefined,
- result: isSet(object.result) ? Expr.fromJSON(object.result) : undefined,
- };
- },
-
- toJSON(message: Expr_Comprehension): unknown {
- const obj: any = {};
- if (message.iterVar !== "") {
- obj.iterVar = message.iterVar;
- }
- if (message.iterRange !== undefined) {
- obj.iterRange = Expr.toJSON(message.iterRange);
- }
- if (message.accuVar !== "") {
- obj.accuVar = message.accuVar;
- }
- if (message.accuInit !== undefined) {
- obj.accuInit = Expr.toJSON(message.accuInit);
- }
- if (message.loopCondition !== undefined) {
- obj.loopCondition = Expr.toJSON(message.loopCondition);
- }
- if (message.loopStep !== undefined) {
- obj.loopStep = Expr.toJSON(message.loopStep);
- }
- if (message.result !== undefined) {
- obj.result = Expr.toJSON(message.result);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr_Comprehension>): Expr_Comprehension {
- return Expr_Comprehension.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr_Comprehension>): Expr_Comprehension {
- const message = createBaseExpr_Comprehension();
- message.iterVar = object.iterVar ?? "";
- message.iterRange = (object.iterRange !== undefined && object.iterRange !== null)
- ? Expr.fromPartial(object.iterRange)
- : undefined;
- message.accuVar = object.accuVar ?? "";
- message.accuInit = (object.accuInit !== undefined && object.accuInit !== null)
- ? Expr.fromPartial(object.accuInit)
- : undefined;
- message.loopCondition = (object.loopCondition !== undefined && object.loopCondition !== null)
- ? Expr.fromPartial(object.loopCondition)
- : undefined;
- message.loopStep = (object.loopStep !== undefined && object.loopStep !== null)
- ? Expr.fromPartial(object.loopStep)
- : undefined;
- message.result = (object.result !== undefined && object.result !== null)
- ? Expr.fromPartial(object.result)
- : undefined;
- return message;
- },
-};
-
-function createBaseConstant(): Constant {
- return {
- nullValue: undefined,
- boolValue: undefined,
- int64Value: undefined,
- uint64Value: undefined,
- doubleValue: undefined,
- stringValue: undefined,
- bytesValue: undefined,
- durationValue: undefined,
- timestampValue: undefined,
- };
-}
-
-export const Constant: MessageFns<Constant> = {
- encode(message: Constant, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.nullValue !== undefined) {
- writer.uint32(8).int32(nullValueToNumber(message.nullValue));
- }
- if (message.boolValue !== undefined) {
- writer.uint32(16).bool(message.boolValue);
- }
- if (message.int64Value !== undefined) {
- writer.uint32(24).int64(message.int64Value.toString());
- }
- if (message.uint64Value !== undefined) {
- writer.uint32(32).uint64(message.uint64Value.toString());
- }
- if (message.doubleValue !== undefined) {
- writer.uint32(41).double(message.doubleValue);
- }
- if (message.stringValue !== undefined) {
- writer.uint32(50).string(message.stringValue);
- }
- if (message.bytesValue !== undefined) {
- writer.uint32(58).bytes(message.bytesValue);
- }
- if (message.durationValue !== undefined) {
- Duration.encode(message.durationValue, writer.uint32(66).fork()).join();
- }
- if (message.timestampValue !== undefined) {
- Timestamp.encode(message.timestampValue, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Constant {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseConstant();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.nullValue = nullValueFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.boolValue = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.int64Value = Long.fromString(reader.int64().toString());
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.uint64Value = Long.fromString(reader.uint64().toString(), true);
- continue;
- }
- case 5: {
- if (tag !== 41) {
- break;
- }
-
- message.doubleValue = reader.double();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.stringValue = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.bytesValue = reader.bytes();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.durationValue = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.timestampValue = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Constant {
- return {
- nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
- boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
- int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
- uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
- doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : undefined,
- stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
- bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,
- durationValue: isSet(object.durationValue) ? Duration.fromJSON(object.durationValue) : undefined,
- timestampValue: isSet(object.timestampValue) ? fromJsonTimestamp(object.timestampValue) : undefined,
- };
- },
-
- toJSON(message: Constant): unknown {
- const obj: any = {};
- if (message.nullValue !== undefined) {
- obj.nullValue = nullValueToJSON(message.nullValue);
- }
- if (message.boolValue !== undefined) {
- obj.boolValue = message.boolValue;
- }
- if (message.int64Value !== undefined) {
- obj.int64Value = (message.int64Value || Long.ZERO).toString();
- }
- if (message.uint64Value !== undefined) {
- obj.uint64Value = (message.uint64Value || Long.UZERO).toString();
- }
- if (message.doubleValue !== undefined) {
- obj.doubleValue = message.doubleValue;
- }
- if (message.stringValue !== undefined) {
- obj.stringValue = message.stringValue;
- }
- if (message.bytesValue !== undefined) {
- obj.bytesValue = base64FromBytes(message.bytesValue);
- }
- if (message.durationValue !== undefined) {
- obj.durationValue = Duration.toJSON(message.durationValue);
- }
- if (message.timestampValue !== undefined) {
- obj.timestampValue = fromTimestamp(message.timestampValue).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<Constant>): Constant {
- return Constant.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Constant>): Constant {
- const message = createBaseConstant();
- message.nullValue = object.nullValue ?? undefined;
- message.boolValue = object.boolValue ?? undefined;
- message.int64Value = (object.int64Value !== undefined && object.int64Value !== null)
- ? Long.fromValue(object.int64Value)
- : undefined;
- message.uint64Value = (object.uint64Value !== undefined && object.uint64Value !== null)
- ? Long.fromValue(object.uint64Value)
- : undefined;
- message.doubleValue = object.doubleValue ?? undefined;
- message.stringValue = object.stringValue ?? undefined;
- message.bytesValue = object.bytesValue ?? undefined;
- message.durationValue = (object.durationValue !== undefined && object.durationValue !== null)
- ? Duration.fromPartial(object.durationValue)
- : undefined;
- message.timestampValue = (object.timestampValue !== undefined && object.timestampValue !== null)
- ? Timestamp.fromPartial(object.timestampValue)
- : undefined;
- return message;
- },
-};
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/api/field_behavior.ts b/frontend/src/types/proto/google/api/field_behavior.ts
deleted file mode 100644
index f91d65f3f6..0000000000
--- a/frontend/src/types/proto/google/api/field_behavior.ts
+++ /dev/null
@@ -1,149 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/field_behavior.proto
-
-/* eslint-disable */
-
-export const protobufPackage = "google.api";
-
-/**
- * An indicator of the behavior of a given field (for example, that a field
- * is required in requests, or given as output but ignored as input).
- * This **does not** change the behavior in protocol buffers itself; it only
- * denotes the behavior and may affect how API tooling handles the field.
- *
- * Note: This enum **may** receive new values in the future.
- */
-export enum FieldBehavior {
- /** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */
- 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 = "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 = "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 = "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 = "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 = "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 = "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 = "NON_EMPTY_DEFAULT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function fieldBehaviorFromJSON(object: any): FieldBehavior {
- switch (object) {
- case 0:
- case "FIELD_BEHAVIOR_UNSPECIFIED":
- return FieldBehavior.FIELD_BEHAVIOR_UNSPECIFIED;
- case 1:
- case "OPTIONAL":
- return FieldBehavior.OPTIONAL;
- case 2:
- case "REQUIRED":
- return FieldBehavior.REQUIRED;
- case 3:
- case "OUTPUT_ONLY":
- return FieldBehavior.OUTPUT_ONLY;
- case 4:
- case "INPUT_ONLY":
- return FieldBehavior.INPUT_ONLY;
- case 5:
- case "IMMUTABLE":
- return FieldBehavior.IMMUTABLE;
- case 6:
- case "UNORDERED_LIST":
- return FieldBehavior.UNORDERED_LIST;
- case 7:
- case "NON_EMPTY_DEFAULT":
- return FieldBehavior.NON_EMPTY_DEFAULT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FieldBehavior.UNRECOGNIZED;
- }
-}
-
-export function fieldBehaviorToJSON(object: FieldBehavior): string {
- switch (object) {
- case FieldBehavior.FIELD_BEHAVIOR_UNSPECIFIED:
- return "FIELD_BEHAVIOR_UNSPECIFIED";
- case FieldBehavior.OPTIONAL:
- return "OPTIONAL";
- case FieldBehavior.REQUIRED:
- return "REQUIRED";
- case FieldBehavior.OUTPUT_ONLY:
- return "OUTPUT_ONLY";
- case FieldBehavior.INPUT_ONLY:
- return "INPUT_ONLY";
- case FieldBehavior.IMMUTABLE:
- return "IMMUTABLE";
- case FieldBehavior.UNORDERED_LIST:
- return "UNORDERED_LIST";
- case FieldBehavior.NON_EMPTY_DEFAULT:
- return "NON_EMPTY_DEFAULT";
- case FieldBehavior.UNRECOGNIZED:
- default:
- 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/http.ts b/frontend/src/types/proto/google/api/http.ts
deleted file mode 100644
index 82246871c6..0000000000
--- a/frontend/src/types/proto/google/api/http.ts
+++ /dev/null
@@ -1,674 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/http.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.api";
-
-/**
- * # gRPC Transcoding
- *
- * gRPC Transcoding is a feature for mapping between a gRPC method and one or
- * more HTTP REST endpoints. It allows developers to build a single API service
- * that supports both gRPC APIs and REST APIs. Many systems, including [Google
- * APIs](https://github.com/googleapis/googleapis),
- * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
- * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
- * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
- * and use it for large scale production services.
- *
- * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
- * how different portions of the gRPC request message are mapped to the URL
- * path, URL query parameters, and HTTP request body. It also controls how the
- * gRPC response message is mapped to the HTTP response body. `HttpRule` is
- * typically specified as an `google.api.http` annotation on the gRPC method.
- *
- * Each mapping specifies a URL path template and an HTTP method. The path
- * template may refer to one or more fields in the gRPC request message, as long
- * as each field is a non-repeated field with a primitive (non-message) type.
- * The path template controls how fields of the request message are mapped to
- * the URL path.
- *
- * Example:
- *
- * service Messaging {
- * rpc GetMessage(GetMessageRequest) returns (Message) {
- * option (google.api.http) = {
- * get: "/v1/{name=messages/*}"
- * };
- * }
- * }
- * message GetMessageRequest {
- * string name = 1; // Mapped to URL path.
- * }
- * message Message {
- * string text = 1; // The resource content.
- * }
- *
- * This enables an HTTP REST to gRPC mapping as below:
- *
- * HTTP | gRPC
- * -----|-----
- * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
- *
- * Any fields in the request message which are not bound by the path template
- * automatically become HTTP query parameters if there is no HTTP request body.
- * For example:
- *
- * service Messaging {
- * rpc GetMessage(GetMessageRequest) returns (Message) {
- * option (google.api.http) = {
- * get:"/v1/messages/{message_id}"
- * };
- * }
- * }
- * message GetMessageRequest {
- * message SubMessage {
- * string subfield = 1;
- * }
- * string message_id = 1; // Mapped to URL path.
- * int64 revision = 2; // Mapped to URL query parameter `revision`.
- * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
- * }
- *
- * This enables a HTTP JSON to RPC mapping as below:
- *
- * HTTP | gRPC
- * -----|-----
- * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
- * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
- * "foo"))`
- *
- * Note that fields which are mapped to URL query parameters must have a
- * primitive type or a repeated primitive type or a non-repeated message type.
- * In the case of a repeated type, the parameter can be repeated in the URL
- * as `...?param=A&param=B`. In the case of a message type, each field of the
- * message is mapped to a separate parameter, such as
- * `...?foo.a=A&foo.b=B&foo.c=C`.
- *
- * For HTTP methods that allow a request body, the `body` field
- * specifies the mapping. Consider a REST update method on the
- * message resource collection:
- *
- * service Messaging {
- * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
- * option (google.api.http) = {
- * patch: "/v1/messages/{message_id}"
- * body: "message"
- * };
- * }
- * }
- * message UpdateMessageRequest {
- * string message_id = 1; // mapped to the URL
- * Message message = 2; // mapped to the body
- * }
- *
- * The following HTTP JSON to RPC mapping is enabled, where the
- * representation of the JSON in the request body is determined by
- * protos JSON encoding:
- *
- * HTTP | gRPC
- * -----|-----
- * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
- * "123456" message { text: "Hi!" })`
- *
- * The special name `*` can be used in the body mapping to define that
- * every field not bound by the path template should be mapped to the
- * request body. This enables the following alternative definition of
- * the update method:
- *
- * service Messaging {
- * rpc UpdateMessage(Message) returns (Message) {
- * option (google.api.http) = {
- * patch: "/v1/messages/{message_id}"
- * body: "*"
- * };
- * }
- * }
- * message Message {
- * string message_id = 1;
- * string text = 2;
- * }
- *
- * The following HTTP JSON to RPC mapping is enabled:
- *
- * HTTP | gRPC
- * -----|-----
- * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
- * "123456" text: "Hi!")`
- *
- * Note that when using `*` in the body mapping, it is not possible to
- * have HTTP parameters, as all fields not bound by the path end in
- * the body. This makes this option more rarely used in practice when
- * defining REST APIs. The common usage of `*` is in custom methods
- * which don't use the URL at all for transferring data.
- *
- * It is possible to define multiple HTTP methods for one RPC by using
- * the `additional_bindings` option. Example:
- *
- * service Messaging {
- * rpc GetMessage(GetMessageRequest) returns (Message) {
- * option (google.api.http) = {
- * get: "/v1/messages/{message_id}"
- * additional_bindings {
- * get: "/v1/users/{user_id}/messages/{message_id}"
- * }
- * };
- * }
- * }
- * message GetMessageRequest {
- * string message_id = 1;
- * string user_id = 2;
- * }
- *
- * This enables the following two alternative HTTP JSON to RPC mappings:
- *
- * HTTP | gRPC
- * -----|-----
- * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
- * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
- * "123456")`
- *
- * ## Rules for HTTP mapping
- *
- * 1. Leaf request fields (recursive expansion nested messages in the request
- * message) are classified into three categories:
- * - Fields referred by the path template. They are passed via the URL path.
- * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
- * are passed via the HTTP
- * request body.
- * - All other fields are passed via the URL query parameters, and the
- * parameter name is the field path in the request message. A repeated
- * field can be represented as multiple query parameters under the same
- * name.
- * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
- * query parameter, all fields
- * are passed via URL path and HTTP request body.
- * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
- * request body, all
- * fields are passed via URL path and URL query parameters.
- *
- * ### Path template syntax
- *
- * Template = "/" Segments [ Verb ] ;
- * Segments = Segment { "/" Segment } ;
- * Segment = "*" | "**" | LITERAL | Variable ;
- * Variable = "{" FieldPath [ "=" Segments ] "}" ;
- * FieldPath = IDENT { "." IDENT } ;
- * Verb = ":" LITERAL ;
- *
- * The syntax `*` matches a single URL path segment. The syntax `**` matches
- * zero or more URL path segments, which must be the last part of the URL path
- * except the `Verb`.
- *
- * The syntax `Variable` matches part of the URL path as specified by its
- * template. A variable template must not contain other variables. If a variable
- * matches a single path segment, its template may be omitted, e.g. `{var}`
- * is equivalent to `{var=*}`.
- *
- * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
- * contains any reserved character, such characters should be percent-encoded
- * before the matching.
- *
- * If a variable contains exactly one path segment, such as `"{var}"` or
- * `"{var=*}"`, when such a variable is expanded into a URL path on the client
- * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
- * server side does the reverse decoding. Such variables show up in the
- * [Discovery
- * Document](https://developers.google.com/discovery/v1/reference/apis) as
- * `{var}`.
- *
- * If a variable contains multiple path segments, such as `"{var=foo/*}"`
- * or `"{var=**}"`, when such a variable is expanded into a URL path on the
- * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
- * The server side does the reverse decoding, except "%2F" and "%2f" are left
- * unchanged. Such variables show up in the
- * [Discovery
- * Document](https://developers.google.com/discovery/v1/reference/apis) as
- * `{+var}`.
- *
- * ## Using gRPC API Service Configuration
- *
- * gRPC API Service Configuration (service config) is a configuration language
- * for configuring a gRPC service to become a user-facing product. The
- * service config is simply the YAML representation of the `google.api.Service`
- * proto message.
- *
- * As an alternative to annotating your proto file, you can configure gRPC
- * transcoding in your service config YAML files. You do this by specifying a
- * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
- * effect as the proto annotation. This can be particularly useful if you
- * have a proto that is reused in multiple services. Note that any transcoding
- * specified in the service config will override any matching transcoding
- * configuration in the proto.
- *
- * Example:
- *
- * http:
- * rules:
- * # Selects a gRPC method and applies HttpRule to it.
- * - selector: example.v1.Messaging.GetMessage
- * get: /v1/messages/{message_id}/{sub.subfield}
- *
- * ## Special notes
- *
- * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
- * proto to JSON conversion must follow the [proto3
- * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
- *
- * While the single segment variable follows the semantics of
- * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
- * Expansion, the multi segment variable **does not** follow RFC 6570 Section
- * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
- * does not expand special characters like `?` and `#`, which would lead
- * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
- * for multi segment variables.
- *
- * The path variables **must not** refer to any repeated or mapped field,
- * because client libraries are not capable of handling such variable expansion.
- *
- * The path variables **must not** capture the leading "/" character. The reason
- * is that the most common use case "{var}" does not capture the leading "/"
- * character. For consistency, all path variables must share the same behavior.
- *
- * Repeated message fields must not be mapped to URL query parameters, because
- * no client library can support such complicated mapping.
- *
- * If an API needs to use a JSON array for request or response body, it can map
- * the request or response body to a repeated field. However, some gRPC
- * Transcoding implementations may not support this feature.
- */
-export interface HttpRule {
- /**
- * Selects a method to which this rule applies.
- *
- * Refer to [selector][google.api.DocumentationRule.selector] for syntax
- * details.
- */
- selector: string;
- /**
- * Maps to HTTP GET. Used for listing and getting information about
- * resources.
- */
- get?:
- | string
- | undefined;
- /** Maps to HTTP PUT. Used for replacing a resource. */
- put?:
- | string
- | undefined;
- /** Maps to HTTP POST. Used for creating a resource or performing an action. */
- post?:
- | string
- | undefined;
- /** Maps to HTTP DELETE. Used for deleting a resource. */
- delete?:
- | string
- | undefined;
- /** Maps to HTTP PATCH. Used for updating a resource. */
- patch?:
- | string
- | undefined;
- /**
- * The custom pattern is used for specifying an HTTP method that is not
- * included in the `pattern` field, such as HEAD, or "*" to leave the
- * HTTP method unspecified for this rule. The wild-card rule is useful
- * for services that provide content to Web (HTML) clients.
- */
- custom?:
- | CustomHttpPattern
- | undefined;
- /**
- * The name of the request field whose value is mapped to the HTTP request
- * body, or `*` for mapping all request fields not captured by the path
- * pattern to the HTTP body, or omitted for not having any HTTP request body.
- *
- * NOTE: the referred field must be present at the top-level of the request
- * message type.
- */
- body: string;
- /**
- * Optional. The name of the response field whose value is mapped to the HTTP
- * response body. When omitted, the entire response message will be used
- * as the HTTP response body.
- *
- * NOTE: The referred field must be present at the top-level of the response
- * message type.
- */
- responseBody: string;
- /**
- * Additional HTTP bindings for the selector. Nested bindings must
- * not contain an `additional_bindings` field themselves (that is,
- * the nesting may only be one level deep).
- */
- additionalBindings: HttpRule[];
-}
-
-/** A custom pattern is used for defining custom HTTP verb. */
-export interface CustomHttpPattern {
- /** The name of this custom HTTP verb. */
- kind: string;
- /** The path matched by this custom verb. */
- path: string;
-}
-
-function createBaseHttpRule(): HttpRule {
- return {
- selector: "",
- get: undefined,
- put: undefined,
- post: undefined,
- delete: undefined,
- patch: undefined,
- custom: undefined,
- body: "",
- responseBody: "",
- additionalBindings: [],
- };
-}
-
-export const HttpRule: MessageFns<HttpRule> = {
- encode(message: HttpRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.selector !== "") {
- writer.uint32(10).string(message.selector);
- }
- if (message.get !== undefined) {
- writer.uint32(18).string(message.get);
- }
- if (message.put !== undefined) {
- writer.uint32(26).string(message.put);
- }
- if (message.post !== undefined) {
- writer.uint32(34).string(message.post);
- }
- if (message.delete !== undefined) {
- writer.uint32(42).string(message.delete);
- }
- if (message.patch !== undefined) {
- writer.uint32(50).string(message.patch);
- }
- if (message.custom !== undefined) {
- CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).join();
- }
- if (message.body !== "") {
- writer.uint32(58).string(message.body);
- }
- if (message.responseBody !== "") {
- writer.uint32(98).string(message.responseBody);
- }
- for (const v of message.additionalBindings) {
- HttpRule.encode(v!, writer.uint32(90).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): HttpRule {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseHttpRule();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.selector = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.get = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.put = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.post = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.delete = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.patch = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.custom = CustomHttpPattern.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.body = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.responseBody = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.additionalBindings.push(HttpRule.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): HttpRule {
- return {
- selector: isSet(object.selector) ? globalThis.String(object.selector) : "",
- get: isSet(object.get) ? globalThis.String(object.get) : undefined,
- put: isSet(object.put) ? globalThis.String(object.put) : undefined,
- post: isSet(object.post) ? globalThis.String(object.post) : undefined,
- delete: isSet(object.delete) ? globalThis.String(object.delete) : undefined,
- patch: isSet(object.patch) ? globalThis.String(object.patch) : undefined,
- custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined,
- body: isSet(object.body) ? globalThis.String(object.body) : "",
- responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) : "",
- additionalBindings: globalThis.Array.isArray(object?.additionalBindings)
- ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: HttpRule): unknown {
- const obj: any = {};
- if (message.selector !== "") {
- obj.selector = message.selector;
- }
- if (message.get !== undefined) {
- obj.get = message.get;
- }
- if (message.put !== undefined) {
- obj.put = message.put;
- }
- if (message.post !== undefined) {
- obj.post = message.post;
- }
- if (message.delete !== undefined) {
- obj.delete = message.delete;
- }
- if (message.patch !== undefined) {
- obj.patch = message.patch;
- }
- if (message.custom !== undefined) {
- obj.custom = CustomHttpPattern.toJSON(message.custom);
- }
- if (message.body !== "") {
- obj.body = message.body;
- }
- if (message.responseBody !== "") {
- obj.responseBody = message.responseBody;
- }
- if (message.additionalBindings?.length) {
- obj.additionalBindings = message.additionalBindings.map((e) => HttpRule.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<HttpRule>): HttpRule {
- return HttpRule.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<HttpRule>): HttpRule {
- const message = createBaseHttpRule();
- message.selector = object.selector ?? "";
- message.get = object.get ?? undefined;
- message.put = object.put ?? undefined;
- message.post = object.post ?? undefined;
- message.delete = object.delete ?? undefined;
- message.patch = object.patch ?? undefined;
- message.custom = (object.custom !== undefined && object.custom !== null)
- ? CustomHttpPattern.fromPartial(object.custom)
- : undefined;
- message.body = object.body ?? "";
- message.responseBody = object.responseBody ?? "";
- message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseCustomHttpPattern(): CustomHttpPattern {
- return { kind: "", path: "" };
-}
-
-export const CustomHttpPattern: MessageFns<CustomHttpPattern> = {
- encode(message: CustomHttpPattern, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.kind !== "") {
- writer.uint32(10).string(message.kind);
- }
- if (message.path !== "") {
- writer.uint32(18).string(message.path);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCustomHttpPattern();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.kind = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.path = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CustomHttpPattern {
- return {
- kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
- path: isSet(object.path) ? globalThis.String(object.path) : "",
- };
- },
-
- toJSON(message: CustomHttpPattern): unknown {
- const obj: any = {};
- if (message.kind !== "") {
- obj.kind = message.kind;
- }
- if (message.path !== "") {
- obj.path = message.path;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
- return CustomHttpPattern.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
- const message = createBaseCustomHttpPattern();
- message.kind = object.kind ?? "";
- message.path = object.path ?? "";
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/api/resource.ts b/frontend/src/types/proto/google/api/resource.ts
deleted file mode 100644
index 2d7ff99656..0000000000
--- a/frontend/src/types/proto/google/api/resource.ts
+++ /dev/null
@@ -1,589 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/api/resource.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.api";
-
-/**
- * A simple descriptor of a resource type.
- *
- * ResourceDescriptor annotates a resource message (either by means of a
- * protobuf annotation or use in the service config), and associates the
- * resource's schema, the resource type, and the pattern of the resource name.
- *
- * Example:
- *
- * message Topic {
- * // Indicates this message defines a resource schema.
- * // Declares the resource type in the format of {service}/{kind}.
- * // For Kubernetes resources, the format is {api group}/{kind}.
- * option (google.api.resource) = {
- * type: "pubsub.googleapis.com/Topic"
- * pattern: "projects/{project}/topics/{topic}"
- * };
- * }
- *
- * The ResourceDescriptor Yaml config will look like:
- *
- * resources:
- * - type: "pubsub.googleapis.com/Topic"
- * pattern: "projects/{project}/topics/{topic}"
- *
- * Sometimes, resources have multiple patterns, typically because they can
- * live under multiple parents.
- *
- * Example:
- *
- * message LogEntry {
- * option (google.api.resource) = {
- * type: "logging.googleapis.com/LogEntry"
- * pattern: "projects/{project}/logs/{log}"
- * pattern: "folders/{folder}/logs/{log}"
- * pattern: "organizations/{organization}/logs/{log}"
- * pattern: "billingAccounts/{billing_account}/logs/{log}"
- * };
- * }
- *
- * The ResourceDescriptor Yaml config will look like:
- *
- * resources:
- * - type: 'logging.googleapis.com/LogEntry'
- * pattern: "projects/{project}/logs/{log}"
- * pattern: "folders/{folder}/logs/{log}"
- * pattern: "organizations/{organization}/logs/{log}"
- * pattern: "billingAccounts/{billing_account}/logs/{log}"
- */
-export interface ResourceDescriptor {
- /**
- * The resource type. It must be in the format of
- * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
- * singular and must not include version numbers.
- *
- * Example: `storage.googleapis.com/Bucket`
- *
- * The value of the resource_type_kind must follow the regular expression
- * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
- * should use PascalCase (UpperCamelCase). The maximum number of
- * characters allowed for the `resource_type_kind` is 100.
- */
- type: string;
- /**
- * Optional. The relative resource name pattern associated with this resource
- * type. The DNS prefix of the full resource name shouldn't be specified here.
- *
- * The path pattern must follow the syntax, which aligns with HTTP binding
- * syntax:
- *
- * Template = Segment { "/" Segment } ;
- * Segment = LITERAL | Variable ;
- * Variable = "{" LITERAL "}" ;
- *
- * Examples:
- *
- * - "projects/{project}/topics/{topic}"
- * - "projects/{project}/knowledgeBases/{knowledge_base}"
- *
- * The components in braces correspond to the IDs for each resource in the
- * hierarchy. It is expected that, if multiple patterns are provided,
- * the same component name (e.g. "project") refers to IDs of the same
- * type of resource.
- */
- pattern: string[];
- /**
- * Optional. The field on the resource that designates the resource name
- * field. If omitted, this is assumed to be "name".
- */
- nameField: string;
- /**
- * Optional. The historical or future-looking state of the resource pattern.
- *
- * Example:
- *
- * // The InspectTemplate message originally only supported resource
- * // names with organization, and project was added later.
- * message InspectTemplate {
- * option (google.api.resource) = {
- * type: "dlp.googleapis.com/InspectTemplate"
- * pattern:
- * "organizations/{organization}/inspectTemplates/{inspect_template}"
- * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
- * history: ORIGINALLY_SINGLE_PATTERN
- * };
- * }
- */
- history: ResourceDescriptor_History;
- /**
- * The plural name used in the resource name and permission names, such as
- * 'projects' for the resource name of 'projects/{project}' and the permission
- * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
- * concept of the `plural` field in k8s CRD spec
- * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
- *
- * Note: The plural form is required even for singleton resources. See
- * https://aip.dev/156
- */
- plural: string;
- /**
- * The same concept of the `singular` field in k8s CRD spec
- * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
- * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
- */
- singular: string;
- /**
- * Style flag(s) for this resource.
- * These indicate that a resource is expected to conform to a given
- * style. See the specific style flags for additional information.
- */
- style: ResourceDescriptor_Style[];
-}
-
-/**
- * A description of the historical or future-looking state of the
- * resource pattern.
- */
-export enum ResourceDescriptor_History {
- /** HISTORY_UNSPECIFIED - The "unset" value. */
- HISTORY_UNSPECIFIED = "HISTORY_UNSPECIFIED",
- /**
- * ORIGINALLY_SINGLE_PATTERN - The resource originally had one pattern and launched as such, and
- * additional patterns were added later.
- */
- ORIGINALLY_SINGLE_PATTERN = "ORIGINALLY_SINGLE_PATTERN",
- /**
- * FUTURE_MULTI_PATTERN - The resource has one pattern, but the API owner expects to add more
- * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
- * that from being necessary once there are multiple patterns.)
- */
- FUTURE_MULTI_PATTERN = "FUTURE_MULTI_PATTERN",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function resourceDescriptor_HistoryFromJSON(object: any): ResourceDescriptor_History {
- switch (object) {
- case 0:
- case "HISTORY_UNSPECIFIED":
- return ResourceDescriptor_History.HISTORY_UNSPECIFIED;
- case 1:
- case "ORIGINALLY_SINGLE_PATTERN":
- return ResourceDescriptor_History.ORIGINALLY_SINGLE_PATTERN;
- case 2:
- case "FUTURE_MULTI_PATTERN":
- return ResourceDescriptor_History.FUTURE_MULTI_PATTERN;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ResourceDescriptor_History.UNRECOGNIZED;
- }
-}
-
-export function resourceDescriptor_HistoryToJSON(object: ResourceDescriptor_History): string {
- switch (object) {
- case ResourceDescriptor_History.HISTORY_UNSPECIFIED:
- return "HISTORY_UNSPECIFIED";
- case ResourceDescriptor_History.ORIGINALLY_SINGLE_PATTERN:
- return "ORIGINALLY_SINGLE_PATTERN";
- case ResourceDescriptor_History.FUTURE_MULTI_PATTERN:
- return "FUTURE_MULTI_PATTERN";
- case ResourceDescriptor_History.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function resourceDescriptor_HistoryToNumber(object: ResourceDescriptor_History): number {
- switch (object) {
- case ResourceDescriptor_History.HISTORY_UNSPECIFIED:
- return 0;
- case ResourceDescriptor_History.ORIGINALLY_SINGLE_PATTERN:
- return 1;
- case ResourceDescriptor_History.FUTURE_MULTI_PATTERN:
- return 2;
- case ResourceDescriptor_History.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/** A flag representing a specific style that a resource claims to conform to. */
-export enum ResourceDescriptor_Style {
- /** STYLE_UNSPECIFIED - The unspecified value. Do not use. */
- STYLE_UNSPECIFIED = "STYLE_UNSPECIFIED",
- /**
- * DECLARATIVE_FRIENDLY - This resource is intended to be "declarative-friendly".
- *
- * Declarative-friendly resources must be more strictly consistent, and
- * setting this to true communicates to tools that this resource should
- * adhere to declarative-friendly expectations.
- *
- * Note: This is used by the API linter (linter.aip.dev) to enable
- * additional checks.
- */
- DECLARATIVE_FRIENDLY = "DECLARATIVE_FRIENDLY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function resourceDescriptor_StyleFromJSON(object: any): ResourceDescriptor_Style {
- switch (object) {
- case 0:
- case "STYLE_UNSPECIFIED":
- return ResourceDescriptor_Style.STYLE_UNSPECIFIED;
- case 1:
- case "DECLARATIVE_FRIENDLY":
- return ResourceDescriptor_Style.DECLARATIVE_FRIENDLY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ResourceDescriptor_Style.UNRECOGNIZED;
- }
-}
-
-export function resourceDescriptor_StyleToJSON(object: ResourceDescriptor_Style): string {
- switch (object) {
- case ResourceDescriptor_Style.STYLE_UNSPECIFIED:
- return "STYLE_UNSPECIFIED";
- case ResourceDescriptor_Style.DECLARATIVE_FRIENDLY:
- return "DECLARATIVE_FRIENDLY";
- case ResourceDescriptor_Style.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function resourceDescriptor_StyleToNumber(object: ResourceDescriptor_Style): number {
- switch (object) {
- case ResourceDescriptor_Style.STYLE_UNSPECIFIED:
- return 0;
- case ResourceDescriptor_Style.DECLARATIVE_FRIENDLY:
- return 1;
- case ResourceDescriptor_Style.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/**
- * Defines a proto annotation that describes a string field that refers to
- * an API resource.
- */
-export interface ResourceReference {
- /**
- * The resource type that the annotated field references.
- *
- * Example:
- *
- * message Subscription {
- * string topic = 2 [(google.api.resource_reference) = {
- * type: "pubsub.googleapis.com/Topic"
- * }];
- * }
- *
- * Occasionally, a field may reference an arbitrary resource. In this case,
- * APIs use the special value * in their resource reference.
- *
- * Example:
- *
- * message GetIamPolicyRequest {
- * string resource = 2 [(google.api.resource_reference) = {
- * type: "*"
- * }];
- * }
- */
- type: string;
- /**
- * The resource type of a child collection that the annotated field
- * references. This is useful for annotating the `parent` field that
- * doesn't have a fixed resource type.
- *
- * Example:
- *
- * message ListLogEntriesRequest {
- * string parent = 1 [(google.api.resource_reference) = {
- * child_type: "logging.googleapis.com/LogEntry"
- * };
- * }
- */
- childType: string;
-}
-
-function createBaseResourceDescriptor(): ResourceDescriptor {
- return {
- type: "",
- pattern: [],
- nameField: "",
- history: ResourceDescriptor_History.HISTORY_UNSPECIFIED,
- plural: "",
- singular: "",
- style: [],
- };
-}
-
-export const ResourceDescriptor: MessageFns<ResourceDescriptor> = {
- encode(message: ResourceDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== "") {
- writer.uint32(10).string(message.type);
- }
- for (const v of message.pattern) {
- writer.uint32(18).string(v!);
- }
- if (message.nameField !== "") {
- writer.uint32(26).string(message.nameField);
- }
- if (message.history !== ResourceDescriptor_History.HISTORY_UNSPECIFIED) {
- writer.uint32(32).int32(resourceDescriptor_HistoryToNumber(message.history));
- }
- if (message.plural !== "") {
- writer.uint32(42).string(message.plural);
- }
- if (message.singular !== "") {
- writer.uint32(50).string(message.singular);
- }
- writer.uint32(82).fork();
- for (const v of message.style) {
- writer.int32(resourceDescriptor_StyleToNumber(v));
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ResourceDescriptor {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseResourceDescriptor();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.type = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pattern.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.nameField = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.history = resourceDescriptor_HistoryFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.plural = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.singular = reader.string();
- continue;
- }
- case 10: {
- if (tag === 80) {
- message.style.push(resourceDescriptor_StyleFromJSON(reader.int32()));
-
- continue;
- }
-
- if (tag === 82) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.style.push(resourceDescriptor_StyleFromJSON(reader.int32()));
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ResourceDescriptor {
- return {
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- pattern: globalThis.Array.isArray(object?.pattern) ? object.pattern.map((e: any) => globalThis.String(e)) : [],
- nameField: isSet(object.nameField) ? globalThis.String(object.nameField) : "",
- history: isSet(object.history)
- ? resourceDescriptor_HistoryFromJSON(object.history)
- : ResourceDescriptor_History.HISTORY_UNSPECIFIED,
- plural: isSet(object.plural) ? globalThis.String(object.plural) : "",
- singular: isSet(object.singular) ? globalThis.String(object.singular) : "",
- style: globalThis.Array.isArray(object?.style)
- ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ResourceDescriptor): unknown {
- const obj: any = {};
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.pattern?.length) {
- obj.pattern = message.pattern;
- }
- if (message.nameField !== "") {
- obj.nameField = message.nameField;
- }
- if (message.history !== ResourceDescriptor_History.HISTORY_UNSPECIFIED) {
- obj.history = resourceDescriptor_HistoryToJSON(message.history);
- }
- if (message.plural !== "") {
- obj.plural = message.plural;
- }
- if (message.singular !== "") {
- obj.singular = message.singular;
- }
- if (message.style?.length) {
- obj.style = message.style.map((e) => resourceDescriptor_StyleToJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ResourceDescriptor>): ResourceDescriptor {
- return ResourceDescriptor.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ResourceDescriptor>): ResourceDescriptor {
- const message = createBaseResourceDescriptor();
- message.type = object.type ?? "";
- message.pattern = object.pattern?.map((e) => e) || [];
- message.nameField = object.nameField ?? "";
- message.history = object.history ?? ResourceDescriptor_History.HISTORY_UNSPECIFIED;
- message.plural = object.plural ?? "";
- message.singular = object.singular ?? "";
- message.style = object.style?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseResourceReference(): ResourceReference {
- return { type: "", childType: "" };
-}
-
-export const ResourceReference: MessageFns<ResourceReference> = {
- encode(message: ResourceReference, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== "") {
- writer.uint32(10).string(message.type);
- }
- if (message.childType !== "") {
- writer.uint32(18).string(message.childType);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ResourceReference {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseResourceReference();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.type = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.childType = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ResourceReference {
- return {
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- childType: isSet(object.childType) ? globalThis.String(object.childType) : "",
- };
- },
-
- toJSON(message: ResourceReference): unknown {
- const obj: any = {};
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.childType !== "") {
- obj.childType = message.childType;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ResourceReference>): ResourceReference {
- return ResourceReference.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ResourceReference>): ResourceReference {
- const message = createBaseResourceReference();
- message.type = object.type ?? "";
- message.childType = object.childType ?? "";
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/protobuf/any.ts b/frontend/src/types/proto/google/protobuf/any.ts
deleted file mode 100644
index 08ea574080..0000000000
--- a/frontend/src/types/proto/google/protobuf/any.ts
+++ /dev/null
@@ -1,248 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/any.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * `Any` contains an arbitrary serialized protocol buffer message along with a
- * URL that describes the type of the serialized message.
- *
- * Protobuf library provides support to pack/unpack Any values in the form
- * of utility functions or additional generated methods of the Any type.
- *
- * Example 1: Pack and unpack a message in C++.
- *
- * Foo foo = ...;
- * Any any;
- * any.PackFrom(foo);
- * ...
- * if (any.UnpackTo(&foo)) {
- * ...
- * }
- *
- * Example 2: Pack and unpack a message in Java.
- *
- * Foo foo = ...;
- * Any any = Any.pack(foo);
- * ...
- * if (any.is(Foo.class)) {
- * foo = any.unpack(Foo.class);
- * }
- * // or ...
- * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
- * foo = any.unpack(Foo.getDefaultInstance());
- * }
- *
- * Example 3: Pack and unpack a message in Python.
- *
- * foo = Foo(...)
- * any = Any()
- * any.Pack(foo)
- * ...
- * if any.Is(Foo.DESCRIPTOR):
- * any.Unpack(foo)
- * ...
- *
- * Example 4: Pack and unpack a message in Go
- *
- * foo := &pb.Foo{...}
- * any, err := anypb.New(foo)
- * if err != nil {
- * ...
- * }
- * ...
- * foo := &pb.Foo{}
- * if err := any.UnmarshalTo(foo); err != nil {
- * ...
- * }
- *
- * The pack methods provided by protobuf library will by default use
- * 'type.googleapis.com/full.type.name' as the type URL and the unpack
- * methods only use the fully qualified type name after the last '/'
- * in the type URL, for example "foo.bar.com/x/y.z" will yield type
- * name "y.z".
- *
- * JSON
- * ====
- * The JSON representation of an `Any` value uses the regular
- * representation of the deserialized, embedded message, with an
- * additional field `@type` which contains the type URL. Example:
- *
- * package google.profile;
- * message Person {
- * string first_name = 1;
- * string last_name = 2;
- * }
- *
- * {
- * "@type": "type.googleapis.com/google.profile.Person",
- * "firstName": <string>,
- * "lastName": <string>
- * }
- *
- * If the embedded message type is well-known and has a custom JSON
- * representation, that representation will be embedded adding a field
- * `value` which holds the custom JSON in addition to the `@type`
- * field. Example (for message [google.protobuf.Duration][]):
- *
- * {
- * "@type": "type.googleapis.com/google.protobuf.Duration",
- * "value": "1.212s"
- * }
- */
-export interface Any {
- /**
- * A URL/resource name that uniquely identifies the type of the serialized
- * protocol buffer message. This string must contain at least
- * one "/" character. The last segment of the URL's path must represent
- * the fully qualified name of the type (as in
- * `path/google.protobuf.Duration`). The name should be in a canonical form
- * (e.g., leading "." is not accepted).
- *
- * In practice, teams usually precompile into the binary all types that they
- * expect it to use in the context of Any. However, for URLs which use the
- * scheme `http`, `https`, or no scheme, one can optionally set up a type
- * server that maps type URLs to message definitions as follows:
- *
- * * If no scheme is provided, `https` is assumed.
- * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
- * value in binary format, or produce an error.
- * * Applications are allowed to cache lookup results based on the
- * URL, or have them precompiled into a binary to avoid any
- * lookup. Therefore, binary compatibility needs to be preserved
- * on changes to types. (Use versioned type names to manage
- * breaking changes.)
- *
- * Note: this functionality is not currently available in the official
- * protobuf release, and it is not used for type URLs beginning with
- * type.googleapis.com. As of May 2023, there are no widely used type server
- * implementations and no plans to implement one.
- *
- * Schemes other than `http`, `https` (or the empty scheme) might be
- * used with implementation specific semantics.
- */
- typeUrl: string;
- /** Must be a valid serialized protocol buffer of the above specified type. */
- value: Uint8Array;
-}
-
-function createBaseAny(): Any {
- return { typeUrl: "", value: new Uint8Array(0) };
-}
-
-export const Any: MessageFns<Any> = {
- encode(message: Any, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.typeUrl !== "") {
- writer.uint32(10).string(message.typeUrl);
- }
- if (message.value.length !== 0) {
- writer.uint32(18).bytes(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Any {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAny();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.typeUrl = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.bytes();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Any {
- return {
- typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "",
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
- };
- },
-
- toJSON(message: Any): unknown {
- const obj: any = {};
- if (message.typeUrl !== "") {
- obj.typeUrl = message.typeUrl;
- }
- if (message.value.length !== 0) {
- obj.value = base64FromBytes(message.value);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Any>): Any {
- return Any.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Any>): Any {
- const message = createBaseAny();
- message.typeUrl = object.typeUrl ?? "";
- message.value = object.value ?? new Uint8Array(0);
- return message;
- },
-};
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
deleted file mode 100644
index ca961a63a6..0000000000
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ /dev/null
@@ -1,2672 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/descriptor.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/** The full set of known editions. */
-export enum Edition {
- /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */
- EDITION_UNKNOWN = "EDITION_UNKNOWN",
- /**
- * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature
- * was first introduced. This is effectively an "infinite past".
- */
- EDITION_LEGACY = "EDITION_LEGACY",
- /**
- * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like
- * distinct editions. These can't be used to specify the edition of proto
- * files, but feature definitions must supply proto2/proto3 defaults for
- * backwards compatibility.
- */
- EDITION_PROTO2 = "EDITION_PROTO2",
- EDITION_PROTO3 = "EDITION_PROTO3",
- /**
- * EDITION_2023 - Editions that have been released. The specific values are arbitrary and
- * should not be depended on, but they will always be time-ordered for easy
- * comparison.
- */
- EDITION_2023 = "EDITION_2023",
- EDITION_2024 = "EDITION_2024",
- /**
- * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
- * used or relied on outside of tests.
- */
- EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
- EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
- EDITION_99997_TEST_ONLY = "EDITION_99997_TEST_ONLY",
- EDITION_99998_TEST_ONLY = "EDITION_99998_TEST_ONLY",
- EDITION_99999_TEST_ONLY = "EDITION_99999_TEST_ONLY",
- /**
- * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only
- * ever be used by plugins that can expect to never require any changes to
- * support a new edition.
- */
- EDITION_MAX = "EDITION_MAX",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function editionFromJSON(object: any): Edition {
- switch (object) {
- case 0:
- case "EDITION_UNKNOWN":
- return Edition.EDITION_UNKNOWN;
- case 900:
- case "EDITION_LEGACY":
- return Edition.EDITION_LEGACY;
- case 998:
- case "EDITION_PROTO2":
- return Edition.EDITION_PROTO2;
- case 999:
- case "EDITION_PROTO3":
- return Edition.EDITION_PROTO3;
- case 1000:
- case "EDITION_2023":
- return Edition.EDITION_2023;
- case 1001:
- case "EDITION_2024":
- return Edition.EDITION_2024;
- case 1:
- case "EDITION_1_TEST_ONLY":
- return Edition.EDITION_1_TEST_ONLY;
- case 2:
- case "EDITION_2_TEST_ONLY":
- return Edition.EDITION_2_TEST_ONLY;
- case 99997:
- case "EDITION_99997_TEST_ONLY":
- return Edition.EDITION_99997_TEST_ONLY;
- case 99998:
- case "EDITION_99998_TEST_ONLY":
- return Edition.EDITION_99998_TEST_ONLY;
- case 99999:
- case "EDITION_99999_TEST_ONLY":
- return Edition.EDITION_99999_TEST_ONLY;
- case 2147483647:
- case "EDITION_MAX":
- return Edition.EDITION_MAX;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Edition.UNRECOGNIZED;
- }
-}
-
-export function editionToJSON(object: Edition): string {
- switch (object) {
- case Edition.EDITION_UNKNOWN:
- return "EDITION_UNKNOWN";
- case Edition.EDITION_LEGACY:
- return "EDITION_LEGACY";
- case Edition.EDITION_PROTO2:
- return "EDITION_PROTO2";
- case Edition.EDITION_PROTO3:
- return "EDITION_PROTO3";
- case Edition.EDITION_2023:
- return "EDITION_2023";
- case Edition.EDITION_2024:
- return "EDITION_2024";
- case Edition.EDITION_1_TEST_ONLY:
- return "EDITION_1_TEST_ONLY";
- case Edition.EDITION_2_TEST_ONLY:
- return "EDITION_2_TEST_ONLY";
- case Edition.EDITION_99997_TEST_ONLY:
- return "EDITION_99997_TEST_ONLY";
- case Edition.EDITION_99998_TEST_ONLY:
- return "EDITION_99998_TEST_ONLY";
- case Edition.EDITION_99999_TEST_ONLY:
- return "EDITION_99999_TEST_ONLY";
- case Edition.EDITION_MAX:
- return "EDITION_MAX";
- case Edition.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function editionToNumber(object: Edition): number {
- switch (object) {
- case Edition.EDITION_UNKNOWN:
- return 0;
- case Edition.EDITION_LEGACY:
- return 900;
- case Edition.EDITION_PROTO2:
- return 998;
- case Edition.EDITION_PROTO3:
- return 999;
- case Edition.EDITION_2023:
- return 1000;
- case Edition.EDITION_2024:
- return 1001;
- case Edition.EDITION_1_TEST_ONLY:
- return 1;
- case Edition.EDITION_2_TEST_ONLY:
- return 2;
- case Edition.EDITION_99997_TEST_ONLY:
- return 99997;
- case Edition.EDITION_99998_TEST_ONLY:
- return 99998;
- case Edition.EDITION_99999_TEST_ONLY:
- return 99999;
- case Edition.EDITION_MAX:
- return 2147483647;
- case Edition.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface MessageOptions {
- /**
- * Set true to use the old proto1 MessageSet wire format for extensions.
- * This is provided for backwards-compatibility with the MessageSet wire
- * format. You should not use this for any other reason: It's less
- * efficient, has fewer features, and is more complicated.
- *
- * The message must be defined exactly as follows:
- * message Foo {
- * option message_set_wire_format = true;
- * extensions 4 to max;
- * }
- * Note that the message cannot have any defined fields; MessageSets only
- * have extensions.
- *
- * All extensions of your type must be singular messages; e.g. they cannot
- * be int32s, enums, or repeated messages.
- *
- * Because this is an option, the above two restrictions are not enforced by
- * the protocol compiler.
- */
- messageSetWireFormat?:
- | boolean
- | undefined;
- /**
- * Disables the generation of the standard "descriptor()" accessor, which can
- * conflict with a field of the same name. This is meant to make migration
- * from proto1 easier; new code should avoid fields named "descriptor".
- */
- noStandardDescriptorAccessor?:
- | boolean
- | undefined;
- /**
- * Is this message deprecated?
- * Depending on the target platform, this can emit Deprecated annotations
- * for the message, or it will be completely ignored; in the very least,
- * this is a formalization for deprecating messages.
- */
- deprecated?:
- | boolean
- | undefined;
- /**
- * Whether the message is an automatically generated map entry type for the
- * maps field.
- *
- * For maps fields:
- * map<KeyType, ValueType> map_field = 1;
- * The parsed descriptor looks like:
- * message MapFieldEntry {
- * option map_entry = true;
- * optional KeyType key = 1;
- * optional ValueType value = 2;
- * }
- * repeated MapFieldEntry map_field = 1;
- *
- * Implementations may choose not to generate the map_entry=true message, but
- * use a native map in the target language to hold the keys and values.
- * The reflection APIs in such implementations still need to work as
- * if the field is a repeated message field.
- *
- * NOTE: Do not set the option in .proto files. Always use the maps syntax
- * instead. The option should only be implicitly set by the proto compiler
- * parser.
- */
- mapEntry?:
- | boolean
- | undefined;
- /**
- * Enable the legacy handling of JSON field name conflicts. This lowercases
- * and strips underscored from the fields before comparison in proto3 only.
- * The new behavior takes `json_name` into account and applies to proto2 as
- * well.
- *
- * This should only be used as a temporary measure against broken builds due
- * to the change in behavior for JSON field name conflicts.
- *
- * TODO This is legacy behavior we plan to remove once downstream
- * teams have had time to migrate.
- *
- * @deprecated
- */
- deprecatedLegacyJsonFieldConflicts?:
- | boolean
- | undefined;
- /**
- * Any features defined in the specific edition.
- * WARNING: This field should only be used by protobuf plugins or special
- * cases like the proto compiler. Other uses are discouraged and
- * developers should rely on the protoreflect APIs for their client language.
- */
- features?:
- | FeatureSet
- | undefined;
- /** The parser stores options it doesn't recognize here. See above. */
- uninterpretedOption: UninterpretedOption[];
-}
-
-export interface FieldOptions {
- /**
- * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
- * The ctype option instructs the C++ code generator to use a different
- * representation of the field than it normally would. See the specific
- * options below. This option is only implemented to support use of
- * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
- * type "bytes" in the open source release.
- * TODO: make ctype actually deprecated.
- */
- ctype?:
- | FieldOptions_CType
- | undefined;
- /**
- * The packed option can be enabled for repeated primitive fields to enable
- * a more efficient representation on the wire. Rather than repeatedly
- * writing the tag and type for each element, the entire array is encoded as
- * a single length-delimited blob. In proto3, only explicit setting it to
- * false will avoid using packed encoding. This option is prohibited in
- * Editions, but the `repeated_field_encoding` feature can be used to control
- * the behavior.
- */
- packed?:
- | boolean
- | undefined;
- /**
- * The jstype option determines the JavaScript type used for values of the
- * field. The option is permitted only for 64 bit integral and fixed types
- * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
- * is represented as JavaScript string, which avoids loss of precision that
- * can happen when a large value is converted to a floating point JavaScript.
- * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
- * use the JavaScript "number" type. The behavior of the default option
- * JS_NORMAL is implementation dependent.
- *
- * This option is an enum to permit additional types to be added, e.g.
- * goog.math.Integer.
- */
- jstype?:
- | FieldOptions_JSType
- | undefined;
- /**
- * Should this field be parsed lazily? Lazy applies only to message-type
- * fields. It means that when the outer message is initially parsed, the
- * inner message's contents will not be parsed but instead stored in encoded
- * form. The inner message will actually be parsed when it is first accessed.
- *
- * This is only a hint. Implementations are free to choose whether to use
- * eager or lazy parsing regardless of the value of this option. However,
- * setting this option true suggests that the protocol author believes that
- * using lazy parsing on this field is worth the additional bookkeeping
- * overhead typically needed to implement it.
- *
- * This option does not affect the public interface of any generated code;
- * all method signatures remain the same. Furthermore, thread-safety of the
- * interface is not affected by this option; const methods remain safe to
- * call from multiple threads concurrently, while non-const methods continue
- * to require exclusive access.
- *
- * Note that lazy message fields are still eagerly verified to check
- * ill-formed wireformat or missing required fields. Calling IsInitialized()
- * on the outer message would fail if the inner message has missing required
- * fields. Failed verification would result in parsing failure (except when
- * uninitialized messages are acceptable).
- */
- lazy?:
- | boolean
- | undefined;
- /**
- * unverified_lazy does no correctness checks on the byte stream. This should
- * only be used where lazy with verification is prohibitive for performance
- * reasons.
- */
- unverifiedLazy?:
- | boolean
- | undefined;
- /**
- * Is this field deprecated?
- * Depending on the target platform, this can emit Deprecated annotations
- * for accessors, or it will be completely ignored; in the very least, this
- * is a formalization for deprecating fields.
- */
- deprecated?:
- | boolean
- | undefined;
- /** For Google-internal migration only. Do not use. */
- weak?:
- | boolean
- | undefined;
- /**
- * Indicate that the field value should not be printed out when using debug
- * formats, e.g. when the field contains sensitive credentials.
- */
- debugRedact?: boolean | undefined;
- retention?: FieldOptions_OptionRetention | undefined;
- targets: FieldOptions_OptionTargetType[];
- editionDefaults: FieldOptions_EditionDefault[];
- /**
- * Any features defined in the specific edition.
- * WARNING: This field should only be used by protobuf plugins or special
- * cases like the proto compiler. Other uses are discouraged and
- * developers should rely on the protoreflect APIs for their client language.
- */
- features?: FeatureSet | undefined;
- featureSupport?:
- | FieldOptions_FeatureSupport
- | undefined;
- /** The parser stores options it doesn't recognize here. See above. */
- uninterpretedOption: UninterpretedOption[];
-}
-
-export enum FieldOptions_CType {
- /** STRING - Default mode. */
- STRING = "STRING",
- /**
- * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type
- * "bytes". It indicates that in C++, the data should be stored in a Cord
- * instead of a string. For very large strings, this may reduce memory
- * fragmentation. It may also allow better performance when parsing from a
- * Cord, or when parsing with aliasing enabled, as the parsed Cord may then
- * alias the original buffer.
- */
- CORD = "CORD",
- STRING_PIECE = "STRING_PIECE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType {
- switch (object) {
- case 0:
- case "STRING":
- return FieldOptions_CType.STRING;
- case 1:
- case "CORD":
- return FieldOptions_CType.CORD;
- case 2:
- case "STRING_PIECE":
- return FieldOptions_CType.STRING_PIECE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FieldOptions_CType.UNRECOGNIZED;
- }
-}
-
-export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string {
- switch (object) {
- case FieldOptions_CType.STRING:
- return "STRING";
- case FieldOptions_CType.CORD:
- return "CORD";
- case FieldOptions_CType.STRING_PIECE:
- return "STRING_PIECE";
- case FieldOptions_CType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "JS_NORMAL",
- /** JS_STRING - Use JavaScript strings. */
- JS_STRING = "JS_STRING",
- /** JS_NUMBER - Use JavaScript numbers. */
- JS_NUMBER = "JS_NUMBER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType {
- switch (object) {
- case 0:
- case "JS_NORMAL":
- return FieldOptions_JSType.JS_NORMAL;
- case 1:
- case "JS_STRING":
- return FieldOptions_JSType.JS_STRING;
- case 2:
- case "JS_NUMBER":
- return FieldOptions_JSType.JS_NUMBER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FieldOptions_JSType.UNRECOGNIZED;
- }
-}
-
-export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string {
- switch (object) {
- case FieldOptions_JSType.JS_NORMAL:
- return "JS_NORMAL";
- case FieldOptions_JSType.JS_STRING:
- return "JS_STRING";
- case FieldOptions_JSType.JS_NUMBER:
- return "JS_NUMBER";
- case FieldOptions_JSType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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. */
-export enum FieldOptions_OptionRetention {
- RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
- RETENTION_RUNTIME = "RETENTION_RUNTIME",
- RETENTION_SOURCE = "RETENTION_SOURCE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention {
- switch (object) {
- case 0:
- case "RETENTION_UNKNOWN":
- return FieldOptions_OptionRetention.RETENTION_UNKNOWN;
- case 1:
- case "RETENTION_RUNTIME":
- return FieldOptions_OptionRetention.RETENTION_RUNTIME;
- case 2:
- case "RETENTION_SOURCE":
- return FieldOptions_OptionRetention.RETENTION_SOURCE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FieldOptions_OptionRetention.UNRECOGNIZED;
- }
-}
-
-export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string {
- switch (object) {
- case FieldOptions_OptionRetention.RETENTION_UNKNOWN:
- return "RETENTION_UNKNOWN";
- case FieldOptions_OptionRetention.RETENTION_RUNTIME:
- return "RETENTION_RUNTIME";
- case FieldOptions_OptionRetention.RETENTION_SOURCE:
- return "RETENTION_SOURCE";
- case FieldOptions_OptionRetention.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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
- * option on any kind of entity.
- */
-export enum FieldOptions_OptionTargetType {
- 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 {
- switch (object) {
- case 0:
- case "TARGET_TYPE_UNKNOWN":
- return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN;
- case 1:
- case "TARGET_TYPE_FILE":
- return FieldOptions_OptionTargetType.TARGET_TYPE_FILE;
- case 2:
- case "TARGET_TYPE_EXTENSION_RANGE":
- return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE;
- case 3:
- case "TARGET_TYPE_MESSAGE":
- return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE;
- case 4:
- case "TARGET_TYPE_FIELD":
- return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD;
- case 5:
- case "TARGET_TYPE_ONEOF":
- return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF;
- case 6:
- case "TARGET_TYPE_ENUM":
- return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM;
- case 7:
- case "TARGET_TYPE_ENUM_ENTRY":
- return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY;
- case 8:
- case "TARGET_TYPE_SERVICE":
- return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE;
- case 9:
- case "TARGET_TYPE_METHOD":
- return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FieldOptions_OptionTargetType.UNRECOGNIZED;
- }
-}
-
-export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string {
- switch (object) {
- case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN:
- return "TARGET_TYPE_UNKNOWN";
- case FieldOptions_OptionTargetType.TARGET_TYPE_FILE:
- return "TARGET_TYPE_FILE";
- case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE:
- return "TARGET_TYPE_EXTENSION_RANGE";
- case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE:
- return "TARGET_TYPE_MESSAGE";
- case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD:
- return "TARGET_TYPE_FIELD";
- case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF:
- return "TARGET_TYPE_ONEOF";
- case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM:
- return "TARGET_TYPE_ENUM";
- case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY:
- return "TARGET_TYPE_ENUM_ENTRY";
- case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE:
- return "TARGET_TYPE_SERVICE";
- case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD:
- return "TARGET_TYPE_METHOD";
- case FieldOptions_OptionTargetType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export 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 FieldOptions_EditionDefault {
- edition?:
- | Edition
- | undefined;
- /** Textproto value. */
- value?: string | undefined;
-}
-
-/** Information about the support window of a feature. */
-export interface FieldOptions_FeatureSupport {
- /**
- * The edition that this feature was first available in. In editions
- * earlier than this one, the default assigned to EDITION_LEGACY will be
- * used, and proto files will not be able to override it.
- */
- editionIntroduced?:
- | Edition
- | undefined;
- /**
- * The edition this feature becomes deprecated in. Using this after this
- * edition may trigger warnings.
- */
- editionDeprecated?:
- | Edition
- | undefined;
- /**
- * The deprecation warning text if this feature is used after the edition it
- * was marked deprecated in.
- */
- deprecationWarning?:
- | string
- | undefined;
- /**
- * The edition this feature is no longer available in. In editions after
- * this one, the last default assigned will be used, and proto files will
- * not be able to override it.
- */
- editionRemoved?: Edition | undefined;
-}
-
-export interface MethodOptions {
- /**
- * Is this method deprecated?
- * Depending on the target platform, this can emit Deprecated annotations
- * for the method, or it will be completely ignored; in the very least,
- * this is a formalization for deprecating methods.
- */
- deprecated?: boolean | undefined;
- idempotencyLevel?:
- | MethodOptions_IdempotencyLevel
- | undefined;
- /**
- * Any features defined in the specific edition.
- * WARNING: This field should only be used by protobuf plugins or special
- * cases like the proto compiler. Other uses are discouraged and
- * developers should rely on the protoreflect APIs for their client language.
- */
- features?:
- | FeatureSet
- | undefined;
- /** The parser stores options it doesn't recognize here. See above. */
- uninterpretedOption: UninterpretedOption[];
-}
-
-/**
- * Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
- * or neither? HTTP based RPC implementation may choose GET verb for safe
- * methods, and PUT verb for idempotent methods instead of the default POST.
- */
-export enum MethodOptions_IdempotencyLevel {
- IDEMPOTENCY_UNKNOWN = "IDEMPOTENCY_UNKNOWN",
- /** NO_SIDE_EFFECTS - implies idempotent */
- NO_SIDE_EFFECTS = "NO_SIDE_EFFECTS",
- /** IDEMPOTENT - idempotent, but may have side effects */
- IDEMPOTENT = "IDEMPOTENT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel {
- switch (object) {
- case 0:
- case "IDEMPOTENCY_UNKNOWN":
- return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN;
- case 1:
- case "NO_SIDE_EFFECTS":
- return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS;
- case 2:
- case "IDEMPOTENT":
- return MethodOptions_IdempotencyLevel.IDEMPOTENT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return MethodOptions_IdempotencyLevel.UNRECOGNIZED;
- }
-}
-
-export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string {
- switch (object) {
- case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN:
- return "IDEMPOTENCY_UNKNOWN";
- case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS:
- return "NO_SIDE_EFFECTS";
- case MethodOptions_IdempotencyLevel.IDEMPOTENT:
- return "IDEMPOTENT";
- case MethodOptions_IdempotencyLevel.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * DescriptorPool resolves these when building Descriptor objects. Therefore,
- * options protos in descriptor objects (e.g. returned by Descriptor::options(),
- * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
- * in them.
- */
-export interface UninterpretedOption {
- name: UninterpretedOption_NamePart[];
- /**
- * The value of the uninterpreted option, in whatever type the tokenizer
- * identified it as during parsing. Exactly one of these should be set.
- */
- identifierValue?: string | undefined;
- positiveIntValue?: Long | undefined;
- negativeIntValue?: Long | undefined;
- doubleValue?: number | undefined;
- stringValue?: Uint8Array | undefined;
- aggregateValue?: string | undefined;
-}
-
-/**
- * The name of the uninterpreted option. Each string represents a segment in
- * a dot-separated name. is_extension is true iff a segment represents an
- * extension (denoted with parentheses in options specs in .proto files).
- * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
- * "foo.(bar.baz).moo".
- */
-export interface UninterpretedOption_NamePart {
- namePart: string;
- isExtension: boolean;
-}
-
-/**
- * TODO Enums in C++ gencode (and potentially other languages) are
- * not well scoped. This means that each of the feature enums below can clash
- * with each other. The short names we've chosen maximize call-site
- * readability, but leave us very open to this scenario. A future feature will
- * be designed and implemented to handle this, hopefully before we ever hit a
- * conflict here.
- */
-export interface FeatureSet {
- fieldPresence?: FeatureSet_FieldPresence | undefined;
- enumType?: FeatureSet_EnumType | undefined;
- repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined;
- utf8Validation?: FeatureSet_Utf8Validation | undefined;
- messageEncoding?: FeatureSet_MessageEncoding | undefined;
- jsonFormat?: FeatureSet_JsonFormat | undefined;
- enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
- defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility | undefined;
-}
-
-export enum FeatureSet_FieldPresence {
- FIELD_PRESENCE_UNKNOWN = "FIELD_PRESENCE_UNKNOWN",
- EXPLICIT = "EXPLICIT",
- IMPLICIT = "IMPLICIT",
- LEGACY_REQUIRED = "LEGACY_REQUIRED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence {
- switch (object) {
- case 0:
- case "FIELD_PRESENCE_UNKNOWN":
- return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN;
- case 1:
- case "EXPLICIT":
- return FeatureSet_FieldPresence.EXPLICIT;
- case 2:
- case "IMPLICIT":
- return FeatureSet_FieldPresence.IMPLICIT;
- case 3:
- case "LEGACY_REQUIRED":
- return FeatureSet_FieldPresence.LEGACY_REQUIRED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_FieldPresence.UNRECOGNIZED;
- }
-}
-
-export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string {
- switch (object) {
- case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN:
- return "FIELD_PRESENCE_UNKNOWN";
- case FeatureSet_FieldPresence.EXPLICIT:
- return "EXPLICIT";
- case FeatureSet_FieldPresence.IMPLICIT:
- return "IMPLICIT";
- case FeatureSet_FieldPresence.LEGACY_REQUIRED:
- return "LEGACY_REQUIRED";
- case FeatureSet_FieldPresence.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_FieldPresenceToNumber(object: FeatureSet_FieldPresence): number {
- switch (object) {
- case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN:
- return 0;
- case FeatureSet_FieldPresence.EXPLICIT:
- return 1;
- case FeatureSet_FieldPresence.IMPLICIT:
- return 2;
- case FeatureSet_FieldPresence.LEGACY_REQUIRED:
- return 3;
- case FeatureSet_FieldPresence.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_EnumType {
- ENUM_TYPE_UNKNOWN = "ENUM_TYPE_UNKNOWN",
- OPEN = "OPEN",
- CLOSED = "CLOSED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType {
- switch (object) {
- case 0:
- case "ENUM_TYPE_UNKNOWN":
- return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN;
- case 1:
- case "OPEN":
- return FeatureSet_EnumType.OPEN;
- case 2:
- case "CLOSED":
- return FeatureSet_EnumType.CLOSED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_EnumType.UNRECOGNIZED;
- }
-}
-
-export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string {
- switch (object) {
- case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN:
- return "ENUM_TYPE_UNKNOWN";
- case FeatureSet_EnumType.OPEN:
- return "OPEN";
- case FeatureSet_EnumType.CLOSED:
- return "CLOSED";
- case FeatureSet_EnumType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_EnumTypeToNumber(object: FeatureSet_EnumType): number {
- switch (object) {
- case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN:
- return 0;
- case FeatureSet_EnumType.OPEN:
- return 1;
- case FeatureSet_EnumType.CLOSED:
- return 2;
- case FeatureSet_EnumType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_RepeatedFieldEncoding {
- REPEATED_FIELD_ENCODING_UNKNOWN = "REPEATED_FIELD_ENCODING_UNKNOWN",
- PACKED = "PACKED",
- EXPANDED = "EXPANDED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding {
- switch (object) {
- case 0:
- case "REPEATED_FIELD_ENCODING_UNKNOWN":
- return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN;
- case 1:
- case "PACKED":
- return FeatureSet_RepeatedFieldEncoding.PACKED;
- case 2:
- case "EXPANDED":
- return FeatureSet_RepeatedFieldEncoding.EXPANDED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED;
- }
-}
-
-export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string {
- switch (object) {
- case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN:
- return "REPEATED_FIELD_ENCODING_UNKNOWN";
- case FeatureSet_RepeatedFieldEncoding.PACKED:
- return "PACKED";
- case FeatureSet_RepeatedFieldEncoding.EXPANDED:
- return "EXPANDED";
- case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_RepeatedFieldEncodingToNumber(object: FeatureSet_RepeatedFieldEncoding): number {
- switch (object) {
- case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN:
- return 0;
- case FeatureSet_RepeatedFieldEncoding.PACKED:
- return 1;
- case FeatureSet_RepeatedFieldEncoding.EXPANDED:
- return 2;
- case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_Utf8Validation {
- UTF8_VALIDATION_UNKNOWN = "UTF8_VALIDATION_UNKNOWN",
- VERIFY = "VERIFY",
- NONE = "NONE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation {
- switch (object) {
- case 0:
- case "UTF8_VALIDATION_UNKNOWN":
- return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
- case 2:
- case "VERIFY":
- return FeatureSet_Utf8Validation.VERIFY;
- case 3:
- case "NONE":
- return FeatureSet_Utf8Validation.NONE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_Utf8Validation.UNRECOGNIZED;
- }
-}
-
-export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string {
- switch (object) {
- case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:
- return "UTF8_VALIDATION_UNKNOWN";
- case FeatureSet_Utf8Validation.VERIFY:
- return "VERIFY";
- case FeatureSet_Utf8Validation.NONE:
- return "NONE";
- case FeatureSet_Utf8Validation.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_Utf8ValidationToNumber(object: FeatureSet_Utf8Validation): number {
- switch (object) {
- case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:
- return 0;
- case FeatureSet_Utf8Validation.VERIFY:
- return 2;
- case FeatureSet_Utf8Validation.NONE:
- return 3;
- case FeatureSet_Utf8Validation.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_MessageEncoding {
- MESSAGE_ENCODING_UNKNOWN = "MESSAGE_ENCODING_UNKNOWN",
- LENGTH_PREFIXED = "LENGTH_PREFIXED",
- DELIMITED = "DELIMITED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding {
- switch (object) {
- case 0:
- case "MESSAGE_ENCODING_UNKNOWN":
- return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
- case 1:
- case "LENGTH_PREFIXED":
- return FeatureSet_MessageEncoding.LENGTH_PREFIXED;
- case 2:
- case "DELIMITED":
- return FeatureSet_MessageEncoding.DELIMITED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_MessageEncoding.UNRECOGNIZED;
- }
-}
-
-export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string {
- switch (object) {
- case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN:
- return "MESSAGE_ENCODING_UNKNOWN";
- case FeatureSet_MessageEncoding.LENGTH_PREFIXED:
- return "LENGTH_PREFIXED";
- case FeatureSet_MessageEncoding.DELIMITED:
- return "DELIMITED";
- case FeatureSet_MessageEncoding.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_MessageEncodingToNumber(object: FeatureSet_MessageEncoding): number {
- switch (object) {
- case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN:
- return 0;
- case FeatureSet_MessageEncoding.LENGTH_PREFIXED:
- return 1;
- case FeatureSet_MessageEncoding.DELIMITED:
- return 2;
- case FeatureSet_MessageEncoding.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_JsonFormat {
- JSON_FORMAT_UNKNOWN = "JSON_FORMAT_UNKNOWN",
- ALLOW = "ALLOW",
- LEGACY_BEST_EFFORT = "LEGACY_BEST_EFFORT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat {
- switch (object) {
- case 0:
- case "JSON_FORMAT_UNKNOWN":
- return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
- case 1:
- case "ALLOW":
- return FeatureSet_JsonFormat.ALLOW;
- case 2:
- case "LEGACY_BEST_EFFORT":
- return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_JsonFormat.UNRECOGNIZED;
- }
-}
-
-export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string {
- switch (object) {
- case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN:
- return "JSON_FORMAT_UNKNOWN";
- case FeatureSet_JsonFormat.ALLOW:
- return "ALLOW";
- case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT:
- return "LEGACY_BEST_EFFORT";
- case FeatureSet_JsonFormat.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): number {
- switch (object) {
- case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN:
- return 0;
- case FeatureSet_JsonFormat.ALLOW:
- return 1;
- case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT:
- return 2;
- case FeatureSet_JsonFormat.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum FeatureSet_EnforceNamingStyle {
- ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
- STYLE2024 = "STYLE2024",
- STYLE_LEGACY = "STYLE_LEGACY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
- switch (object) {
- case 0:
- case "ENFORCE_NAMING_STYLE_UNKNOWN":
- return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
- case 1:
- case "STYLE2024":
- return FeatureSet_EnforceNamingStyle.STYLE2024;
- case 2:
- case "STYLE_LEGACY":
- return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
- }
-}
-
-export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string {
- switch (object) {
- case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
- return "ENFORCE_NAMING_STYLE_UNKNOWN";
- case FeatureSet_EnforceNamingStyle.STYLE2024:
- return "STYLE2024";
- case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
- return "STYLE_LEGACY";
- case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
- switch (object) {
- case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
- return 0;
- case FeatureSet_EnforceNamingStyle.STYLE2024:
- return 1;
- case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
- return 2;
- case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface FeatureSet_VisibilityFeature {
-}
-
-export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility {
- DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",
- /** EXPORT_ALL - Default pre-EDITION_2024, all UNSET visibility are export. */
- EXPORT_ALL = "EXPORT_ALL",
- /** EXPORT_TOP_LEVEL - All top-level symbols default to export, nested default to local. */
- EXPORT_TOP_LEVEL = "EXPORT_TOP_LEVEL",
- /** LOCAL_ALL - All symbols default to local. */
- LOCAL_ALL = "LOCAL_ALL",
- /**
- * STRICT - All symbols local by default. Nested types cannot be exported.
- * With special case caveat for message { enum {} reserved 1 to max; }
- * This is the recommended setting for new protos.
- */
- STRICT = "STRICT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(
- object: any,
-): FeatureSet_VisibilityFeature_DefaultSymbolVisibility {
- switch (object) {
- case 0:
- case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN":
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
- case 1:
- case "EXPORT_ALL":
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL;
- case 2:
- case "EXPORT_TOP_LEVEL":
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL;
- case 3:
- case "LOCAL_ALL":
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL;
- case 4:
- case "STRICT":
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED;
- }
-}
-
-export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON(
- object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility,
-): string {
- switch (object) {
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:
- return "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN";
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL:
- return "EXPORT_ALL";
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL:
- return "EXPORT_TOP_LEVEL";
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL:
- return "LOCAL_ALL";
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT:
- return "STRICT";
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToNumber(
- object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility,
-): number {
- switch (object) {
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:
- return 0;
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL:
- return 1;
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL:
- return 2;
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL:
- return 3;
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT:
- return 4;
- case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseMessageOptions(): MessageOptions {
- return {
- messageSetWireFormat: false,
- noStandardDescriptorAccessor: false,
- deprecated: false,
- mapEntry: false,
- deprecatedLegacyJsonFieldConflicts: false,
- features: undefined,
- uninterpretedOption: [],
- };
-}
-
-export const MessageOptions: MessageFns<MessageOptions> = {
- encode(message: MessageOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) {
- writer.uint32(8).bool(message.messageSetWireFormat);
- }
- if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) {
- writer.uint32(16).bool(message.noStandardDescriptorAccessor);
- }
- if (message.deprecated !== undefined && message.deprecated !== false) {
- writer.uint32(24).bool(message.deprecated);
- }
- if (message.mapEntry !== undefined && message.mapEntry !== false) {
- writer.uint32(56).bool(message.mapEntry);
- }
- if (
- message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false
- ) {
- writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts);
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(98).fork()).join();
- }
- for (const v of message.uninterpretedOption) {
- UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMessageOptions();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.messageSetWireFormat = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.noStandardDescriptorAccessor = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.deprecated = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.mapEntry = reader.bool();
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.deprecatedLegacyJsonFieldConflicts = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- }
- case 999: {
- if (tag !== 7994) {
- break;
- }
-
- message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MessageOptions {
- return {
- messageSetWireFormat: isSet(object.messageSetWireFormat)
- ? globalThis.Boolean(object.messageSetWireFormat)
- : false,
- noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor)
- ? globalThis.Boolean(object.noStandardDescriptorAccessor)
- : false,
- deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
- mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false,
- deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)
- ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts)
- : false,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
- ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: MessageOptions): unknown {
- const obj: any = {};
- if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) {
- obj.messageSetWireFormat = message.messageSetWireFormat;
- }
- if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) {
- obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;
- }
- if (message.deprecated !== undefined && message.deprecated !== false) {
- obj.deprecated = message.deprecated;
- }
- if (message.mapEntry !== undefined && message.mapEntry !== false) {
- obj.mapEntry = message.mapEntry;
- }
- if (
- message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false
- ) {
- obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- if (message.uninterpretedOption?.length) {
- obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<MessageOptions>): MessageOptions {
- return MessageOptions.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MessageOptions>): MessageOptions {
- const message = createBaseMessageOptions();
- message.messageSetWireFormat = object.messageSetWireFormat ?? false;
- message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false;
- message.deprecated = object.deprecated ?? false;
- message.mapEntry = object.mapEntry ?? false;
- message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseFieldOptions(): FieldOptions {
- return {
- ctype: FieldOptions_CType.STRING,
- packed: false,
- jstype: FieldOptions_JSType.JS_NORMAL,
- lazy: false,
- unverifiedLazy: false,
- deprecated: false,
- weak: false,
- debugRedact: false,
- retention: FieldOptions_OptionRetention.RETENTION_UNKNOWN,
- targets: [],
- editionDefaults: [],
- features: undefined,
- featureSupport: undefined,
- uninterpretedOption: [],
- };
-}
-
-export const FieldOptions: MessageFns<FieldOptions> = {
- encode(message: FieldOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.ctype !== undefined && message.ctype !== FieldOptions_CType.STRING) {
- writer.uint32(8).int32(fieldOptions_CTypeToNumber(message.ctype));
- }
- if (message.packed !== undefined && message.packed !== false) {
- writer.uint32(16).bool(message.packed);
- }
- if (message.jstype !== undefined && message.jstype !== FieldOptions_JSType.JS_NORMAL) {
- writer.uint32(48).int32(fieldOptions_JSTypeToNumber(message.jstype));
- }
- if (message.lazy !== undefined && message.lazy !== false) {
- writer.uint32(40).bool(message.lazy);
- }
- if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) {
- writer.uint32(120).bool(message.unverifiedLazy);
- }
- if (message.deprecated !== undefined && message.deprecated !== false) {
- writer.uint32(24).bool(message.deprecated);
- }
- if (message.weak !== undefined && message.weak !== false) {
- writer.uint32(80).bool(message.weak);
- }
- if (message.debugRedact !== undefined && message.debugRedact !== false) {
- writer.uint32(128).bool(message.debugRedact);
- }
- if (message.retention !== undefined && message.retention !== FieldOptions_OptionRetention.RETENTION_UNKNOWN) {
- writer.uint32(136).int32(fieldOptions_OptionRetentionToNumber(message.retention));
- }
- writer.uint32(154).fork();
- for (const v of message.targets) {
- writer.int32(fieldOptions_OptionTargetTypeToNumber(v));
- }
- writer.join();
- for (const v of message.editionDefaults) {
- FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).join();
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(170).fork()).join();
- }
- if (message.featureSupport !== undefined) {
- FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).join();
- }
- for (const v of message.uninterpretedOption) {
- UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldOptions();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.ctype = fieldOptions_CTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.packed = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.jstype = fieldOptions_JSTypeFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.lazy = reader.bool();
- continue;
- }
- case 15: {
- if (tag !== 120) {
- break;
- }
-
- message.unverifiedLazy = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.deprecated = reader.bool();
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.weak = reader.bool();
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
-
- message.debugRedact = reader.bool();
- continue;
- }
- case 17: {
- if (tag !== 136) {
- break;
- }
-
- message.retention = fieldOptions_OptionRetentionFromJSON(reader.int32());
- continue;
- }
- case 19: {
- if (tag === 152) {
- message.targets.push(fieldOptions_OptionTargetTypeFromJSON(reader.int32()));
-
- continue;
- }
-
- if (tag === 154) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.targets.push(fieldOptions_OptionTargetTypeFromJSON(reader.int32()));
- }
-
- continue;
- }
-
- break;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32()));
- continue;
- }
- case 21: {
- if (tag !== 170) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32());
- continue;
- }
- case 999: {
- if (tag !== 7994) {
- break;
- }
-
- message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldOptions {
- return {
- ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : FieldOptions_CType.STRING,
- packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false,
- jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : FieldOptions_JSType.JS_NORMAL,
- lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false,
- unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false,
- deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
- weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false,
- debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,
- retention: isSet(object.retention)
- ? fieldOptions_OptionRetentionFromJSON(object.retention)
- : FieldOptions_OptionRetention.RETENTION_UNKNOWN,
- targets: globalThis.Array.isArray(object?.targets)
- ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e))
- : [],
- editionDefaults: globalThis.Array.isArray(object?.editionDefaults)
- ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e))
- : [],
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- featureSupport: isSet(object.featureSupport)
- ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport)
- : undefined,
- uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
- ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: FieldOptions): unknown {
- const obj: any = {};
- if (message.ctype !== undefined && message.ctype !== FieldOptions_CType.STRING) {
- obj.ctype = fieldOptions_CTypeToJSON(message.ctype);
- }
- if (message.packed !== undefined && message.packed !== false) {
- obj.packed = message.packed;
- }
- if (message.jstype !== undefined && message.jstype !== FieldOptions_JSType.JS_NORMAL) {
- obj.jstype = fieldOptions_JSTypeToJSON(message.jstype);
- }
- if (message.lazy !== undefined && message.lazy !== false) {
- obj.lazy = message.lazy;
- }
- if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) {
- obj.unverifiedLazy = message.unverifiedLazy;
- }
- if (message.deprecated !== undefined && message.deprecated !== false) {
- obj.deprecated = message.deprecated;
- }
- if (message.weak !== undefined && message.weak !== false) {
- obj.weak = message.weak;
- }
- if (message.debugRedact !== undefined && message.debugRedact !== false) {
- obj.debugRedact = message.debugRedact;
- }
- if (message.retention !== undefined && message.retention !== FieldOptions_OptionRetention.RETENTION_UNKNOWN) {
- obj.retention = fieldOptions_OptionRetentionToJSON(message.retention);
- }
- if (message.targets?.length) {
- obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e));
- }
- if (message.editionDefaults?.length) {
- obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e));
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- if (message.featureSupport !== undefined) {
- obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport);
- }
- if (message.uninterpretedOption?.length) {
- obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<FieldOptions>): FieldOptions {
- return FieldOptions.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldOptions>): FieldOptions {
- const message = createBaseFieldOptions();
- message.ctype = object.ctype ?? FieldOptions_CType.STRING;
- message.packed = object.packed ?? false;
- 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 ?? FieldOptions_OptionRetention.RETENTION_UNKNOWN;
- message.targets = object.targets?.map((e) => e) || [];
- message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || [];
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null)
- ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport)
- : undefined;
- message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault {
- return { edition: Edition.EDITION_UNKNOWN, value: "" };
-}
-
-export const FieldOptions_EditionDefault: MessageFns<FieldOptions_EditionDefault> = {
- encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.edition !== undefined && message.edition !== Edition.EDITION_UNKNOWN) {
- writer.uint32(24).int32(editionToNumber(message.edition));
- }
- if (message.value !== undefined && message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldOptions_EditionDefault();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.edition = editionFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldOptions_EditionDefault {
- return {
- edition: isSet(object.edition) ? editionFromJSON(object.edition) : Edition.EDITION_UNKNOWN,
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: FieldOptions_EditionDefault): unknown {
- const obj: any = {};
- if (message.edition !== undefined && message.edition !== Edition.EDITION_UNKNOWN) {
- obj.edition = editionToJSON(message.edition);
- }
- if (message.value !== undefined && message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {
- return FieldOptions_EditionDefault.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {
- const message = createBaseFieldOptions_EditionDefault();
- message.edition = object.edition ?? Edition.EDITION_UNKNOWN;
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport {
- return {
- editionIntroduced: Edition.EDITION_UNKNOWN,
- editionDeprecated: Edition.EDITION_UNKNOWN,
- deprecationWarning: "",
- editionRemoved: Edition.EDITION_UNKNOWN,
- };
-}
-
-export const FieldOptions_FeatureSupport: MessageFns<FieldOptions_FeatureSupport> = {
- encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.editionIntroduced !== undefined && message.editionIntroduced !== Edition.EDITION_UNKNOWN) {
- writer.uint32(8).int32(editionToNumber(message.editionIntroduced));
- }
- if (message.editionDeprecated !== undefined && message.editionDeprecated !== Edition.EDITION_UNKNOWN) {
- writer.uint32(16).int32(editionToNumber(message.editionDeprecated));
- }
- if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") {
- writer.uint32(26).string(message.deprecationWarning);
- }
- if (message.editionRemoved !== undefined && message.editionRemoved !== Edition.EDITION_UNKNOWN) {
- writer.uint32(32).int32(editionToNumber(message.editionRemoved));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldOptions_FeatureSupport();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.editionIntroduced = editionFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.editionDeprecated = editionFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.deprecationWarning = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.editionRemoved = editionFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldOptions_FeatureSupport {
- return {
- editionIntroduced: isSet(object.editionIntroduced)
- ? editionFromJSON(object.editionIntroduced)
- : Edition.EDITION_UNKNOWN,
- editionDeprecated: isSet(object.editionDeprecated)
- ? editionFromJSON(object.editionDeprecated)
- : Edition.EDITION_UNKNOWN,
- deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "",
- editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : Edition.EDITION_UNKNOWN,
- };
- },
-
- toJSON(message: FieldOptions_FeatureSupport): unknown {
- const obj: any = {};
- if (message.editionIntroduced !== undefined && message.editionIntroduced !== Edition.EDITION_UNKNOWN) {
- obj.editionIntroduced = editionToJSON(message.editionIntroduced);
- }
- if (message.editionDeprecated !== undefined && message.editionDeprecated !== Edition.EDITION_UNKNOWN) {
- obj.editionDeprecated = editionToJSON(message.editionDeprecated);
- }
- if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") {
- obj.deprecationWarning = message.deprecationWarning;
- }
- if (message.editionRemoved !== undefined && message.editionRemoved !== Edition.EDITION_UNKNOWN) {
- obj.editionRemoved = editionToJSON(message.editionRemoved);
- }
- return obj;
- },
-
- create(base?: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {
- return FieldOptions_FeatureSupport.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {
- const message = createBaseFieldOptions_FeatureSupport();
- message.editionIntroduced = object.editionIntroduced ?? Edition.EDITION_UNKNOWN;
- message.editionDeprecated = object.editionDeprecated ?? Edition.EDITION_UNKNOWN;
- message.deprecationWarning = object.deprecationWarning ?? "";
- message.editionRemoved = object.editionRemoved ?? Edition.EDITION_UNKNOWN;
- return message;
- },
-};
-
-function createBaseMethodOptions(): MethodOptions {
- return {
- deprecated: false,
- idempotencyLevel: MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN,
- features: undefined,
- uninterpretedOption: [],
- };
-}
-
-export const MethodOptions: MessageFns<MethodOptions> = {
- encode(message: MethodOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.deprecated !== undefined && message.deprecated !== false) {
- writer.uint32(264).bool(message.deprecated);
- }
- if (
- message.idempotencyLevel !== undefined &&
- message.idempotencyLevel !== MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN
- ) {
- writer.uint32(272).int32(methodOptions_IdempotencyLevelToNumber(message.idempotencyLevel));
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(282).fork()).join();
- }
- for (const v of message.uninterpretedOption) {
- UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMethodOptions();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 33: {
- if (tag !== 264) {
- break;
- }
-
- message.deprecated = reader.bool();
- continue;
- }
- case 34: {
- if (tag !== 272) {
- break;
- }
-
- message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(reader.int32());
- continue;
- }
- case 35: {
- if (tag !== 282) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- }
- case 999: {
- if (tag !== 7994) {
- break;
- }
-
- message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MethodOptions {
- return {
- deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
- idempotencyLevel: isSet(object.idempotencyLevel)
- ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel)
- : MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
- ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: MethodOptions): unknown {
- const obj: any = {};
- if (message.deprecated !== undefined && message.deprecated !== false) {
- obj.deprecated = message.deprecated;
- }
- if (
- message.idempotencyLevel !== undefined &&
- message.idempotencyLevel !== MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN
- ) {
- obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel);
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- if (message.uninterpretedOption?.length) {
- obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<MethodOptions>): MethodOptions {
- return MethodOptions.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MethodOptions>): MethodOptions {
- const message = createBaseMethodOptions();
- message.deprecated = object.deprecated ?? false;
- message.idempotencyLevel = object.idempotencyLevel ?? MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseUninterpretedOption(): UninterpretedOption {
- return {
- name: [],
- identifierValue: "",
- positiveIntValue: Long.UZERO,
- negativeIntValue: Long.ZERO,
- doubleValue: 0,
- stringValue: new Uint8Array(0),
- aggregateValue: "",
- };
-}
-
-export const UninterpretedOption: MessageFns<UninterpretedOption> = {
- encode(message: UninterpretedOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.name) {
- UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).join();
- }
- if (message.identifierValue !== undefined && message.identifierValue !== "") {
- writer.uint32(26).string(message.identifierValue);
- }
- if (message.positiveIntValue !== undefined && !message.positiveIntValue.equals(Long.UZERO)) {
- writer.uint32(32).uint64(message.positiveIntValue.toString());
- }
- if (message.negativeIntValue !== undefined && !message.negativeIntValue.equals(Long.ZERO)) {
- writer.uint32(40).int64(message.negativeIntValue.toString());
- }
- if (message.doubleValue !== undefined && message.doubleValue !== 0) {
- writer.uint32(49).double(message.doubleValue);
- }
- if (message.stringValue !== undefined && message.stringValue.length !== 0) {
- writer.uint32(58).bytes(message.stringValue);
- }
- if (message.aggregateValue !== undefined && message.aggregateValue !== "") {
- writer.uint32(66).string(message.aggregateValue);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUninterpretedOption();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.identifierValue = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.positiveIntValue = Long.fromString(reader.uint64().toString(), true);
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.negativeIntValue = Long.fromString(reader.int64().toString());
- continue;
- }
- case 6: {
- if (tag !== 49) {
- break;
- }
-
- message.doubleValue = reader.double();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.stringValue = reader.bytes();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.aggregateValue = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UninterpretedOption {
- return {
- name: globalThis.Array.isArray(object?.name)
- ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e))
- : [],
- identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "",
- positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO,
- negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO,
- doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0,
- stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0),
- aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "",
- };
- },
-
- toJSON(message: UninterpretedOption): unknown {
- const obj: any = {};
- if (message.name?.length) {
- obj.name = message.name.map((e) => UninterpretedOption_NamePart.toJSON(e));
- }
- if (message.identifierValue !== undefined && message.identifierValue !== "") {
- obj.identifierValue = message.identifierValue;
- }
- if (message.positiveIntValue !== undefined && !message.positiveIntValue.equals(Long.UZERO)) {
- obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString();
- }
- if (message.negativeIntValue !== undefined && !message.negativeIntValue.equals(Long.ZERO)) {
- obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString();
- }
- if (message.doubleValue !== undefined && message.doubleValue !== 0) {
- obj.doubleValue = message.doubleValue;
- }
- if (message.stringValue !== undefined && message.stringValue.length !== 0) {
- obj.stringValue = base64FromBytes(message.stringValue);
- }
- if (message.aggregateValue !== undefined && message.aggregateValue !== "") {
- obj.aggregateValue = message.aggregateValue;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UninterpretedOption>): UninterpretedOption {
- return UninterpretedOption.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UninterpretedOption>): UninterpretedOption {
- const message = createBaseUninterpretedOption();
- message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || [];
- message.identifierValue = object.identifierValue ?? "";
- message.positiveIntValue = (object.positiveIntValue !== undefined && object.positiveIntValue !== null)
- ? Long.fromValue(object.positiveIntValue)
- : Long.UZERO;
- message.negativeIntValue = (object.negativeIntValue !== undefined && object.negativeIntValue !== null)
- ? Long.fromValue(object.negativeIntValue)
- : Long.ZERO;
- message.doubleValue = object.doubleValue ?? 0;
- message.stringValue = object.stringValue ?? new Uint8Array(0);
- message.aggregateValue = object.aggregateValue ?? "";
- return message;
- },
-};
-
-function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart {
- return { namePart: "", isExtension: false };
-}
-
-export const UninterpretedOption_NamePart: MessageFns<UninterpretedOption_NamePart> = {
- encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.namePart !== "") {
- writer.uint32(10).string(message.namePart);
- }
- if (message.isExtension !== false) {
- writer.uint32(16).bool(message.isExtension);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUninterpretedOption_NamePart();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.namePart = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.isExtension = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UninterpretedOption_NamePart {
- return {
- namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "",
- isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false,
- };
- },
-
- toJSON(message: UninterpretedOption_NamePart): unknown {
- const obj: any = {};
- if (message.namePart !== "") {
- obj.namePart = message.namePart;
- }
- if (message.isExtension !== false) {
- obj.isExtension = message.isExtension;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UninterpretedOption_NamePart>): UninterpretedOption_NamePart {
- return UninterpretedOption_NamePart.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UninterpretedOption_NamePart>): UninterpretedOption_NamePart {
- const message = createBaseUninterpretedOption_NamePart();
- message.namePart = object.namePart ?? "";
- message.isExtension = object.isExtension ?? false;
- return message;
- },
-};
-
-function createBaseFeatureSet(): FeatureSet {
- return {
- fieldPresence: FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN,
- enumType: FeatureSet_EnumType.ENUM_TYPE_UNKNOWN,
- repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN,
- utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
- messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
- jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
- enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
- defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
- };
-}
-
-export const FeatureSet: MessageFns<FeatureSet> = {
- encode(message: FeatureSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (
- message.fieldPresence !== undefined && message.fieldPresence !== FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN
- ) {
- writer.uint32(8).int32(featureSet_FieldPresenceToNumber(message.fieldPresence));
- }
- if (message.enumType !== undefined && message.enumType !== FeatureSet_EnumType.ENUM_TYPE_UNKNOWN) {
- writer.uint32(16).int32(featureSet_EnumTypeToNumber(message.enumType));
- }
- if (
- message.repeatedFieldEncoding !== undefined &&
- message.repeatedFieldEncoding !== FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN
- ) {
- writer.uint32(24).int32(featureSet_RepeatedFieldEncodingToNumber(message.repeatedFieldEncoding));
- }
- if (
- message.utf8Validation !== undefined &&
- message.utf8Validation !== FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN
- ) {
- writer.uint32(32).int32(featureSet_Utf8ValidationToNumber(message.utf8Validation));
- }
- if (
- message.messageEncoding !== undefined &&
- message.messageEncoding !== FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN
- ) {
- writer.uint32(40).int32(featureSet_MessageEncodingToNumber(message.messageEncoding));
- }
- if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
- writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
- }
- if (
- message.enforceNamingStyle !== undefined &&
- message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
- ) {
- writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
- }
- if (
- message.defaultSymbolVisibility !== undefined &&
- message.defaultSymbolVisibility !==
- FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
- ) {
- writer.uint32(64).int32(
- featureSet_VisibilityFeature_DefaultSymbolVisibilityToNumber(message.defaultSymbolVisibility),
- );
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFeatureSet();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.fieldPresence = featureSet_FieldPresenceFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.enumType = featureSet_EnumTypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.utf8Validation = featureSet_Utf8ValidationFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.messageEncoding = featureSet_MessageEncodingFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(
- reader.int32(),
- );
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FeatureSet {
- return {
- fieldPresence: isSet(object.fieldPresence)
- ? featureSet_FieldPresenceFromJSON(object.fieldPresence)
- : FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN,
- enumType: isSet(object.enumType)
- ? featureSet_EnumTypeFromJSON(object.enumType)
- : FeatureSet_EnumType.ENUM_TYPE_UNKNOWN,
- repeatedFieldEncoding: isSet(object.repeatedFieldEncoding)
- ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding)
- : FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN,
- utf8Validation: isSet(object.utf8Validation)
- ? featureSet_Utf8ValidationFromJSON(object.utf8Validation)
- : FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
- messageEncoding: isSet(object.messageEncoding)
- ? featureSet_MessageEncodingFromJSON(object.messageEncoding)
- : FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
- jsonFormat: isSet(object.jsonFormat)
- ? featureSet_JsonFormatFromJSON(object.jsonFormat)
- : FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
- enforceNamingStyle: isSet(object.enforceNamingStyle)
- ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle)
- : FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
- defaultSymbolVisibility: isSet(object.defaultSymbolVisibility)
- ? featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(object.defaultSymbolVisibility)
- : FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
- };
- },
-
- toJSON(message: FeatureSet): unknown {
- const obj: any = {};
- if (
- message.fieldPresence !== undefined && message.fieldPresence !== FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN
- ) {
- obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence);
- }
- if (message.enumType !== undefined && message.enumType !== FeatureSet_EnumType.ENUM_TYPE_UNKNOWN) {
- obj.enumType = featureSet_EnumTypeToJSON(message.enumType);
- }
- if (
- message.repeatedFieldEncoding !== undefined &&
- message.repeatedFieldEncoding !== FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN
- ) {
- obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding);
- }
- if (
- message.utf8Validation !== undefined &&
- message.utf8Validation !== FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN
- ) {
- obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation);
- }
- if (
- message.messageEncoding !== undefined &&
- message.messageEncoding !== FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN
- ) {
- obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding);
- }
- if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
- obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);
- }
- if (
- message.enforceNamingStyle !== undefined &&
- message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
- ) {
- obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle);
- }
- if (
- message.defaultSymbolVisibility !== undefined &&
- message.defaultSymbolVisibility !==
- FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
- ) {
- obj.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON(
- message.defaultSymbolVisibility,
- );
- }
- return obj;
- },
-
- create(base?: DeepPartial<FeatureSet>): FeatureSet {
- return FeatureSet.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FeatureSet>): FeatureSet {
- const message = createBaseFeatureSet();
- message.fieldPresence = object.fieldPresence ?? FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN;
- message.enumType = object.enumType ?? FeatureSet_EnumType.ENUM_TYPE_UNKNOWN;
- message.repeatedFieldEncoding = object.repeatedFieldEncoding ??
- FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN;
- message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
- message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
- message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
- message.enforceNamingStyle = object.enforceNamingStyle ??
- FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
- message.defaultSymbolVisibility = object.defaultSymbolVisibility ??
- FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
- return message;
- },
-};
-
-function createBaseFeatureSet_VisibilityFeature(): FeatureSet_VisibilityFeature {
- return {};
-}
-
-export const FeatureSet_VisibilityFeature: MessageFns<FeatureSet_VisibilityFeature> = {
- encode(_: FeatureSet_VisibilityFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet_VisibilityFeature {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFeatureSet_VisibilityFeature();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): FeatureSet_VisibilityFeature {
- return {};
- },
-
- toJSON(_: FeatureSet_VisibilityFeature): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<FeatureSet_VisibilityFeature>): FeatureSet_VisibilityFeature {
- return FeatureSet_VisibilityFeature.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<FeatureSet_VisibilityFeature>): FeatureSet_VisibilityFeature {
- const message = createBaseFeatureSet_VisibilityFeature();
- return message;
- },
-};
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/protobuf/duration.ts b/frontend/src/types/proto/google/protobuf/duration.ts
deleted file mode 100644
index 9fdac5234c..0000000000
--- a/frontend/src/types/proto/google/protobuf/duration.ts
+++ /dev/null
@@ -1,188 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/duration.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * A Duration represents a signed, fixed-length span of time represented
- * as a count of seconds and fractions of seconds at nanosecond
- * resolution. It is independent of any calendar and concepts like "day"
- * or "month". It is related to Timestamp in that the difference between
- * two Timestamp values is a Duration and it can be added or subtracted
- * from a Timestamp. Range is approximately +-10,000 years.
- *
- * # Examples
- *
- * Example 1: Compute Duration from two Timestamps in pseudo code.
- *
- * Timestamp start = ...;
- * Timestamp end = ...;
- * Duration duration = ...;
- *
- * duration.seconds = end.seconds - start.seconds;
- * duration.nanos = end.nanos - start.nanos;
- *
- * if (duration.seconds < 0 && duration.nanos > 0) {
- * duration.seconds += 1;
- * duration.nanos -= 1000000000;
- * } else if (duration.seconds > 0 && duration.nanos < 0) {
- * duration.seconds -= 1;
- * duration.nanos += 1000000000;
- * }
- *
- * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
- *
- * Timestamp start = ...;
- * Duration duration = ...;
- * Timestamp end = ...;
- *
- * end.seconds = start.seconds + duration.seconds;
- * end.nanos = start.nanos + duration.nanos;
- *
- * if (end.nanos < 0) {
- * end.seconds -= 1;
- * end.nanos += 1000000000;
- * } else if (end.nanos >= 1000000000) {
- * end.seconds += 1;
- * end.nanos -= 1000000000;
- * }
- *
- * Example 3: Compute Duration from datetime.timedelta in Python.
- *
- * td = datetime.timedelta(days=3, minutes=10)
- * duration = Duration()
- * duration.FromTimedelta(td)
- *
- * # JSON Mapping
- *
- * In JSON format, the Duration type is encoded as a string rather than an
- * object, where the string ends in the suffix "s" (indicating seconds) and
- * is preceded by the number of seconds, with nanoseconds expressed as
- * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
- * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
- * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
- * microsecond should be expressed in JSON format as "3.000001s".
- */
-export interface Duration {
- /**
- * Signed seconds of the span of time. Must be from -315,576,000,000
- * to +315,576,000,000 inclusive. Note: these bounds are computed from:
- * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- */
- seconds: Long;
- /**
- * Signed fractions of a second at nanosecond resolution of the span
- * of time. Durations less than one second are represented with a 0
- * `seconds` field and a positive or negative `nanos` field. For durations
- * of one second or more, a non-zero value for the `nanos` field must be
- * of the same sign as the `seconds` field. Must be from -999,999,999
- * to +999,999,999 inclusive.
- */
- nanos: number;
-}
-
-function createBaseDuration(): Duration {
- return { seconds: Long.ZERO, nanos: 0 };
-}
-
-export const Duration: MessageFns<Duration> = {
- encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (!message.seconds.equals(Long.ZERO)) {
- writer.uint32(8).int64(message.seconds.toString());
- }
- if (message.nanos !== 0) {
- writer.uint32(16).int32(message.nanos);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Duration {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDuration();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.seconds = Long.fromString(reader.int64().toString());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.nanos = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Duration {
- return {
- seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
- nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
- };
- },
-
- toJSON(message: Duration): unknown {
- const obj: any = {};
- if (!message.seconds.equals(Long.ZERO)) {
- obj.seconds = (message.seconds || Long.ZERO).toString();
- }
- if (message.nanos !== 0) {
- obj.nanos = Math.round(message.nanos);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Duration>): Duration {
- return Duration.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Duration>): Duration {
- const message = createBaseDuration();
- message.seconds = (object.seconds !== undefined && object.seconds !== null)
- ? Long.fromValue(object.seconds)
- : Long.ZERO;
- message.nanos = object.nanos ?? 0;
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/protobuf/empty.ts b/frontend/src/types/proto/google/protobuf/empty.ts
deleted file mode 100644
index 49d47d6f3a..0000000000
--- a/frontend/src/types/proto/google/protobuf/empty.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/empty.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * A generic empty message that you can re-use to avoid defining duplicated
- * empty messages in your APIs. A typical example is to use it as the request
- * or the response type of an API method. For instance:
- *
- * service Foo {
- * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
- * }
- */
-export interface Empty {
-}
-
-function createBaseEmpty(): Empty {
- return {};
-}
-
-export const Empty: MessageFns<Empty> = {
- encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Empty {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEmpty();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): Empty {
- return {};
- },
-
- toJSON(_: Empty): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<Empty>): Empty {
- return Empty.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<Empty>): Empty {
- const message = createBaseEmpty();
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/protobuf/field_mask.ts b/frontend/src/types/proto/google/protobuf/field_mask.ts
deleted file mode 100644
index edb4875a82..0000000000
--- a/frontend/src/types/proto/google/protobuf/field_mask.ts
+++ /dev/null
@@ -1,308 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/field_mask.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * `FieldMask` represents a set of symbolic field paths, for example:
- *
- * paths: "f.a"
- * paths: "f.b.d"
- *
- * Here `f` represents a field in some root message, `a` and `b`
- * fields in the message found in `f`, and `d` a field found in the
- * message in `f.b`.
- *
- * Field masks are used to specify a subset of fields that should be
- * returned by a get operation or modified by an update operation.
- * Field masks also have a custom JSON encoding (see below).
- *
- * # Field Masks in Projections
- *
- * When used in the context of a projection, a response message or
- * sub-message is filtered by the API to only contain those fields as
- * specified in the mask. For example, if the mask in the previous
- * example is applied to a response message as follows:
- *
- * f {
- * a : 22
- * b {
- * d : 1
- * x : 2
- * }
- * y : 13
- * }
- * z: 8
- *
- * The result will not contain specific values for fields x,y and z
- * (their value will be set to the default, and omitted in proto text
- * output):
- *
- * f {
- * a : 22
- * b {
- * d : 1
- * }
- * }
- *
- * A repeated field is not allowed except at the last position of a
- * paths string.
- *
- * If a FieldMask object is not present in a get operation, the
- * operation applies to all fields (as if a FieldMask of all fields
- * had been specified).
- *
- * Note that a field mask does not necessarily apply to the
- * top-level response message. In case of a REST get operation, the
- * field mask applies directly to the response, but in case of a REST
- * list operation, the mask instead applies to each individual message
- * in the returned resource list. In case of a REST custom method,
- * other definitions may be used. Where the mask applies will be
- * clearly documented together with its declaration in the API. In
- * any case, the effect on the returned resource/resources is required
- * behavior for APIs.
- *
- * # Field Masks in Update Operations
- *
- * A field mask in update operations specifies which fields of the
- * targeted resource are going to be updated. The API is required
- * to only change the values of the fields as specified in the mask
- * and leave the others untouched. If a resource is passed in to
- * describe the updated values, the API ignores the values of all
- * fields not covered by the mask.
- *
- * If a repeated field is specified for an update operation, new values will
- * be appended to the existing repeated field in the target resource. Note that
- * a repeated field is only allowed in the last position of a `paths` string.
- *
- * If a sub-message is specified in the last position of the field mask for an
- * update operation, then new value will be merged into the existing sub-message
- * in the target resource.
- *
- * For example, given the target message:
- *
- * f {
- * b {
- * d: 1
- * x: 2
- * }
- * c: [1]
- * }
- *
- * And an update message:
- *
- * f {
- * b {
- * d: 10
- * }
- * c: [2]
- * }
- *
- * then if the field mask is:
- *
- * paths: ["f.b", "f.c"]
- *
- * then the result will be:
- *
- * f {
- * b {
- * d: 10
- * x: 2
- * }
- * c: [1, 2]
- * }
- *
- * An implementation may provide options to override this default behavior for
- * repeated and message fields.
- *
- * In order to reset a field's value to the default, the field must
- * be in the mask and set to the default value in the provided resource.
- * Hence, in order to reset all fields of a resource, provide a default
- * instance of the resource and set all fields in the mask, or do
- * not provide a mask as described below.
- *
- * If a field mask is not present on update, the operation applies to
- * all fields (as if a field mask of all fields has been specified).
- * Note that in the presence of schema evolution, this may mean that
- * fields the client does not know and has therefore not filled into
- * the request will be reset to their default. If this is unwanted
- * behavior, a specific service may require a client to always specify
- * a field mask, producing an error if not.
- *
- * As with get operations, the location of the resource which
- * describes the updated values in the request message depends on the
- * operation kind. In any case, the effect of the field mask is
- * required to be honored by the API.
- *
- * ## Considerations for HTTP REST
- *
- * The HTTP kind of an update operation which uses a field mask must
- * be set to PATCH instead of PUT in order to satisfy HTTP semantics
- * (PUT must only be used for full updates).
- *
- * # JSON Encoding of Field Masks
- *
- * In JSON, a field mask is encoded as a single string where paths are
- * separated by a comma. Fields name in each path are converted
- * to/from lower-camel naming conventions.
- *
- * As an example, consider the following message declarations:
- *
- * message Profile {
- * User user = 1;
- * Photo photo = 2;
- * }
- * message User {
- * string display_name = 1;
- * string address = 2;
- * }
- *
- * In proto a field mask for `Profile` may look as such:
- *
- * mask {
- * paths: "user.display_name"
- * paths: "photo"
- * }
- *
- * In JSON, the same mask is represented as below:
- *
- * {
- * mask: "user.displayName,photo"
- * }
- *
- * # Field Masks and Oneof Fields
- *
- * Field masks treat fields in oneofs just as regular fields. Consider the
- * following message:
- *
- * message SampleMessage {
- * oneof test_oneof {
- * string name = 4;
- * SubMessage sub_message = 9;
- * }
- * }
- *
- * The field mask can be:
- *
- * mask {
- * paths: "name"
- * }
- *
- * Or:
- *
- * mask {
- * paths: "sub_message"
- * }
- *
- * Note that oneof type names ("test_oneof" in this case) cannot be used in
- * paths.
- *
- * ## Field Mask Verification
- *
- * The implementation of any API method which has a FieldMask type field in the
- * request should verify the included field paths, and return an
- * `INVALID_ARGUMENT` error if any path is unmappable.
- */
-export interface FieldMask {
- /** The set of field mask paths. */
- paths: string[];
-}
-
-function createBaseFieldMask(): FieldMask {
- return { paths: [] };
-}
-
-export const FieldMask: MessageFns<FieldMask> & FieldMaskWrapperFns = {
- encode(message: FieldMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.paths) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FieldMask {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldMask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.paths.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldMask {
- return {
- paths: typeof object === "string"
- ? object.split(",").filter(globalThis.Boolean)
- : globalThis.Array.isArray(object?.paths)
- ? object.paths.map(globalThis.String)
- : [],
- };
- },
-
- toJSON(message: FieldMask): string {
- return message.paths.join(",");
- },
-
- create(base?: DeepPartial<FieldMask>): FieldMask {
- return FieldMask.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldMask>): FieldMask {
- const message = createBaseFieldMask();
- message.paths = object.paths?.map((e) => e) || [];
- return message;
- },
-
- wrap(paths: string[]): FieldMask {
- const result = createBaseFieldMask();
- result.paths = paths;
- return result;
- },
-
- unwrap(message: FieldMask): string[] {
- return message.paths;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
-
-export interface FieldMaskWrapperFns {
- wrap(paths: string[]): FieldMask;
- unwrap(message: FieldMask): string[];
-}
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
deleted file mode 100644
index 0f9cc54755..0000000000
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ /dev/null
@@ -1,595 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/struct.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * `NullValue` is a singleton enumeration to represent the null value for the
- * `Value` type union.
- *
- * The JSON representation for `NullValue` is JSON `null`.
- */
-export enum NullValue {
- /** NULL_VALUE - Null value. */
- NULL_VALUE = "NULL_VALUE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function nullValueFromJSON(object: any): NullValue {
- switch (object) {
- case 0:
- case "NULL_VALUE":
- return NullValue.NULL_VALUE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return NullValue.UNRECOGNIZED;
- }
-}
-
-export function nullValueToJSON(object: NullValue): string {
- switch (object) {
- case NullValue.NULL_VALUE:
- return "NULL_VALUE";
- case NullValue.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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`
- * might be supported by a native representation. For example, in
- * scripting languages like JS a struct is represented as an
- * object. The details of that representation are described together
- * with the proto support for the language.
- *
- * The JSON representation for `Struct` is JSON object.
- */
-export interface Struct {
- /** Unordered map of dynamically typed values. */
- fields: { [key: string]: any | undefined };
-}
-
-export interface Struct_FieldsEntry {
- key: string;
- value: any | undefined;
-}
-
-/**
- * `Value` represents a dynamically typed value which can be either
- * null, a number, a string, a boolean, a recursive struct value, or a
- * list of values. A producer of value is expected to set one of these
- * variants. Absence of any variant indicates an error.
- *
- * The JSON representation for `Value` is JSON value.
- */
-export interface Value {
- /** Represents a null value. */
- nullValue?:
- | NullValue
- | undefined;
- /** Represents a double value. */
- numberValue?:
- | number
- | undefined;
- /** Represents a string value. */
- stringValue?:
- | string
- | undefined;
- /** Represents a boolean value. */
- boolValue?:
- | boolean
- | undefined;
- /** Represents a structured value. */
- structValue?:
- | { [key: string]: any }
- | undefined;
- /** Represents a repeated `Value`. */
- listValue?: Array<any> | undefined;
-}
-
-/**
- * `ListValue` is a wrapper around a repeated field of values.
- *
- * The JSON representation for `ListValue` is JSON array.
- */
-export interface ListValue {
- /** Repeated field of dynamically typed values. */
- values: any[];
-}
-
-function createBaseStruct(): Struct {
- return { fields: {} };
-}
-
-export const Struct: MessageFns<Struct> & StructWrapperFns = {
- encode(message: Struct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- Object.entries(message.fields).forEach(([key, value]) => {
- if (value !== undefined) {
- Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
- }
- });
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Struct {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseStruct();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
- if (entry1.value !== undefined) {
- message.fields[entry1.key] = entry1.value;
- }
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Struct {
- return {
- fields: isObject(object.fields)
- ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
- acc[key] = value as any | undefined;
- return acc;
- }, {})
- : {},
- };
- },
-
- toJSON(message: Struct): unknown {
- const obj: any = {};
- if (message.fields) {
- const entries = Object.entries(message.fields);
- if (entries.length > 0) {
- obj.fields = {};
- entries.forEach(([k, v]) => {
- obj.fields[k] = v;
- });
- }
- }
- return obj;
- },
-
- create(base?: DeepPartial<Struct>): Struct {
- return Struct.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Struct>): Struct {
- const message = createBaseStruct();
- message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
- (acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = value;
- }
- return acc;
- },
- {},
- );
- return message;
- },
-
- wrap(object: { [key: string]: any } | undefined): Struct {
- const struct = createBaseStruct();
-
- if (object !== undefined) {
- for (const key of Object.keys(object)) {
- struct.fields[key] = object[key];
- }
- }
- return struct;
- },
-
- unwrap(message: Struct): { [key: string]: any } {
- const object: { [key: string]: any } = {};
- if (message.fields) {
- for (const key of Object.keys(message.fields)) {
- object[key] = message.fields[key];
- }
- }
- return object;
- },
-};
-
-function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
- return { key: "", value: undefined };
-}
-
-export const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry> = {
- encode(message: Struct_FieldsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== undefined) {
- Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Struct_FieldsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseStruct_FieldsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Struct_FieldsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object?.value) ? object.value : undefined,
- };
- },
-
- toJSON(message: Struct_FieldsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== undefined) {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Struct_FieldsEntry>): Struct_FieldsEntry {
- return Struct_FieldsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Struct_FieldsEntry>): Struct_FieldsEntry {
- const message = createBaseStruct_FieldsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? undefined;
- return message;
- },
-};
-
-function createBaseValue(): Value {
- return {
- nullValue: undefined,
- numberValue: undefined,
- stringValue: undefined,
- boolValue: undefined,
- structValue: undefined,
- listValue: undefined,
- };
-}
-
-export const Value: MessageFns<Value> & AnyValueWrapperFns = {
- encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.nullValue !== undefined) {
- writer.uint32(8).int32(nullValueToNumber(message.nullValue));
- }
- if (message.numberValue !== undefined) {
- writer.uint32(17).double(message.numberValue);
- }
- if (message.stringValue !== undefined) {
- writer.uint32(26).string(message.stringValue);
- }
- if (message.boolValue !== undefined) {
- writer.uint32(32).bool(message.boolValue);
- }
- if (message.structValue !== undefined) {
- Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
- }
- if (message.listValue !== undefined) {
- ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Value {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseValue();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.nullValue = nullValueFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 17) {
- break;
- }
-
- message.numberValue = reader.double();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.stringValue = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.boolValue = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Value {
- return {
- nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
- numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
- stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
- boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
- structValue: isObject(object.structValue) ? object.structValue : undefined,
- listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
- };
- },
-
- toJSON(message: Value): unknown {
- const obj: any = {};
- if (message.nullValue !== undefined) {
- obj.nullValue = nullValueToJSON(message.nullValue);
- }
- if (message.numberValue !== undefined) {
- obj.numberValue = message.numberValue;
- }
- if (message.stringValue !== undefined) {
- obj.stringValue = message.stringValue;
- }
- if (message.boolValue !== undefined) {
- obj.boolValue = message.boolValue;
- }
- if (message.structValue !== undefined) {
- obj.structValue = message.structValue;
- }
- if (message.listValue !== undefined) {
- obj.listValue = message.listValue;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Value>): Value {
- return Value.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Value>): Value {
- const message = createBaseValue();
- message.nullValue = object.nullValue ?? undefined;
- message.numberValue = object.numberValue ?? undefined;
- message.stringValue = object.stringValue ?? undefined;
- message.boolValue = object.boolValue ?? undefined;
- message.structValue = object.structValue ?? undefined;
- message.listValue = object.listValue ?? undefined;
- return message;
- },
-
- wrap(value: any): Value {
- const result = createBaseValue();
- if (value === null) {
- result.nullValue = NullValue.NULL_VALUE;
- } else if (typeof value === "boolean") {
- result.boolValue = value;
- } else if (typeof value === "number") {
- result.numberValue = value;
- } else if (typeof value === "string") {
- result.stringValue = value;
- } else if (globalThis.Array.isArray(value)) {
- result.listValue = value;
- } else if (typeof value === "object") {
- result.structValue = value;
- } else if (typeof value !== "undefined") {
- throw new globalThis.Error("Unsupported any value type: " + typeof value);
- }
- return result;
- },
-
- unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
- if (message.stringValue !== undefined) {
- return message.stringValue;
- } else if (message?.numberValue !== undefined) {
- return message.numberValue;
- } else if (message?.boolValue !== undefined) {
- return message.boolValue;
- } else if (message?.structValue !== undefined) {
- return message.structValue as any;
- } else if (message?.listValue !== undefined) {
- return message.listValue;
- } else if (message?.nullValue !== undefined) {
- return null;
- }
- return undefined;
- },
-};
-
-function createBaseListValue(): ListValue {
- return { values: [] };
-}
-
-export const ListValue: MessageFns<ListValue> & ListValueWrapperFns = {
- encode(message: ListValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.values) {
- Value.encode(Value.wrap(v!), writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListValue {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListValue();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListValue {
- return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
- },
-
- toJSON(message: ListValue): unknown {
- const obj: any = {};
- if (message.values?.length) {
- obj.values = message.values;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListValue>): ListValue {
- return ListValue.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListValue>): ListValue {
- const message = createBaseListValue();
- message.values = object.values?.map((e) => e) || [];
- return message;
- },
-
- wrap(array: Array<any> | undefined): ListValue {
- const result = createBaseListValue();
- result.values = array ?? [];
- return result;
- },
-
- unwrap(message: ListValue): Array<any> {
- if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
- return message.values;
- } else {
- return message as any;
- }
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
-
-export interface StructWrapperFns {
- wrap(object: { [key: string]: any } | undefined): Struct;
- unwrap(message: Struct): { [key: string]: any };
-}
-
-export interface AnyValueWrapperFns {
- wrap(value: any): Value;
- unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
-}
-
-export interface ListValueWrapperFns {
- wrap(array: Array<any> | undefined): ListValue;
- unwrap(message: ListValue): Array<any>;
-}
diff --git a/frontend/src/types/proto/google/protobuf/timestamp.ts b/frontend/src/types/proto/google/protobuf/timestamp.ts
deleted file mode 100644
index 0073ddb6a2..0000000000
--- a/frontend/src/types/proto/google/protobuf/timestamp.ts
+++ /dev/null
@@ -1,217 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/protobuf/timestamp.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.protobuf";
-
-/**
- * A Timestamp represents a point in time independent of any time zone or local
- * calendar, encoded as a count of seconds and fractions of seconds at
- * nanosecond resolution. The count is relative to an epoch at UTC midnight on
- * January 1, 1970, in the proleptic Gregorian calendar which extends the
- * Gregorian calendar backwards to year one.
- *
- * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
- * second table is needed for interpretation, using a [24-hour linear
- * smear](https://developers.google.com/time/smear).
- *
- * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
- * restricting to that range, we ensure that we can convert to and from [RFC
- * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
- *
- * # Examples
- *
- * Example 1: Compute Timestamp from POSIX `time()`.
- *
- * Timestamp timestamp;
- * timestamp.set_seconds(time(NULL));
- * timestamp.set_nanos(0);
- *
- * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
- *
- * struct timeval tv;
- * gettimeofday(&tv, NULL);
- *
- * Timestamp timestamp;
- * timestamp.set_seconds(tv.tv_sec);
- * timestamp.set_nanos(tv.tv_usec * 1000);
- *
- * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
- *
- * FILETIME ft;
- * GetSystemTimeAsFileTime(&ft);
- * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
- *
- * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
- * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
- * Timestamp timestamp;
- * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
- * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
- *
- * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
- *
- * long millis = System.currentTimeMillis();
- *
- * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
- * .setNanos((int) ((millis % 1000) * 1000000)).build();
- *
- * Example 5: Compute Timestamp from Java `Instant.now()`.
- *
- * Instant now = Instant.now();
- *
- * Timestamp timestamp =
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
- * .setNanos(now.getNano()).build();
- *
- * Example 6: Compute Timestamp from current time in Python.
- *
- * timestamp = Timestamp()
- * timestamp.GetCurrentTime()
- *
- * # JSON Mapping
- *
- * In JSON format, the Timestamp type is encoded as a string in the
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
- * where {year} is always expressed using four digits while {month}, {day},
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
- * is required. A proto3 JSON serializer should always use UTC (as indicated by
- * "Z") when printing the Timestamp type and a proto3 JSON parser should be
- * able to accept both UTC and other timezones (as indicated by an offset).
- *
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
- * 01:30 UTC on January 15, 2017.
- *
- * In JavaScript, one can convert a Date object to this format using the
- * standard
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
- * method. In Python, a standard `datetime.datetime` object can be converted
- * to this format using
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
- * ) to obtain a formatter capable of generating timestamps in this format.
- */
-export interface Timestamp {
- /**
- * Represents seconds of UTC time since Unix epoch
- * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
- * 9999-12-31T23:59:59Z inclusive.
- */
- seconds: Long;
- /**
- * Non-negative fractions of a second at nanosecond resolution. Negative
- * second values with fractions must still have non-negative nanos values
- * that count forward in time. Must be from 0 to 999,999,999
- * inclusive.
- */
- nanos: number;
-}
-
-function createBaseTimestamp(): Timestamp {
- return { seconds: Long.ZERO, nanos: 0 };
-}
-
-export const Timestamp: MessageFns<Timestamp> = {
- encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (!message.seconds.equals(Long.ZERO)) {
- writer.uint32(8).int64(message.seconds.toString());
- }
- if (message.nanos !== 0) {
- writer.uint32(16).int32(message.nanos);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTimestamp();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.seconds = Long.fromString(reader.int64().toString());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.nanos = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Timestamp {
- return {
- seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
- nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
- };
- },
-
- toJSON(message: Timestamp): unknown {
- const obj: any = {};
- if (!message.seconds.equals(Long.ZERO)) {
- obj.seconds = (message.seconds || Long.ZERO).toString();
- }
- if (message.nanos !== 0) {
- obj.nanos = Math.round(message.nanos);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Timestamp>): Timestamp {
- return Timestamp.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Timestamp>): Timestamp {
- const message = createBaseTimestamp();
- message.seconds = (object.seconds !== undefined && object.seconds !== null)
- ? Long.fromValue(object.seconds)
- : Long.ZERO;
- message.nanos = object.nanos ?? 0;
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/rpc/status.ts b/frontend/src/types/proto/google/rpc/status.ts
deleted file mode 100644
index d54ee88ba7..0000000000
--- a/frontend/src/types/proto/google/rpc/status.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/rpc/status.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Any } from "../protobuf/any";
-
-export const protobufPackage = "google.rpc";
-
-/**
- * The `Status` type defines a logical error model that is suitable for
- * different programming environments, including REST APIs and RPC APIs. It is
- * used by [gRPC](https://github.com/grpc). Each `Status` message contains
- * three pieces of data: error code, error message, and error details.
- *
- * You can find out more about this error model and how to work with it in the
- * [API Design Guide](https://cloud.google.com/apis/design/errors).
- */
-export interface Status {
- /**
- * The status code, which should be an enum value of
- * [google.rpc.Code][google.rpc.Code].
- */
- code: number;
- /**
- * A developer-facing error message, which should be in English. Any
- * user-facing error message should be localized and sent in the
- * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
- * by the client.
- */
- message: string;
- /**
- * A list of messages that carry the error details. There is a common set of
- * message types for APIs to use.
- */
- details: Any[];
-}
-
-function createBaseStatus(): Status {
- return { code: 0, message: "", details: [] };
-}
-
-export const Status: MessageFns<Status> = {
- encode(message: Status, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.code !== 0) {
- writer.uint32(8).int32(message.code);
- }
- if (message.message !== "") {
- writer.uint32(18).string(message.message);
- }
- for (const v of message.details) {
- Any.encode(v!, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Status {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseStatus();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.code = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.message = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.details.push(Any.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Status {
- return {
- code: isSet(object.code) ? globalThis.Number(object.code) : 0,
- message: isSet(object.message) ? globalThis.String(object.message) : "",
- details: globalThis.Array.isArray(object?.details) ? object.details.map((e: any) => Any.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: Status): unknown {
- const obj: any = {};
- if (message.code !== 0) {
- obj.code = Math.round(message.code);
- }
- if (message.message !== "") {
- obj.message = message.message;
- }
- if (message.details?.length) {
- obj.details = message.details.map((e) => Any.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Status>): Status {
- return Status.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Status>): Status {
- const message = createBaseStatus();
- message.code = object.code ?? 0;
- message.message = object.message ?? "";
- message.details = object.details?.map((e) => Any.fromPartial(e)) || [];
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/google/type/expr.ts b/frontend/src/types/proto/google/type/expr.ts
deleted file mode 100644
index 9694155834..0000000000
--- a/frontend/src/types/proto/google/type/expr.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: google/type/expr.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "google.type";
-
-/**
- * Represents a textual expression in the Common Expression Language (CEL)
- * syntax. CEL is a C-like expression language. The syntax and semantics of CEL
- * are documented at https://github.com/google/cel-spec.
- *
- * Example (Comparison):
- *
- * title: "Summary size limit"
- * description: "Determines if a summary is less than 100 chars"
- * expression: "document.summary.size() < 100"
- *
- * Example (Equality):
- *
- * title: "Requestor is owner"
- * description: "Determines if requestor is the document owner"
- * expression: "document.owner == request.auth.claims.email"
- *
- * Example (Logic):
- *
- * title: "Public documents"
- * description: "Determine whether the document should be publicly visible"
- * expression: "document.type != 'private' && document.type != 'internal'"
- *
- * Example (Data Manipulation):
- *
- * title: "Notification string"
- * description: "Create a notification string with a timestamp."
- * expression: "'New message received at ' + string(document.create_time)"
- *
- * The exact variables and functions that may be referenced within an expression
- * are determined by the service that evaluates it. See the service
- * documentation for additional information.
- */
-export interface Expr {
- /**
- * Textual representation of an expression in Common Expression Language
- * syntax.
- */
- expression: string;
- /**
- * Optional. Title for the expression, i.e. a short string describing
- * its purpose. This can be used e.g. in UIs which allow to enter the
- * expression.
- */
- title: string;
- /**
- * Optional. Description of the expression. This is a longer text which
- * describes the expression, e.g. when hovered over it in a UI.
- */
- description: string;
- /**
- * Optional. String indicating the location of the expression for error
- * reporting, e.g. a file name and a position in the file.
- */
- location: string;
-}
-
-function createBaseExpr(): Expr {
- return { expression: "", title: "", description: "", location: "" };
-}
-
-export const Expr: MessageFns<Expr> = {
- encode(message: Expr, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.expression !== "") {
- writer.uint32(10).string(message.expression);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- if (message.location !== "") {
- writer.uint32(34).string(message.location);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Expr {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExpr();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.expression = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.location = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Expr {
- return {
- expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- location: isSet(object.location) ? globalThis.String(object.location) : "",
- };
- },
-
- toJSON(message: Expr): unknown {
- const obj: any = {};
- if (message.expression !== "") {
- obj.expression = message.expression;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.location !== "") {
- obj.location = message.location;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Expr>): Expr {
- return Expr.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Expr>): Expr {
- const message = createBaseExpr();
- message.expression = object.expression ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.location = object.location ?? "";
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
deleted file mode 100644
index 733200be80..0000000000
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ /dev/null
@@ -1,1223 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/actuator_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
-import { PasswordRestrictionSetting } from "./setting_service";
-import { UserType, userTypeFromJSON, userTypeToJSON, userTypeToNumber } from "./user_service";
-
-export const protobufPackage = "bytebase.v1";
-
-/** The request message for getting the theme resource. */
-export interface GetResourcePackageRequest {
-}
-
-/** The theme resources. */
-export interface ResourcePackage {
- /** The branding logo. */
- logo: Uint8Array;
-}
-
-export interface SetupSampleRequest {
-}
-
-export interface GetActuatorInfoRequest {
-}
-
-export interface UpdateActuatorInfoRequest {
- /** The actuator to update. */
- actuator:
- | ActuatorInfo
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteCacheRequest {
-}
-
-/**
- * ServerInfo is the API message for server info.
- * Actuator concept is similar to the Spring Boot Actuator.
- */
-export interface ActuatorInfo {
- /** version is the bytebase's server version */
- version: string;
- /** git_commit is the git commit hash of the build */
- gitCommit: string;
- /** readonly flag means if the Bytebase is running in readonly mode. */
- readonly: boolean;
- /** saas flag means if the Bytebase is running in SaaS mode, some features are not allowed to edit by users. */
- saas: boolean;
- /** demo flag means if the Bytebase is running in demo mode. */
- demo: boolean;
- /** host is the Bytebase instance host. */
- host: string;
- /** port is the Bytebase instance port. */
- port: string;
- /** external_url is the URL where user or webhook callback visits Bytebase. */
- externalUrl: string;
- /** need_admin_setup flag means the Bytebase instance doesn't have any end users. */
- needAdminSetup: boolean;
- /** disallow_signup is the flag to disable self-service signup. */
- disallowSignup: boolean;
- /** last_active_time is the service last active time in UTC Time Format, any API calls will refresh this value. */
- lastActiveTime:
- | Timestamp
- | undefined;
- /** require_2fa is the flag to require 2FA for all users. */
- require2fa: boolean;
- /** workspace_id is the identifier for the workspace. */
- workspaceId: string;
- /** debug flag means if the debug mode is enabled. */
- debug: boolean;
- unlicensedFeatures: string[];
- /** disallow_password_signin is the flag to disallow user signin with email&password. (except workspace admins) */
- disallowPasswordSignin: boolean;
- passwordRestriction:
- | PasswordRestrictionSetting
- | undefined;
- /** docker flag means if the Bytebase instance is running in docker. */
- docker: boolean;
- userStats: ActuatorInfo_StatUser[];
- activatedInstanceCount: number;
- totalInstanceCount: number;
- enableSample: boolean;
-}
-
-export interface ActuatorInfo_StatUser {
- userType: UserType;
- state: State;
- count: number;
-}
-
-function createBaseGetResourcePackageRequest(): GetResourcePackageRequest {
- return {};
-}
-
-export const GetResourcePackageRequest: MessageFns<GetResourcePackageRequest> = {
- encode(_: GetResourcePackageRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetResourcePackageRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetResourcePackageRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): GetResourcePackageRequest {
- return {};
- },
-
- toJSON(_: GetResourcePackageRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<GetResourcePackageRequest>): GetResourcePackageRequest {
- return GetResourcePackageRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<GetResourcePackageRequest>): GetResourcePackageRequest {
- const message = createBaseGetResourcePackageRequest();
- return message;
- },
-};
-
-function createBaseResourcePackage(): ResourcePackage {
- return { logo: new Uint8Array(0) };
-}
-
-export const ResourcePackage: MessageFns<ResourcePackage> = {
- encode(message: ResourcePackage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.logo.length !== 0) {
- writer.uint32(10).bytes(message.logo);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ResourcePackage {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseResourcePackage();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.logo = reader.bytes();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ResourcePackage {
- return { logo: isSet(object.logo) ? bytesFromBase64(object.logo) : new Uint8Array(0) };
- },
-
- toJSON(message: ResourcePackage): unknown {
- const obj: any = {};
- if (message.logo.length !== 0) {
- obj.logo = base64FromBytes(message.logo);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ResourcePackage>): ResourcePackage {
- return ResourcePackage.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ResourcePackage>): ResourcePackage {
- const message = createBaseResourcePackage();
- message.logo = object.logo ?? new Uint8Array(0);
- return message;
- },
-};
-
-function createBaseSetupSampleRequest(): SetupSampleRequest {
- return {};
-}
-
-export const SetupSampleRequest: MessageFns<SetupSampleRequest> = {
- encode(_: SetupSampleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SetupSampleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSetupSampleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): SetupSampleRequest {
- return {};
- },
-
- toJSON(_: SetupSampleRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<SetupSampleRequest>): SetupSampleRequest {
- return SetupSampleRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<SetupSampleRequest>): SetupSampleRequest {
- const message = createBaseSetupSampleRequest();
- return message;
- },
-};
-
-function createBaseGetActuatorInfoRequest(): GetActuatorInfoRequest {
- return {};
-}
-
-export const GetActuatorInfoRequest: MessageFns<GetActuatorInfoRequest> = {
- encode(_: GetActuatorInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetActuatorInfoRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetActuatorInfoRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): GetActuatorInfoRequest {
- return {};
- },
-
- toJSON(_: GetActuatorInfoRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<GetActuatorInfoRequest>): GetActuatorInfoRequest {
- return GetActuatorInfoRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<GetActuatorInfoRequest>): GetActuatorInfoRequest {
- const message = createBaseGetActuatorInfoRequest();
- return message;
- },
-};
-
-function createBaseUpdateActuatorInfoRequest(): UpdateActuatorInfoRequest {
- return { actuator: undefined, updateMask: undefined };
-}
-
-export const UpdateActuatorInfoRequest: MessageFns<UpdateActuatorInfoRequest> = {
- encode(message: UpdateActuatorInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.actuator !== undefined) {
- ActuatorInfo.encode(message.actuator, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateActuatorInfoRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateActuatorInfoRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.actuator = ActuatorInfo.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateActuatorInfoRequest {
- return {
- actuator: isSet(object.actuator) ? ActuatorInfo.fromJSON(object.actuator) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateActuatorInfoRequest): unknown {
- const obj: any = {};
- if (message.actuator !== undefined) {
- obj.actuator = ActuatorInfo.toJSON(message.actuator);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateActuatorInfoRequest>): UpdateActuatorInfoRequest {
- return UpdateActuatorInfoRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateActuatorInfoRequest>): UpdateActuatorInfoRequest {
- const message = createBaseUpdateActuatorInfoRequest();
- message.actuator = (object.actuator !== undefined && object.actuator !== null)
- ? ActuatorInfo.fromPartial(object.actuator)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteCacheRequest(): DeleteCacheRequest {
- return {};
-}
-
-export const DeleteCacheRequest: MessageFns<DeleteCacheRequest> = {
- encode(_: DeleteCacheRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteCacheRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteCacheRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): DeleteCacheRequest {
- return {};
- },
-
- toJSON(_: DeleteCacheRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<DeleteCacheRequest>): DeleteCacheRequest {
- return DeleteCacheRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<DeleteCacheRequest>): DeleteCacheRequest {
- const message = createBaseDeleteCacheRequest();
- return message;
- },
-};
-
-function createBaseActuatorInfo(): ActuatorInfo {
- return {
- version: "",
- gitCommit: "",
- readonly: false,
- saas: false,
- demo: false,
- host: "",
- port: "",
- externalUrl: "",
- needAdminSetup: false,
- disallowSignup: false,
- lastActiveTime: undefined,
- require2fa: false,
- workspaceId: "",
- debug: false,
- unlicensedFeatures: [],
- disallowPasswordSignin: false,
- passwordRestriction: undefined,
- docker: false,
- userStats: [],
- activatedInstanceCount: 0,
- totalInstanceCount: 0,
- enableSample: false,
- };
-}
-
-export const ActuatorInfo: MessageFns<ActuatorInfo> = {
- encode(message: ActuatorInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.version !== "") {
- writer.uint32(10).string(message.version);
- }
- if (message.gitCommit !== "") {
- writer.uint32(18).string(message.gitCommit);
- }
- if (message.readonly !== false) {
- writer.uint32(24).bool(message.readonly);
- }
- if (message.saas !== false) {
- writer.uint32(32).bool(message.saas);
- }
- if (message.demo !== false) {
- writer.uint32(40).bool(message.demo);
- }
- if (message.host !== "") {
- writer.uint32(50).string(message.host);
- }
- if (message.port !== "") {
- writer.uint32(58).string(message.port);
- }
- if (message.externalUrl !== "") {
- writer.uint32(66).string(message.externalUrl);
- }
- if (message.needAdminSetup !== false) {
- writer.uint32(72).bool(message.needAdminSetup);
- }
- if (message.disallowSignup !== false) {
- writer.uint32(80).bool(message.disallowSignup);
- }
- if (message.lastActiveTime !== undefined) {
- Timestamp.encode(message.lastActiveTime, writer.uint32(90).fork()).join();
- }
- if (message.require2fa !== false) {
- writer.uint32(96).bool(message.require2fa);
- }
- if (message.workspaceId !== "") {
- writer.uint32(106).string(message.workspaceId);
- }
- if (message.debug !== false) {
- writer.uint32(120).bool(message.debug);
- }
- for (const v of message.unlicensedFeatures) {
- writer.uint32(154).string(v!);
- }
- if (message.disallowPasswordSignin !== false) {
- writer.uint32(160).bool(message.disallowPasswordSignin);
- }
- if (message.passwordRestriction !== undefined) {
- PasswordRestrictionSetting.encode(message.passwordRestriction, writer.uint32(170).fork()).join();
- }
- if (message.docker !== false) {
- writer.uint32(176).bool(message.docker);
- }
- for (const v of message.userStats) {
- ActuatorInfo_StatUser.encode(v!, writer.uint32(186).fork()).join();
- }
- if (message.activatedInstanceCount !== 0) {
- writer.uint32(192).int32(message.activatedInstanceCount);
- }
- if (message.totalInstanceCount !== 0) {
- writer.uint32(200).int32(message.totalInstanceCount);
- }
- if (message.enableSample !== false) {
- writer.uint32(208).bool(message.enableSample);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ActuatorInfo {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseActuatorInfo();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.gitCommit = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.readonly = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.saas = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.demo = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.host = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.port = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.externalUrl = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.needAdminSetup = reader.bool();
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.disallowSignup = reader.bool();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.lastActiveTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 12: {
- if (tag !== 96) {
- break;
- }
-
- message.require2fa = reader.bool();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.workspaceId = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 120) {
- break;
- }
-
- message.debug = reader.bool();
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.unlicensedFeatures.push(reader.string());
- continue;
- }
- case 20: {
- if (tag !== 160) {
- break;
- }
-
- message.disallowPasswordSignin = reader.bool();
- continue;
- }
- case 21: {
- if (tag !== 170) {
- break;
- }
-
- message.passwordRestriction = PasswordRestrictionSetting.decode(reader, reader.uint32());
- continue;
- }
- case 22: {
- if (tag !== 176) {
- break;
- }
-
- message.docker = reader.bool();
- continue;
- }
- case 23: {
- if (tag !== 186) {
- break;
- }
-
- message.userStats.push(ActuatorInfo_StatUser.decode(reader, reader.uint32()));
- continue;
- }
- case 24: {
- if (tag !== 192) {
- break;
- }
-
- message.activatedInstanceCount = reader.int32();
- continue;
- }
- case 25: {
- if (tag !== 200) {
- break;
- }
-
- message.totalInstanceCount = reader.int32();
- continue;
- }
- case 26: {
- if (tag !== 208) {
- break;
- }
-
- message.enableSample = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ActuatorInfo {
- return {
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- gitCommit: isSet(object.gitCommit) ? globalThis.String(object.gitCommit) : "",
- readonly: isSet(object.readonly) ? globalThis.Boolean(object.readonly) : false,
- saas: isSet(object.saas) ? globalThis.Boolean(object.saas) : false,
- demo: isSet(object.demo) ? globalThis.Boolean(object.demo) : false,
- host: isSet(object.host) ? globalThis.String(object.host) : "",
- port: isSet(object.port) ? globalThis.String(object.port) : "",
- externalUrl: isSet(object.externalUrl) ? globalThis.String(object.externalUrl) : "",
- needAdminSetup: isSet(object.needAdminSetup) ? globalThis.Boolean(object.needAdminSetup) : false,
- disallowSignup: isSet(object.disallowSignup) ? globalThis.Boolean(object.disallowSignup) : false,
- lastActiveTime: isSet(object.lastActiveTime) ? fromJsonTimestamp(object.lastActiveTime) : undefined,
- require2fa: isSet(object.require2fa) ? globalThis.Boolean(object.require2fa) : false,
- workspaceId: isSet(object.workspaceId) ? globalThis.String(object.workspaceId) : "",
- debug: isSet(object.debug) ? globalThis.Boolean(object.debug) : false,
- unlicensedFeatures: globalThis.Array.isArray(object?.unlicensedFeatures)
- ? object.unlicensedFeatures.map((e: any) => globalThis.String(e))
- : [],
- disallowPasswordSignin: isSet(object.disallowPasswordSignin)
- ? globalThis.Boolean(object.disallowPasswordSignin)
- : false,
- passwordRestriction: isSet(object.passwordRestriction)
- ? PasswordRestrictionSetting.fromJSON(object.passwordRestriction)
- : undefined,
- docker: isSet(object.docker) ? globalThis.Boolean(object.docker) : false,
- userStats: globalThis.Array.isArray(object?.userStats)
- ? object.userStats.map((e: any) => ActuatorInfo_StatUser.fromJSON(e))
- : [],
- activatedInstanceCount: isSet(object.activatedInstanceCount)
- ? globalThis.Number(object.activatedInstanceCount)
- : 0,
- totalInstanceCount: isSet(object.totalInstanceCount) ? globalThis.Number(object.totalInstanceCount) : 0,
- enableSample: isSet(object.enableSample) ? globalThis.Boolean(object.enableSample) : false,
- };
- },
-
- toJSON(message: ActuatorInfo): unknown {
- const obj: any = {};
- if (message.version !== "") {
- obj.version = message.version;
- }
- if (message.gitCommit !== "") {
- obj.gitCommit = message.gitCommit;
- }
- if (message.readonly !== false) {
- obj.readonly = message.readonly;
- }
- if (message.saas !== false) {
- obj.saas = message.saas;
- }
- if (message.demo !== false) {
- obj.demo = message.demo;
- }
- if (message.host !== "") {
- obj.host = message.host;
- }
- if (message.port !== "") {
- obj.port = message.port;
- }
- if (message.externalUrl !== "") {
- obj.externalUrl = message.externalUrl;
- }
- if (message.needAdminSetup !== false) {
- obj.needAdminSetup = message.needAdminSetup;
- }
- if (message.disallowSignup !== false) {
- obj.disallowSignup = message.disallowSignup;
- }
- if (message.lastActiveTime !== undefined) {
- obj.lastActiveTime = fromTimestamp(message.lastActiveTime).toISOString();
- }
- if (message.require2fa !== false) {
- obj.require2fa = message.require2fa;
- }
- if (message.workspaceId !== "") {
- obj.workspaceId = message.workspaceId;
- }
- if (message.debug !== false) {
- obj.debug = message.debug;
- }
- if (message.unlicensedFeatures?.length) {
- obj.unlicensedFeatures = message.unlicensedFeatures;
- }
- if (message.disallowPasswordSignin !== false) {
- obj.disallowPasswordSignin = message.disallowPasswordSignin;
- }
- if (message.passwordRestriction !== undefined) {
- obj.passwordRestriction = PasswordRestrictionSetting.toJSON(message.passwordRestriction);
- }
- if (message.docker !== false) {
- obj.docker = message.docker;
- }
- if (message.userStats?.length) {
- obj.userStats = message.userStats.map((e) => ActuatorInfo_StatUser.toJSON(e));
- }
- if (message.activatedInstanceCount !== 0) {
- obj.activatedInstanceCount = Math.round(message.activatedInstanceCount);
- }
- if (message.totalInstanceCount !== 0) {
- obj.totalInstanceCount = Math.round(message.totalInstanceCount);
- }
- if (message.enableSample !== false) {
- obj.enableSample = message.enableSample;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ActuatorInfo>): ActuatorInfo {
- return ActuatorInfo.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ActuatorInfo>): ActuatorInfo {
- const message = createBaseActuatorInfo();
- message.version = object.version ?? "";
- message.gitCommit = object.gitCommit ?? "";
- message.readonly = object.readonly ?? false;
- message.saas = object.saas ?? false;
- message.demo = object.demo ?? false;
- message.host = object.host ?? "";
- message.port = object.port ?? "";
- message.externalUrl = object.externalUrl ?? "";
- message.needAdminSetup = object.needAdminSetup ?? false;
- message.disallowSignup = object.disallowSignup ?? false;
- message.lastActiveTime = (object.lastActiveTime !== undefined && object.lastActiveTime !== null)
- ? Timestamp.fromPartial(object.lastActiveTime)
- : undefined;
- message.require2fa = object.require2fa ?? false;
- message.workspaceId = object.workspaceId ?? "";
- message.debug = object.debug ?? false;
- message.unlicensedFeatures = object.unlicensedFeatures?.map((e) => e) || [];
- message.disallowPasswordSignin = object.disallowPasswordSignin ?? false;
- message.passwordRestriction = (object.passwordRestriction !== undefined && object.passwordRestriction !== null)
- ? PasswordRestrictionSetting.fromPartial(object.passwordRestriction)
- : undefined;
- message.docker = object.docker ?? false;
- message.userStats = object.userStats?.map((e) => ActuatorInfo_StatUser.fromPartial(e)) || [];
- message.activatedInstanceCount = object.activatedInstanceCount ?? 0;
- message.totalInstanceCount = object.totalInstanceCount ?? 0;
- message.enableSample = object.enableSample ?? false;
- return message;
- },
-};
-
-function createBaseActuatorInfo_StatUser(): ActuatorInfo_StatUser {
- return { userType: UserType.USER_TYPE_UNSPECIFIED, state: State.STATE_UNSPECIFIED, count: 0 };
-}
-
-export const ActuatorInfo_StatUser: MessageFns<ActuatorInfo_StatUser> = {
- encode(message: ActuatorInfo_StatUser, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(userTypeToNumber(message.userType));
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- writer.uint32(16).int32(stateToNumber(message.state));
- }
- if (message.count !== 0) {
- writer.uint32(24).int32(message.count);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ActuatorInfo_StatUser {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseActuatorInfo_StatUser();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.userType = userTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.count = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ActuatorInfo_StatUser {
- return {
- userType: isSet(object.userType) ? userTypeFromJSON(object.userType) : UserType.USER_TYPE_UNSPECIFIED,
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- count: isSet(object.count) ? globalThis.Number(object.count) : 0,
- };
- },
-
- toJSON(message: ActuatorInfo_StatUser): unknown {
- const obj: any = {};
- if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
- obj.userType = userTypeToJSON(message.userType);
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- if (message.count !== 0) {
- obj.count = Math.round(message.count);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ActuatorInfo_StatUser>): ActuatorInfo_StatUser {
- return ActuatorInfo_StatUser.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ActuatorInfo_StatUser>): ActuatorInfo_StatUser {
- const message = createBaseActuatorInfo_StatUser();
- message.userType = object.userType ?? UserType.USER_TYPE_UNSPECIFIED;
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- message.count = object.count ?? 0;
- return message;
- },
-};
-
-export type ActuatorServiceDefinition = typeof ActuatorServiceDefinition;
-export const ActuatorServiceDefinition = {
- name: "ActuatorService",
- fullName: "bytebase.v1.ActuatorService",
- methods: {
- /** Permissions required: None */
- getActuatorInfo: {
- name: "GetActuatorInfo",
- requestType: GetActuatorInfoRequest,
- requestStream: false,
- responseType: ActuatorInfo,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 18, 17, 47, 118, 49, 47, 97, 99, 116, 117, 97, 116, 111, 114, 47, 105, 110, 102, 111]),
- ],
- },
- },
- },
- /** Permissions required: bb.settings.set */
- updateActuatorInfo: {
- name: "UpdateActuatorInfo",
- requestType: UpdateActuatorInfoRequest,
- requestStream: false,
- responseType: ActuatorInfo,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 20,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [new Uint8Array([15, 98, 98, 46, 115, 101, 116, 116, 105, 110, 103, 115, 46, 115, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 29,
- 58,
- 8,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 50,
- 17,
- 47,
- 118,
- 49,
- 47,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 47,
- 105,
- 110,
- 102,
- 111,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.create */
- setupSample: {
- name: "SetupSample",
- requestType: SetupSampleRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 26,
- 34,
- 24,
- 47,
- 118,
- 49,
- 47,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 58,
- 115,
- 101,
- 116,
- 117,
- 112,
- 83,
- 97,
- 109,
- 112,
- 108,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- deleteCache: {
- name: "DeleteCache",
- requestType: DeleteCacheRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 42,
- 18,
- 47,
- 118,
- 49,
- 47,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 47,
- 99,
- 97,
- 99,
- 104,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- getResourcePackage: {
- name: "GetResourcePackage",
- requestType: GetResourcePackageRequest,
- requestStream: false,
- responseType: ResourcePackage,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 24,
- 18,
- 22,
- 47,
- 118,
- 49,
- 47,
- 97,
- 99,
- 116,
- 117,
- 97,
- 116,
- 111,
- 114,
- 47,
- 114,
- 101,
- 115,
- 111,
- 117,
- 114,
- 99,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/annotation.ts b/frontend/src/types/proto/v1/annotation.ts
deleted file mode 100644
index 75d9e68c0a..0000000000
--- a/frontend/src/types/proto/v1/annotation.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/annotation.proto
-
-/* eslint-disable */
-
-export const protobufPackage = "bytebase.v1";
-
-export enum AuthMethod {
- AUTH_METHOD_UNSPECIFIED = "AUTH_METHOD_UNSPECIFIED",
- /** IAM - IAM uses the standard IAM authorization check on the organizational resources. */
- IAM = "IAM",
- /** CUSTOM - Custom authorization method. */
- CUSTOM = "CUSTOM",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function authMethodFromJSON(object: any): AuthMethod {
- switch (object) {
- case 0:
- case "AUTH_METHOD_UNSPECIFIED":
- return AuthMethod.AUTH_METHOD_UNSPECIFIED;
- case 1:
- case "IAM":
- return AuthMethod.IAM;
- case 2:
- case "CUSTOM":
- return AuthMethod.CUSTOM;
- case -1:
- case "UNRECOGNIZED":
- default:
- return AuthMethod.UNRECOGNIZED;
- }
-}
-
-export function authMethodToJSON(object: AuthMethod): string {
- switch (object) {
- case AuthMethod.AUTH_METHOD_UNSPECIFIED:
- return "AUTH_METHOD_UNSPECIFIED";
- case AuthMethod.IAM:
- return "IAM";
- case AuthMethod.CUSTOM:
- return "CUSTOM";
- case AuthMethod.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function authMethodToNumber(object: AuthMethod): number {
- switch (object) {
- case AuthMethod.AUTH_METHOD_UNSPECIFIED:
- return 0;
- case AuthMethod.IAM:
- return 1;
- case AuthMethod.CUSTOM:
- return 2;
- case AuthMethod.UNRECOGNIZED:
- default:
- return -1;
- }
-}
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
deleted file mode 100644
index 8b174914f7..0000000000
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ /dev/null
@@ -1,1359 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/audit_log_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Any } from "../google/protobuf/any";
-import { Duration } from "../google/protobuf/duration";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { Status } from "../google/rpc/status";
-import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber } from "./common";
-import { PolicyDelta } from "./iam_policy";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface SearchAuditLogsRequest {
- parent: string;
- /**
- * The filter of the log. It should be a valid CEL expression.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
- * - severity: support "==" operator, check Severity enum in AuditLog message for values.
- * - user: the actor, should in "users/{email}" format, support "==" operator.
- * - create_time: support ">=" and "<=" operator.
- *
- * For example:
- * - filter = "method == '/bytebase.v1.SQLService/Query'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
- */
- filter: string;
- /**
- * The order by of the log.
- * Only support order by create_time.
- * For example:
- * - order_by = "create_time asc"
- * - order_by = "create_time desc"
- */
- orderBy: string;
- /**
- * The maximum number of logs to return.
- * The service may return fewer than this value.
- * If unspecified, at most 10 log entries will be returned.
- * The maximum value is 5000; values above 5000 will be coerced to 5000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `SearchLogs` call.
- * Provide this to retrieve the subsequent page.
- */
- pageToken: string;
-}
-
-export interface SearchAuditLogsResponse {
- auditLogs: AuditLog[];
- /**
- * A token to retrieve next page of log entities.
- * Pass this value in the page_token field in the subsequent call
- * to retrieve the next page of log entities.
- */
- nextPageToken: string;
-}
-
-export interface ExportAuditLogsRequest {
- parent: string;
- /**
- * The filter of the log. It should be a valid CEL expression.
- * Check the filter field in the SearchAuditLogsRequest message.
- */
- filter: string;
- /**
- * The order by of the log.
- * Only support order by create_time.
- * For example:
- * - order_by = "create_time asc"
- * - order_by = "create_time desc"
- */
- orderBy: string;
- /** The export format. */
- format: ExportFormat;
- /**
- * The maximum number of logs to return.
- * The service may return fewer than this value.
- * If unspecified, at most 10 log entries will be returned.
- * The maximum value is 5000; values above 5000 will be coerced to 5000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ExportAuditLogs` call.
- * Provide this to retrieve the subsequent page.
- */
- pageToken: string;
-}
-
-export interface ExportAuditLogsResponse {
- content: Uint8Array;
- /**
- * A token to retrieve next page of log entities.
- * Pass this value in the page_token field in the subsequent call
- * to retrieve the next page of log entities.
- */
- nextPageToken: string;
-}
-
-export interface AuditLog {
- /**
- * The name of the log.
- * Formats:
- * - projects/{project}/auditLogs/{uid}
- * - workspaces/{workspace}/auditLogs/{uid}
- */
- name: string;
- createTime:
- | Timestamp
- | undefined;
- /** Format: users/[email protected] */
- user: string;
- /** e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push` */
- method: string;
- severity: AuditLog_Severity;
- /** The associated resource. */
- resource: string;
- /** JSON-encoded request. */
- request: string;
- /**
- * JSON-encoded response.
- * Some fields are omitted because they are too large or contain sensitive information.
- */
- response: string;
- status:
- | Status
- | undefined;
- /** The latency of the RPC. */
- latency:
- | Duration
- | undefined;
- /** service-specific data about the request, response, and other activities. */
- serviceData:
- | Any
- | undefined;
- /** Metadata about the operation. */
- requestMetadata: RequestMetadata | undefined;
-}
-
-export enum AuditLog_Severity {
- 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 {
- switch (object) {
- case 0:
- case "DEFAULT":
- return AuditLog_Severity.DEFAULT;
- case 1:
- case "DEBUG":
- return AuditLog_Severity.DEBUG;
- case 2:
- case "INFO":
- return AuditLog_Severity.INFO;
- case 3:
- case "NOTICE":
- return AuditLog_Severity.NOTICE;
- case 4:
- case "WARNING":
- return AuditLog_Severity.WARNING;
- case 5:
- case "ERROR":
- return AuditLog_Severity.ERROR;
- case 6:
- case "CRITICAL":
- return AuditLog_Severity.CRITICAL;
- case 7:
- case "ALERT":
- return AuditLog_Severity.ALERT;
- case 8:
- case "EMERGENCY":
- return AuditLog_Severity.EMERGENCY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return AuditLog_Severity.UNRECOGNIZED;
- }
-}
-
-export function auditLog_SeverityToJSON(object: AuditLog_Severity): string {
- switch (object) {
- case AuditLog_Severity.DEFAULT:
- return "DEFAULT";
- case AuditLog_Severity.DEBUG:
- return "DEBUG";
- case AuditLog_Severity.INFO:
- return "INFO";
- case AuditLog_Severity.NOTICE:
- return "NOTICE";
- case AuditLog_Severity.WARNING:
- return "WARNING";
- case AuditLog_Severity.ERROR:
- return "ERROR";
- case AuditLog_Severity.CRITICAL:
- return "CRITICAL";
- case AuditLog_Severity.ALERT:
- return "ALERT";
- case AuditLog_Severity.EMERGENCY:
- return "EMERGENCY";
- case AuditLog_Severity.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- }
-}
-
-export interface AuditData {
- policyDelta: PolicyDelta | undefined;
-}
-
-/** Metadata about the request. */
-export interface RequestMetadata {
- /** The IP address of the caller. */
- callerIp: string;
- /**
- * The user agent of the caller.
- * This information is not authenticated and should be treated accordingly.
- */
- callerSuppliedUserAgent: string;
-}
-
-function createBaseSearchAuditLogsRequest(): SearchAuditLogsRequest {
- return { parent: "", filter: "", orderBy: "", pageSize: 0, pageToken: "" };
-}
-
-export const SearchAuditLogsRequest: MessageFns<SearchAuditLogsRequest> = {
- encode(message: SearchAuditLogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(42).string(message.parent);
- }
- if (message.filter !== "") {
- writer.uint32(10).string(message.filter);
- }
- if (message.orderBy !== "") {
- writer.uint32(18).string(message.orderBy);
- }
- if (message.pageSize !== 0) {
- writer.uint32(24).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(34).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchAuditLogsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchAuditLogsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.orderBy = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchAuditLogsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: SearchAuditLogsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.orderBy !== "") {
- obj.orderBy = message.orderBy;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchAuditLogsRequest>): SearchAuditLogsRequest {
- return SearchAuditLogsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchAuditLogsRequest>): SearchAuditLogsRequest {
- const message = createBaseSearchAuditLogsRequest();
- message.parent = object.parent ?? "";
- message.filter = object.filter ?? "";
- message.orderBy = object.orderBy ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchAuditLogsResponse(): SearchAuditLogsResponse {
- return { auditLogs: [], nextPageToken: "" };
-}
-
-export const SearchAuditLogsResponse: MessageFns<SearchAuditLogsResponse> = {
- encode(message: SearchAuditLogsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.auditLogs) {
- AuditLog.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchAuditLogsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchAuditLogsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.auditLogs.push(AuditLog.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchAuditLogsResponse {
- return {
- auditLogs: globalThis.Array.isArray(object?.auditLogs)
- ? object.auditLogs.map((e: any) => AuditLog.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchAuditLogsResponse): unknown {
- const obj: any = {};
- if (message.auditLogs?.length) {
- obj.auditLogs = message.auditLogs.map((e) => AuditLog.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchAuditLogsResponse>): SearchAuditLogsResponse {
- return SearchAuditLogsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchAuditLogsResponse>): SearchAuditLogsResponse {
- const message = createBaseSearchAuditLogsResponse();
- message.auditLogs = object.auditLogs?.map((e) => AuditLog.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseExportAuditLogsRequest(): ExportAuditLogsRequest {
- return { parent: "", filter: "", orderBy: "", format: ExportFormat.FORMAT_UNSPECIFIED, pageSize: 0, pageToken: "" };
-}
-
-export const ExportAuditLogsRequest: MessageFns<ExportAuditLogsRequest> = {
- encode(message: ExportAuditLogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(34).string(message.parent);
- }
- if (message.filter !== "") {
- writer.uint32(10).string(message.filter);
- }
- if (message.orderBy !== "") {
- writer.uint32(18).string(message.orderBy);
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- writer.uint32(24).int32(exportFormatToNumber(message.format));
- }
- if (message.pageSize !== 0) {
- writer.uint32(40).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(50).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExportAuditLogsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExportAuditLogsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.orderBy = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.format = exportFormatFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExportAuditLogsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ExportAuditLogsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.orderBy !== "") {
- obj.orderBy = message.orderBy;
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- obj.format = exportFormatToJSON(message.format);
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExportAuditLogsRequest>): ExportAuditLogsRequest {
- return ExportAuditLogsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExportAuditLogsRequest>): ExportAuditLogsRequest {
- const message = createBaseExportAuditLogsRequest();
- message.parent = object.parent ?? "";
- message.filter = object.filter ?? "";
- message.orderBy = object.orderBy ?? "";
- message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseExportAuditLogsResponse(): ExportAuditLogsResponse {
- return { content: new Uint8Array(0), nextPageToken: "" };
-}
-
-export const ExportAuditLogsResponse: MessageFns<ExportAuditLogsResponse> = {
- encode(message: ExportAuditLogsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.content.length !== 0) {
- writer.uint32(10).bytes(message.content);
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExportAuditLogsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExportAuditLogsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.content = reader.bytes();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExportAuditLogsResponse {
- return {
- content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ExportAuditLogsResponse): unknown {
- const obj: any = {};
- if (message.content.length !== 0) {
- obj.content = base64FromBytes(message.content);
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExportAuditLogsResponse>): ExportAuditLogsResponse {
- return ExportAuditLogsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExportAuditLogsResponse>): ExportAuditLogsResponse {
- const message = createBaseExportAuditLogsResponse();
- message.content = object.content ?? new Uint8Array(0);
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseAuditLog(): AuditLog {
- return {
- name: "",
- createTime: undefined,
- user: "",
- method: "",
- severity: AuditLog_Severity.DEFAULT,
- resource: "",
- request: "",
- response: "",
- status: undefined,
- latency: undefined,
- serviceData: undefined,
- requestMetadata: undefined,
- };
-}
-
-export const AuditLog: MessageFns<AuditLog> = {
- encode(message: AuditLog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(18).fork()).join();
- }
- if (message.user !== "") {
- writer.uint32(26).string(message.user);
- }
- if (message.method !== "") {
- writer.uint32(34).string(message.method);
- }
- if (message.severity !== AuditLog_Severity.DEFAULT) {
- writer.uint32(40).int32(auditLog_SeverityToNumber(message.severity));
- }
- if (message.resource !== "") {
- writer.uint32(50).string(message.resource);
- }
- if (message.request !== "") {
- writer.uint32(58).string(message.request);
- }
- if (message.response !== "") {
- writer.uint32(66).string(message.response);
- }
- if (message.status !== undefined) {
- Status.encode(message.status, writer.uint32(74).fork()).join();
- }
- if (message.latency !== undefined) {
- Duration.encode(message.latency, writer.uint32(82).fork()).join();
- }
- if (message.serviceData !== undefined) {
- Any.encode(message.serviceData, writer.uint32(90).fork()).join();
- }
- if (message.requestMetadata !== undefined) {
- RequestMetadata.encode(message.requestMetadata, writer.uint32(98).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AuditLog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAuditLog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.user = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.method = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.severity = auditLog_SeverityFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.resource = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.request = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.response = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.status = Status.decode(reader, reader.uint32());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.latency = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.serviceData = Any.decode(reader, reader.uint32());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.requestMetadata = RequestMetadata.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AuditLog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- user: isSet(object.user) ? globalThis.String(object.user) : "",
- method: isSet(object.method) ? globalThis.String(object.method) : "",
- severity: isSet(object.severity) ? auditLog_SeverityFromJSON(object.severity) : AuditLog_Severity.DEFAULT,
- resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
- request: isSet(object.request) ? globalThis.String(object.request) : "",
- response: isSet(object.response) ? globalThis.String(object.response) : "",
- status: isSet(object.status) ? Status.fromJSON(object.status) : undefined,
- latency: isSet(object.latency) ? Duration.fromJSON(object.latency) : undefined,
- serviceData: isSet(object.serviceData) ? Any.fromJSON(object.serviceData) : undefined,
- requestMetadata: isSet(object.requestMetadata) ? RequestMetadata.fromJSON(object.requestMetadata) : undefined,
- };
- },
-
- toJSON(message: AuditLog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.user !== "") {
- obj.user = message.user;
- }
- if (message.method !== "") {
- obj.method = message.method;
- }
- if (message.severity !== AuditLog_Severity.DEFAULT) {
- obj.severity = auditLog_SeverityToJSON(message.severity);
- }
- if (message.resource !== "") {
- obj.resource = message.resource;
- }
- if (message.request !== "") {
- obj.request = message.request;
- }
- if (message.response !== "") {
- obj.response = message.response;
- }
- if (message.status !== undefined) {
- obj.status = Status.toJSON(message.status);
- }
- if (message.latency !== undefined) {
- obj.latency = Duration.toJSON(message.latency);
- }
- if (message.serviceData !== undefined) {
- obj.serviceData = Any.toJSON(message.serviceData);
- }
- if (message.requestMetadata !== undefined) {
- obj.requestMetadata = RequestMetadata.toJSON(message.requestMetadata);
- }
- return obj;
- },
-
- create(base?: DeepPartial<AuditLog>): AuditLog {
- return AuditLog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AuditLog>): AuditLog {
- const message = createBaseAuditLog();
- message.name = object.name ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.user = object.user ?? "";
- message.method = object.method ?? "";
- message.severity = object.severity ?? AuditLog_Severity.DEFAULT;
- message.resource = object.resource ?? "";
- message.request = object.request ?? "";
- message.response = object.response ?? "";
- message.status = (object.status !== undefined && object.status !== null)
- ? Status.fromPartial(object.status)
- : undefined;
- message.latency = (object.latency !== undefined && object.latency !== null)
- ? Duration.fromPartial(object.latency)
- : undefined;
- message.serviceData = (object.serviceData !== undefined && object.serviceData !== null)
- ? Any.fromPartial(object.serviceData)
- : undefined;
- message.requestMetadata = (object.requestMetadata !== undefined && object.requestMetadata !== null)
- ? RequestMetadata.fromPartial(object.requestMetadata)
- : undefined;
- return message;
- },
-};
-
-function createBaseAuditData(): AuditData {
- return { policyDelta: undefined };
-}
-
-export const AuditData: MessageFns<AuditData> = {
- encode(message: AuditData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.policyDelta !== undefined) {
- PolicyDelta.encode(message.policyDelta, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AuditData {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAuditData();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.policyDelta = PolicyDelta.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AuditData {
- return { policyDelta: isSet(object.policyDelta) ? PolicyDelta.fromJSON(object.policyDelta) : undefined };
- },
-
- toJSON(message: AuditData): unknown {
- const obj: any = {};
- if (message.policyDelta !== undefined) {
- obj.policyDelta = PolicyDelta.toJSON(message.policyDelta);
- }
- return obj;
- },
-
- create(base?: DeepPartial<AuditData>): AuditData {
- return AuditData.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AuditData>): AuditData {
- const message = createBaseAuditData();
- message.policyDelta = (object.policyDelta !== undefined && object.policyDelta !== null)
- ? PolicyDelta.fromPartial(object.policyDelta)
- : undefined;
- return message;
- },
-};
-
-function createBaseRequestMetadata(): RequestMetadata {
- return { callerIp: "", callerSuppliedUserAgent: "" };
-}
-
-export const RequestMetadata: MessageFns<RequestMetadata> = {
- encode(message: RequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.callerIp !== "") {
- writer.uint32(10).string(message.callerIp);
- }
- if (message.callerSuppliedUserAgent !== "") {
- writer.uint32(18).string(message.callerSuppliedUserAgent);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RequestMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRequestMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.callerIp = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.callerSuppliedUserAgent = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RequestMetadata {
- return {
- callerIp: isSet(object.callerIp) ? globalThis.String(object.callerIp) : "",
- callerSuppliedUserAgent: isSet(object.callerSuppliedUserAgent)
- ? globalThis.String(object.callerSuppliedUserAgent)
- : "",
- };
- },
-
- toJSON(message: RequestMetadata): unknown {
- const obj: any = {};
- if (message.callerIp !== "") {
- obj.callerIp = message.callerIp;
- }
- if (message.callerSuppliedUserAgent !== "") {
- obj.callerSuppliedUserAgent = message.callerSuppliedUserAgent;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RequestMetadata>): RequestMetadata {
- return RequestMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RequestMetadata>): RequestMetadata {
- const message = createBaseRequestMetadata();
- message.callerIp = object.callerIp ?? "";
- message.callerSuppliedUserAgent = object.callerSuppliedUserAgent ?? "";
- return message;
- },
-};
-
-export type AuditLogServiceDefinition = typeof AuditLogServiceDefinition;
-export const AuditLogServiceDefinition = {
- name: "AuditLogService",
- fullName: "bytebase.v1.AuditLogService",
- methods: {
- /** Permissions required: None */
- searchAuditLogs: {
- name: "SearchAuditLogs",
- requestType: SearchAuditLogsRequest,
- requestStream: false,
- responseType: SearchAuditLogsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([19, 98, 98, 46, 97, 117, 100, 105, 116, 76, 111, 103, 115, 46, 115, 101, 97, 114, 99, 104]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 72,
- 58,
- 1,
- 42,
- 90,
- 25,
- 58,
- 1,
- 42,
- 34,
- 20,
- 47,
- 118,
- 49,
- 47,
- 97,
- 117,
- 100,
- 105,
- 116,
- 76,
- 111,
- 103,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- 34,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 97,
- 117,
- 100,
- 105,
- 116,
- 76,
- 111,
- 103,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.auditLogs.export */
- exportAuditLogs: {
- name: "ExportAuditLogs",
- requestType: ExportAuditLogsRequest,
- requestStream: false,
- responseType: ExportAuditLogsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 97,
- 117,
- 100,
- 105,
- 116,
- 76,
- 111,
- 103,
- 115,
- 46,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 72,
- 58,
- 1,
- 42,
- 90,
- 25,
- 58,
- 1,
- 42,
- 34,
- 20,
- 47,
- 118,
- 49,
- 47,
- 97,
- 117,
- 100,
- 105,
- 116,
- 76,
- 111,
- 103,
- 115,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- 34,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 97,
- 117,
- 100,
- 105,
- 116,
- 76,
- 111,
- 103,
- 115,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
deleted file mode 100644
index 522bc75d03..0000000000
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ /dev/null
@@ -1,666 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/auth_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { User } from "./user_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface LoginRequest {
- email: string;
- password: string;
- /** If web is set, we will set access token, refresh token, and user to the cookie. */
- web: boolean;
- /**
- * The name of the identity provider.
- * Format: idps/{idp}
- */
- idpName: string;
- /** The idp_context is using to get the user information from identity provider. */
- idpContext:
- | IdentityProviderContext
- | undefined;
- /** The otp_code is used to verify the user's identity by MFA. */
- otpCode?:
- | string
- | undefined;
- /** The recovery_code is used to recovery the user's identity with MFA. */
- recoveryCode?:
- | string
- | undefined;
- /** The mfa_temp_token is used to verify the user's identity by MFA. */
- mfaTempToken?: string | undefined;
-}
-
-export interface IdentityProviderContext {
- oauth2Context?: OAuth2IdentityProviderContext | undefined;
- oidcContext?: OIDCIdentityProviderContext | undefined;
-}
-
-export interface OAuth2IdentityProviderContext {
- code: string;
-}
-
-export interface OIDCIdentityProviderContext {
-}
-
-export interface LoginResponse {
- token: string;
- mfaTempToken?: string | undefined;
- requireResetPassword: boolean;
- /** The user of successful login. */
- user: User | undefined;
-}
-
-export interface LogoutRequest {
-}
-
-function createBaseLoginRequest(): LoginRequest {
- return {
- email: "",
- password: "",
- web: false,
- idpName: "",
- idpContext: undefined,
- otpCode: undefined,
- recoveryCode: undefined,
- mfaTempToken: undefined,
- };
-}
-
-export const LoginRequest: MessageFns<LoginRequest> = {
- encode(message: LoginRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.email !== "") {
- writer.uint32(10).string(message.email);
- }
- if (message.password !== "") {
- writer.uint32(18).string(message.password);
- }
- if (message.web !== false) {
- writer.uint32(24).bool(message.web);
- }
- if (message.idpName !== "") {
- writer.uint32(34).string(message.idpName);
- }
- if (message.idpContext !== undefined) {
- IdentityProviderContext.encode(message.idpContext, writer.uint32(42).fork()).join();
- }
- if (message.otpCode !== undefined) {
- writer.uint32(50).string(message.otpCode);
- }
- if (message.recoveryCode !== undefined) {
- writer.uint32(58).string(message.recoveryCode);
- }
- if (message.mfaTempToken !== undefined) {
- writer.uint32(66).string(message.mfaTempToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): LoginRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseLoginRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.email = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.web = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.idpName = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.idpContext = IdentityProviderContext.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.otpCode = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.recoveryCode = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.mfaTempToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): LoginRequest {
- return {
- email: isSet(object.email) ? globalThis.String(object.email) : "",
- password: isSet(object.password) ? globalThis.String(object.password) : "",
- web: isSet(object.web) ? globalThis.Boolean(object.web) : false,
- idpName: isSet(object.idpName) ? globalThis.String(object.idpName) : "",
- idpContext: isSet(object.idpContext) ? IdentityProviderContext.fromJSON(object.idpContext) : undefined,
- otpCode: isSet(object.otpCode) ? globalThis.String(object.otpCode) : undefined,
- recoveryCode: isSet(object.recoveryCode) ? globalThis.String(object.recoveryCode) : undefined,
- mfaTempToken: isSet(object.mfaTempToken) ? globalThis.String(object.mfaTempToken) : undefined,
- };
- },
-
- toJSON(message: LoginRequest): unknown {
- const obj: any = {};
- if (message.email !== "") {
- obj.email = message.email;
- }
- if (message.password !== "") {
- obj.password = message.password;
- }
- if (message.web !== false) {
- obj.web = message.web;
- }
- if (message.idpName !== "") {
- obj.idpName = message.idpName;
- }
- if (message.idpContext !== undefined) {
- obj.idpContext = IdentityProviderContext.toJSON(message.idpContext);
- }
- if (message.otpCode !== undefined) {
- obj.otpCode = message.otpCode;
- }
- if (message.recoveryCode !== undefined) {
- obj.recoveryCode = message.recoveryCode;
- }
- if (message.mfaTempToken !== undefined) {
- obj.mfaTempToken = message.mfaTempToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<LoginRequest>): LoginRequest {
- return LoginRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<LoginRequest>): LoginRequest {
- const message = createBaseLoginRequest();
- message.email = object.email ?? "";
- message.password = object.password ?? "";
- message.web = object.web ?? false;
- message.idpName = object.idpName ?? "";
- message.idpContext = (object.idpContext !== undefined && object.idpContext !== null)
- ? IdentityProviderContext.fromPartial(object.idpContext)
- : undefined;
- message.otpCode = object.otpCode ?? undefined;
- message.recoveryCode = object.recoveryCode ?? undefined;
- message.mfaTempToken = object.mfaTempToken ?? undefined;
- return message;
- },
-};
-
-function createBaseIdentityProviderContext(): IdentityProviderContext {
- return { oauth2Context: undefined, oidcContext: undefined };
-}
-
-export const IdentityProviderContext: MessageFns<IdentityProviderContext> = {
- encode(message: IdentityProviderContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.oauth2Context !== undefined) {
- OAuth2IdentityProviderContext.encode(message.oauth2Context, writer.uint32(10).fork()).join();
- }
- if (message.oidcContext !== undefined) {
- OIDCIdentityProviderContext.encode(message.oidcContext, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderContext {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIdentityProviderContext();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.oauth2Context = OAuth2IdentityProviderContext.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.oidcContext = OIDCIdentityProviderContext.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IdentityProviderContext {
- return {
- oauth2Context: isSet(object.oauth2Context)
- ? OAuth2IdentityProviderContext.fromJSON(object.oauth2Context)
- : undefined,
- oidcContext: isSet(object.oidcContext) ? OIDCIdentityProviderContext.fromJSON(object.oidcContext) : undefined,
- };
- },
-
- toJSON(message: IdentityProviderContext): unknown {
- const obj: any = {};
- if (message.oauth2Context !== undefined) {
- obj.oauth2Context = OAuth2IdentityProviderContext.toJSON(message.oauth2Context);
- }
- if (message.oidcContext !== undefined) {
- obj.oidcContext = OIDCIdentityProviderContext.toJSON(message.oidcContext);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IdentityProviderContext>): IdentityProviderContext {
- return IdentityProviderContext.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IdentityProviderContext>): IdentityProviderContext {
- const message = createBaseIdentityProviderContext();
- message.oauth2Context = (object.oauth2Context !== undefined && object.oauth2Context !== null)
- ? OAuth2IdentityProviderContext.fromPartial(object.oauth2Context)
- : undefined;
- message.oidcContext = (object.oidcContext !== undefined && object.oidcContext !== null)
- ? OIDCIdentityProviderContext.fromPartial(object.oidcContext)
- : undefined;
- return message;
- },
-};
-
-function createBaseOAuth2IdentityProviderContext(): OAuth2IdentityProviderContext {
- return { code: "" };
-}
-
-export const OAuth2IdentityProviderContext: MessageFns<OAuth2IdentityProviderContext> = {
- encode(message: OAuth2IdentityProviderContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.code !== "") {
- writer.uint32(10).string(message.code);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): OAuth2IdentityProviderContext {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOAuth2IdentityProviderContext();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.code = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): OAuth2IdentityProviderContext {
- return { code: isSet(object.code) ? globalThis.String(object.code) : "" };
- },
-
- toJSON(message: OAuth2IdentityProviderContext): unknown {
- const obj: any = {};
- if (message.code !== "") {
- obj.code = message.code;
- }
- return obj;
- },
-
- create(base?: DeepPartial<OAuth2IdentityProviderContext>): OAuth2IdentityProviderContext {
- return OAuth2IdentityProviderContext.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<OAuth2IdentityProviderContext>): OAuth2IdentityProviderContext {
- const message = createBaseOAuth2IdentityProviderContext();
- message.code = object.code ?? "";
- return message;
- },
-};
-
-function createBaseOIDCIdentityProviderContext(): OIDCIdentityProviderContext {
- return {};
-}
-
-export const OIDCIdentityProviderContext: MessageFns<OIDCIdentityProviderContext> = {
- encode(_: OIDCIdentityProviderContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): OIDCIdentityProviderContext {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOIDCIdentityProviderContext();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): OIDCIdentityProviderContext {
- return {};
- },
-
- toJSON(_: OIDCIdentityProviderContext): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<OIDCIdentityProviderContext>): OIDCIdentityProviderContext {
- return OIDCIdentityProviderContext.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<OIDCIdentityProviderContext>): OIDCIdentityProviderContext {
- const message = createBaseOIDCIdentityProviderContext();
- return message;
- },
-};
-
-function createBaseLoginResponse(): LoginResponse {
- return { token: "", mfaTempToken: undefined, requireResetPassword: false, user: undefined };
-}
-
-export const LoginResponse: MessageFns<LoginResponse> = {
- encode(message: LoginResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.token !== "") {
- writer.uint32(10).string(message.token);
- }
- if (message.mfaTempToken !== undefined) {
- writer.uint32(18).string(message.mfaTempToken);
- }
- if (message.requireResetPassword !== false) {
- writer.uint32(24).bool(message.requireResetPassword);
- }
- if (message.user !== undefined) {
- User.encode(message.user, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): LoginResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseLoginResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.token = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.mfaTempToken = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.requireResetPassword = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.user = User.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): LoginResponse {
- return {
- token: isSet(object.token) ? globalThis.String(object.token) : "",
- mfaTempToken: isSet(object.mfaTempToken) ? globalThis.String(object.mfaTempToken) : undefined,
- requireResetPassword: isSet(object.requireResetPassword)
- ? globalThis.Boolean(object.requireResetPassword)
- : false,
- user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
- };
- },
-
- toJSON(message: LoginResponse): unknown {
- const obj: any = {};
- if (message.token !== "") {
- obj.token = message.token;
- }
- if (message.mfaTempToken !== undefined) {
- obj.mfaTempToken = message.mfaTempToken;
- }
- if (message.requireResetPassword !== false) {
- obj.requireResetPassword = message.requireResetPassword;
- }
- if (message.user !== undefined) {
- obj.user = User.toJSON(message.user);
- }
- return obj;
- },
-
- create(base?: DeepPartial<LoginResponse>): LoginResponse {
- return LoginResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<LoginResponse>): LoginResponse {
- const message = createBaseLoginResponse();
- message.token = object.token ?? "";
- message.mfaTempToken = object.mfaTempToken ?? undefined;
- message.requireResetPassword = object.requireResetPassword ?? false;
- message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
- return message;
- },
-};
-
-function createBaseLogoutRequest(): LogoutRequest {
- return {};
-}
-
-export const LogoutRequest: MessageFns<LogoutRequest> = {
- encode(_: LogoutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): LogoutRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseLogoutRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): LogoutRequest {
- return {};
- },
-
- toJSON(_: LogoutRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<LogoutRequest>): LogoutRequest {
- return LogoutRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<LogoutRequest>): LogoutRequest {
- const message = createBaseLogoutRequest();
- return message;
- },
-};
-
-export type AuthServiceDefinition = typeof AuthServiceDefinition;
-export const AuthServiceDefinition = {
- name: "AuthService",
- fullName: "bytebase.v1.AuthService",
- methods: {
- /** Permissions required: None */
- login: {
- name: "Login",
- requestType: LoginRequest,
- requestStream: false,
- responseType: LoginResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 58, 1, 42, 34, 14, 47, 118, 49, 47, 97, 117, 116, 104, 47, 108, 111, 103, 105, 110]),
- ],
- },
- },
- },
- /** Permissions required: None */
- logout: {
- name: "Logout",
- requestType: LogoutRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 58,
- 1,
- 42,
- 34,
- 15,
- 47,
- 118,
- 49,
- 47,
- 97,
- 117,
- 116,
- 104,
- 47,
- 108,
- 111,
- 103,
- 111,
- 117,
- 116,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/cel_service.ts b/frontend/src/types/proto/v1/cel_service.ts
deleted file mode 100644
index d970d36789..0000000000
--- a/frontend/src/types/proto/v1/cel_service.ts
+++ /dev/null
@@ -1,385 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/cel_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Expr } from "../google/api/expr/v1alpha1/syntax";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface BatchParseRequest {
- expressions: string[];
-}
-
-export interface BatchParseResponse {
- expressions: Expr[];
-}
-
-export interface BatchDeparseRequest {
- expressions: Expr[];
-}
-
-export interface BatchDeparseResponse {
- expressions: string[];
-}
-
-function createBaseBatchParseRequest(): BatchParseRequest {
- return { expressions: [] };
-}
-
-export const BatchParseRequest: MessageFns<BatchParseRequest> = {
- encode(message: BatchParseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.expressions) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchParseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchParseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.expressions.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchParseRequest {
- return {
- expressions: globalThis.Array.isArray(object?.expressions)
- ? object.expressions.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: BatchParseRequest): unknown {
- const obj: any = {};
- if (message.expressions?.length) {
- obj.expressions = message.expressions;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchParseRequest>): BatchParseRequest {
- return BatchParseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchParseRequest>): BatchParseRequest {
- const message = createBaseBatchParseRequest();
- message.expressions = object.expressions?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchParseResponse(): BatchParseResponse {
- return { expressions: [] };
-}
-
-export const BatchParseResponse: MessageFns<BatchParseResponse> = {
- encode(message: BatchParseResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.expressions) {
- Expr.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchParseResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchParseResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.expressions.push(Expr.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchParseResponse {
- return {
- expressions: globalThis.Array.isArray(object?.expressions)
- ? object.expressions.map((e: any) => Expr.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchParseResponse): unknown {
- const obj: any = {};
- if (message.expressions?.length) {
- obj.expressions = message.expressions.map((e) => Expr.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchParseResponse>): BatchParseResponse {
- return BatchParseResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchParseResponse>): BatchParseResponse {
- const message = createBaseBatchParseResponse();
- message.expressions = object.expressions?.map((e) => Expr.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchDeparseRequest(): BatchDeparseRequest {
- return { expressions: [] };
-}
-
-export const BatchDeparseRequest: MessageFns<BatchDeparseRequest> = {
- encode(message: BatchDeparseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.expressions) {
- Expr.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchDeparseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchDeparseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.expressions.push(Expr.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchDeparseRequest {
- return {
- expressions: globalThis.Array.isArray(object?.expressions)
- ? object.expressions.map((e: any) => Expr.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchDeparseRequest): unknown {
- const obj: any = {};
- if (message.expressions?.length) {
- obj.expressions = message.expressions.map((e) => Expr.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchDeparseRequest>): BatchDeparseRequest {
- return BatchDeparseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchDeparseRequest>): BatchDeparseRequest {
- const message = createBaseBatchDeparseRequest();
- message.expressions = object.expressions?.map((e) => Expr.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchDeparseResponse(): BatchDeparseResponse {
- return { expressions: [] };
-}
-
-export const BatchDeparseResponse: MessageFns<BatchDeparseResponse> = {
- encode(message: BatchDeparseResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.expressions) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchDeparseResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchDeparseResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.expressions.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchDeparseResponse {
- return {
- expressions: globalThis.Array.isArray(object?.expressions)
- ? object.expressions.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: BatchDeparseResponse): unknown {
- const obj: any = {};
- if (message.expressions?.length) {
- obj.expressions = message.expressions;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchDeparseResponse>): BatchDeparseResponse {
- return BatchDeparseResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchDeparseResponse>): BatchDeparseResponse {
- const message = createBaseBatchDeparseResponse();
- message.expressions = object.expressions?.map((e) => e) || [];
- return message;
- },
-};
-
-export type CelServiceDefinition = typeof CelServiceDefinition;
-export const CelServiceDefinition = {
- name: "CelService",
- fullName: "bytebase.v1.CelService",
- methods: {
- /** Permissions required: None */
- batchParse: {
- name: "BatchParse",
- requestType: BatchParseRequest,
- requestStream: false,
- responseType: BatchParseResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 23,
- 58,
- 1,
- 42,
- 34,
- 18,
- 47,
- 118,
- 49,
- 47,
- 99,
- 101,
- 108,
- 47,
- 98,
- 97,
- 116,
- 99,
- 104,
- 80,
- 97,
- 114,
- 115,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- batchDeparse: {
- name: "BatchDeparse",
- requestType: BatchDeparseRequest,
- requestStream: false,
- responseType: BatchDeparseResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 25,
- 58,
- 1,
- 42,
- 34,
- 20,
- 47,
- 118,
- 49,
- 47,
- 99,
- 101,
- 108,
- 47,
- 98,
- 97,
- 116,
- 99,
- 104,
- 68,
- 101,
- 112,
- 97,
- 114,
- 115,
- 101,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/changelist_service.ts b/frontend/src/types/proto/v1/changelist_service.ts
deleted file mode 100644
index 83cd7861a9..0000000000
--- a/frontend/src/types/proto/v1/changelist_service.ts
+++ /dev/null
@@ -1,1291 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/changelist_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface CreateChangelistRequest {
- /**
- * The parent resource where this changelist will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The changelist to create. */
- changelist:
- | Changelist
- | undefined;
- /**
- * The ID to use for the changelist, which will become the final component of
- * the changelist's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- changelistId: string;
-}
-
-export interface GetChangelistRequest {
- /**
- * The name of the changelist to retrieve.
- * Format: projects/{project}/changelists/{changelist}
- */
- name: string;
-}
-
-export interface ListChangelistsRequest {
- /**
- * The parent, which owns this collection of changelists.
- * Format: projects/{project}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of databases to return. The service may return fewer than
- * this value.
- * If unspecified, at most 50 databases will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListDatabases` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListDatabases` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListChangelistsResponse {
- /** The changelists from the specified request. */
- changelists: Changelist[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateChangelistRequest {
- /**
- * The changelist to update.
- *
- * The changelist's `name` field is used to identify the changelist to update.
- * Format: projects/{project}/changelists/{changelist}
- */
- changelist:
- | Changelist
- | undefined;
- /** The list of fields to be updated. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteChangelistRequest {
- /**
- * The name of the changelist to delete.
- * Format: projects/{project}/changelists/{changelist}
- */
- name: string;
-}
-
-export interface Changelist {
- /**
- * The name of the changelist resource.
- * Canonical parent is project.
- * Format: projects/{project}/changelists/{changelist}
- */
- name: string;
- description: string;
- /**
- * The creator of the changelist.
- * Format: users/{email}
- */
- creator: string;
- /** The last update time of the changelist. */
- updateTime: Timestamp | undefined;
- changes: Changelist_Change[];
-}
-
-export interface Changelist_Change {
- /** The name of a sheet. */
- sheet: string;
- /**
- * The source of origin.
- * 1) changelog: instances/{instance}/databases/{database}/changelogs/{changelog}.
- * 2) raw SQL if empty.
- */
- source: string;
-}
-
-function createBaseCreateChangelistRequest(): CreateChangelistRequest {
- return { parent: "", changelist: undefined, changelistId: "" };
-}
-
-export const CreateChangelistRequest: MessageFns<CreateChangelistRequest> = {
- encode(message: CreateChangelistRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.changelist !== undefined) {
- Changelist.encode(message.changelist, writer.uint32(18).fork()).join();
- }
- if (message.changelistId !== "") {
- writer.uint32(26).string(message.changelistId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateChangelistRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateChangelistRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.changelist = Changelist.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.changelistId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateChangelistRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- changelist: isSet(object.changelist) ? Changelist.fromJSON(object.changelist) : undefined,
- changelistId: isSet(object.changelistId) ? globalThis.String(object.changelistId) : "",
- };
- },
-
- toJSON(message: CreateChangelistRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.changelist !== undefined) {
- obj.changelist = Changelist.toJSON(message.changelist);
- }
- if (message.changelistId !== "") {
- obj.changelistId = message.changelistId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateChangelistRequest>): CreateChangelistRequest {
- return CreateChangelistRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateChangelistRequest>): CreateChangelistRequest {
- const message = createBaseCreateChangelistRequest();
- message.parent = object.parent ?? "";
- message.changelist = (object.changelist !== undefined && object.changelist !== null)
- ? Changelist.fromPartial(object.changelist)
- : undefined;
- message.changelistId = object.changelistId ?? "";
- return message;
- },
-};
-
-function createBaseGetChangelistRequest(): GetChangelistRequest {
- return { name: "" };
-}
-
-export const GetChangelistRequest: MessageFns<GetChangelistRequest> = {
- encode(message: GetChangelistRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetChangelistRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetChangelistRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetChangelistRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetChangelistRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetChangelistRequest>): GetChangelistRequest {
- return GetChangelistRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetChangelistRequest>): GetChangelistRequest {
- const message = createBaseGetChangelistRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListChangelistsRequest(): ListChangelistsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListChangelistsRequest: MessageFns<ListChangelistsRequest> = {
- encode(message: ListChangelistsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListChangelistsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListChangelistsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListChangelistsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListChangelistsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListChangelistsRequest>): ListChangelistsRequest {
- return ListChangelistsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListChangelistsRequest>): ListChangelistsRequest {
- const message = createBaseListChangelistsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListChangelistsResponse(): ListChangelistsResponse {
- return { changelists: [], nextPageToken: "" };
-}
-
-export const ListChangelistsResponse: MessageFns<ListChangelistsResponse> = {
- encode(message: ListChangelistsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.changelists) {
- Changelist.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListChangelistsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListChangelistsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.changelists.push(Changelist.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListChangelistsResponse {
- return {
- changelists: globalThis.Array.isArray(object?.changelists)
- ? object.changelists.map((e: any) => Changelist.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListChangelistsResponse): unknown {
- const obj: any = {};
- if (message.changelists?.length) {
- obj.changelists = message.changelists.map((e) => Changelist.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListChangelistsResponse>): ListChangelistsResponse {
- return ListChangelistsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListChangelistsResponse>): ListChangelistsResponse {
- const message = createBaseListChangelistsResponse();
- message.changelists = object.changelists?.map((e) => Changelist.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateChangelistRequest(): UpdateChangelistRequest {
- return { changelist: undefined, updateMask: undefined };
-}
-
-export const UpdateChangelistRequest: MessageFns<UpdateChangelistRequest> = {
- encode(message: UpdateChangelistRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.changelist !== undefined) {
- Changelist.encode(message.changelist, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateChangelistRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateChangelistRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.changelist = Changelist.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateChangelistRequest {
- return {
- changelist: isSet(object.changelist) ? Changelist.fromJSON(object.changelist) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateChangelistRequest): unknown {
- const obj: any = {};
- if (message.changelist !== undefined) {
- obj.changelist = Changelist.toJSON(message.changelist);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateChangelistRequest>): UpdateChangelistRequest {
- return UpdateChangelistRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateChangelistRequest>): UpdateChangelistRequest {
- const message = createBaseUpdateChangelistRequest();
- message.changelist = (object.changelist !== undefined && object.changelist !== null)
- ? Changelist.fromPartial(object.changelist)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteChangelistRequest(): DeleteChangelistRequest {
- return { name: "" };
-}
-
-export const DeleteChangelistRequest: MessageFns<DeleteChangelistRequest> = {
- encode(message: DeleteChangelistRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteChangelistRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteChangelistRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteChangelistRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteChangelistRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteChangelistRequest>): DeleteChangelistRequest {
- return DeleteChangelistRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteChangelistRequest>): DeleteChangelistRequest {
- const message = createBaseDeleteChangelistRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseChangelist(): Changelist {
- return { name: "", description: "", creator: "", updateTime: undefined, changes: [] };
-}
-
-export const Changelist: MessageFns<Changelist> = {
- encode(message: Changelist, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.description !== "") {
- writer.uint32(18).string(message.description);
- }
- if (message.creator !== "") {
- writer.uint32(26).string(message.creator);
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(50).fork()).join();
- }
- for (const v of message.changes) {
- Changelist_Change.encode(v!, writer.uint32(58).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Changelist {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelist();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.changes.push(Changelist_Change.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Changelist {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- changes: globalThis.Array.isArray(object?.changes)
- ? object.changes.map((e: any) => Changelist_Change.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: Changelist): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.changes?.length) {
- obj.changes = message.changes.map((e) => Changelist_Change.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Changelist>): Changelist {
- return Changelist.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Changelist>): Changelist {
- const message = createBaseChangelist();
- message.name = object.name ?? "";
- message.description = object.description ?? "";
- message.creator = object.creator ?? "";
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.changes = object.changes?.map((e) => Changelist_Change.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangelist_Change(): Changelist_Change {
- return { sheet: "", source: "" };
-}
-
-export const Changelist_Change: MessageFns<Changelist_Change> = {
- encode(message: Changelist_Change, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sheet !== "") {
- writer.uint32(10).string(message.sheet);
- }
- if (message.source !== "") {
- writer.uint32(18).string(message.source);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Changelist_Change {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelist_Change();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.source = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Changelist_Change {
- return {
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- source: isSet(object.source) ? globalThis.String(object.source) : "",
- };
- },
-
- toJSON(message: Changelist_Change): unknown {
- const obj: any = {};
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.source !== "") {
- obj.source = message.source;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Changelist_Change>): Changelist_Change {
- return Changelist_Change.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Changelist_Change>): Changelist_Change {
- const message = createBaseChangelist_Change();
- message.sheet = object.sheet ?? "";
- message.source = object.source ?? "";
- return message;
- },
-};
-
-export type ChangelistServiceDefinition = typeof ChangelistServiceDefinition;
-export const ChangelistServiceDefinition = {
- name: "ChangelistService",
- fullName: "bytebase.v1.ChangelistService",
- methods: {
- /** Permissions required: bb.changelists.create */
- createChangelist: {
- name: "CreateChangelist",
- requestType: CreateChangelistRequest,
- requestStream: false,
- responseType: Changelist,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([17, 112, 97, 114, 101, 110, 116, 44, 99, 104, 97, 110, 103, 101, 108, 105, 115, 116])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 58,
- 10,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 34,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.changelists.get */
- getChangelist: {
- name: "GetChangelist",
- requestType: GetChangelistRequest,
- requestStream: false,
- responseType: Changelist,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 99, 104, 97, 110, 103, 101, 108, 105, 115, 116, 115, 46, 103, 101, 116]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 37,
- 18,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.changelists.list */
- listChangelists: {
- name: "ListChangelists",
- requestType: ListChangelistsRequest,
- requestStream: false,
- responseType: ListChangelistsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 37,
- 18,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.changelists.update */
- updateChangelist: {
- name: "UpdateChangelist",
- requestType: UpdateChangelistRequest,
- requestStream: false,
- responseType: Changelist,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 22,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 60,
- 58,
- 10,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 50,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.changelists.delete */
- deleteChangelist: {
- name: "DeleteChangelist",
- requestType: DeleteChangelistRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 37,
- 42,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 105,
- 115,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/common.ts b/frontend/src/types/proto/v1/common.ts
deleted file mode 100644
index e1f633d6db..0000000000
--- a/frontend/src/types/proto/v1/common.ts
+++ /dev/null
@@ -1,652 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/common.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum State {
- STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
- ACTIVE = "ACTIVE",
- DELETED = "DELETED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function stateFromJSON(object: any): State {
- switch (object) {
- case 0:
- case "STATE_UNSPECIFIED":
- return State.STATE_UNSPECIFIED;
- case 1:
- case "ACTIVE":
- return State.ACTIVE;
- case 2:
- case "DELETED":
- return State.DELETED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return State.UNRECOGNIZED;
- }
-}
-
-export function stateToJSON(object: State): string {
- switch (object) {
- case State.STATE_UNSPECIFIED:
- return "STATE_UNSPECIFIED";
- case State.ACTIVE:
- return "ACTIVE";
- case State.DELETED:
- return "DELETED";
- case State.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "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",
- BIGQUERY = "BIGQUERY",
- DYNAMODB = "DYNAMODB",
- DATABRICKS = "DATABRICKS",
- COCKROACHDB = "COCKROACHDB",
- COSMOSDB = "COSMOSDB",
- TRINO = "TRINO",
- CASSANDRA = "CASSANDRA",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function engineFromJSON(object: any): Engine {
- switch (object) {
- case 0:
- case "ENGINE_UNSPECIFIED":
- return Engine.ENGINE_UNSPECIFIED;
- case 1:
- case "CLICKHOUSE":
- return Engine.CLICKHOUSE;
- case 2:
- case "MYSQL":
- return Engine.MYSQL;
- case 3:
- case "POSTGRES":
- return Engine.POSTGRES;
- case 4:
- case "SNOWFLAKE":
- return Engine.SNOWFLAKE;
- case 5:
- case "SQLITE":
- return Engine.SQLITE;
- case 6:
- case "TIDB":
- return Engine.TIDB;
- case 7:
- case "MONGODB":
- return Engine.MONGODB;
- case 8:
- case "REDIS":
- return Engine.REDIS;
- case 9:
- case "ORACLE":
- return Engine.ORACLE;
- case 10:
- case "SPANNER":
- return Engine.SPANNER;
- case 11:
- case "MSSQL":
- return Engine.MSSQL;
- case 12:
- case "REDSHIFT":
- return Engine.REDSHIFT;
- case 13:
- case "MARIADB":
- return Engine.MARIADB;
- case 14:
- case "OCEANBASE":
- return Engine.OCEANBASE;
- case 15:
- case "DM":
- return Engine.DM;
- case 16:
- case "RISINGWAVE":
- return Engine.RISINGWAVE;
- case 17:
- case "OCEANBASE_ORACLE":
- return Engine.OCEANBASE_ORACLE;
- case 18:
- case "STARROCKS":
- return Engine.STARROCKS;
- case 19:
- case "DORIS":
- return Engine.DORIS;
- case 20:
- case "HIVE":
- return Engine.HIVE;
- case 21:
- case "ELASTICSEARCH":
- return Engine.ELASTICSEARCH;
- case 22:
- case "BIGQUERY":
- return Engine.BIGQUERY;
- case 23:
- case "DYNAMODB":
- return Engine.DYNAMODB;
- case 24:
- case "DATABRICKS":
- return Engine.DATABRICKS;
- case 25:
- case "COCKROACHDB":
- return Engine.COCKROACHDB;
- case 26:
- case "COSMOSDB":
- return Engine.COSMOSDB;
- case 27:
- case "TRINO":
- return Engine.TRINO;
- case 28:
- case "CASSANDRA":
- return Engine.CASSANDRA;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Engine.UNRECOGNIZED;
- }
-}
-
-export function engineToJSON(object: Engine): string {
- switch (object) {
- case Engine.ENGINE_UNSPECIFIED:
- return "ENGINE_UNSPECIFIED";
- case Engine.CLICKHOUSE:
- return "CLICKHOUSE";
- case Engine.MYSQL:
- return "MYSQL";
- case Engine.POSTGRES:
- return "POSTGRES";
- case Engine.SNOWFLAKE:
- return "SNOWFLAKE";
- case Engine.SQLITE:
- return "SQLITE";
- case Engine.TIDB:
- return "TIDB";
- case Engine.MONGODB:
- return "MONGODB";
- case Engine.REDIS:
- return "REDIS";
- case Engine.ORACLE:
- return "ORACLE";
- case Engine.SPANNER:
- return "SPANNER";
- case Engine.MSSQL:
- return "MSSQL";
- case Engine.REDSHIFT:
- return "REDSHIFT";
- case Engine.MARIADB:
- return "MARIADB";
- case Engine.OCEANBASE:
- return "OCEANBASE";
- case Engine.DM:
- return "DM";
- case Engine.RISINGWAVE:
- return "RISINGWAVE";
- case Engine.OCEANBASE_ORACLE:
- return "OCEANBASE_ORACLE";
- case Engine.STARROCKS:
- return "STARROCKS";
- case Engine.DORIS:
- return "DORIS";
- case Engine.HIVE:
- return "HIVE";
- case Engine.ELASTICSEARCH:
- return "ELASTICSEARCH";
- case Engine.BIGQUERY:
- return "BIGQUERY";
- case Engine.DYNAMODB:
- return "DYNAMODB";
- case Engine.DATABRICKS:
- return "DATABRICKS";
- case Engine.COCKROACHDB:
- return "COCKROACHDB";
- case Engine.COSMOSDB:
- return "COSMOSDB";
- case Engine.TRINO:
- return "TRINO";
- case Engine.CASSANDRA:
- return "CASSANDRA";
- case Engine.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.BIGQUERY:
- return 22;
- case Engine.DYNAMODB:
- return 23;
- case Engine.DATABRICKS:
- return 24;
- case Engine.COCKROACHDB:
- return 25;
- case Engine.COSMOSDB:
- return 26;
- case Engine.TRINO:
- return 27;
- case Engine.CASSANDRA:
- return 28;
- case Engine.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum VCSType {
- VCS_TYPE_UNSPECIFIED = "VCS_TYPE_UNSPECIFIED",
- GITHUB = "GITHUB",
- GITLAB = "GITLAB",
- BITBUCKET = "BITBUCKET",
- AZURE_DEVOPS = "AZURE_DEVOPS",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function vCSTypeFromJSON(object: any): VCSType {
- switch (object) {
- case 0:
- case "VCS_TYPE_UNSPECIFIED":
- return VCSType.VCS_TYPE_UNSPECIFIED;
- case 1:
- case "GITHUB":
- return VCSType.GITHUB;
- case 2:
- case "GITLAB":
- return VCSType.GITLAB;
- case 3:
- case "BITBUCKET":
- return VCSType.BITBUCKET;
- case 4:
- case "AZURE_DEVOPS":
- return VCSType.AZURE_DEVOPS;
- case -1:
- case "UNRECOGNIZED":
- default:
- return VCSType.UNRECOGNIZED;
- }
-}
-
-export function vCSTypeToJSON(object: VCSType): string {
- switch (object) {
- case VCSType.VCS_TYPE_UNSPECIFIED:
- return "VCS_TYPE_UNSPECIFIED";
- case VCSType.GITHUB:
- return "GITHUB";
- case VCSType.GITLAB:
- return "GITLAB";
- case VCSType.BITBUCKET:
- return "BITBUCKET";
- case VCSType.AZURE_DEVOPS:
- return "AZURE_DEVOPS";
- case VCSType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 ExportFormat {
- FORMAT_UNSPECIFIED = "FORMAT_UNSPECIFIED",
- CSV = "CSV",
- JSON = "JSON",
- SQL = "SQL",
- XLSX = "XLSX",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function exportFormatFromJSON(object: any): ExportFormat {
- switch (object) {
- case 0:
- case "FORMAT_UNSPECIFIED":
- return ExportFormat.FORMAT_UNSPECIFIED;
- case 1:
- case "CSV":
- return ExportFormat.CSV;
- case 2:
- case "JSON":
- return ExportFormat.JSON;
- case 3:
- case "SQL":
- return ExportFormat.SQL;
- case 4:
- case "XLSX":
- return ExportFormat.XLSX;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ExportFormat.UNRECOGNIZED;
- }
-}
-
-export function exportFormatToJSON(object: ExportFormat): string {
- switch (object) {
- case ExportFormat.FORMAT_UNSPECIFIED:
- return "FORMAT_UNSPECIFIED";
- case ExportFormat.CSV:
- return "CSV";
- case ExportFormat.JSON:
- return "JSON";
- case ExportFormat.SQL:
- return "SQL";
- case ExportFormat.XLSX:
- return "XLSX";
- case ExportFormat.UNRECOGNIZED:
- default:
- 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;
- }
-}
-
-/**
- * Position in a text expressed as zero-based line and zero-based column byte
- * offset.
- */
-export interface Position {
- /** Line position in a text (zero-based). */
- line: number;
- /** Column position in a text (zero-based), equivalent to byte offset. */
- column: number;
-}
-
-export interface Range {
- start: number;
- end: number;
-}
-
-function createBasePosition(): Position {
- return { line: 0, column: 0 };
-}
-
-export const Position: MessageFns<Position> = {
- encode(message: Position, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.line !== 0) {
- writer.uint32(8).int32(message.line);
- }
- if (message.column !== 0) {
- writer.uint32(16).int32(message.column);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Position {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePosition();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.line = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.column = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Position {
- return {
- line: isSet(object.line) ? globalThis.Number(object.line) : 0,
- column: isSet(object.column) ? globalThis.Number(object.column) : 0,
- };
- },
-
- toJSON(message: Position): unknown {
- const obj: any = {};
- if (message.line !== 0) {
- obj.line = Math.round(message.line);
- }
- if (message.column !== 0) {
- obj.column = Math.round(message.column);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Position>): Position {
- return Position.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Position>): Position {
- const message = createBasePosition();
- message.line = object.line ?? 0;
- message.column = object.column ?? 0;
- return message;
- },
-};
-
-function createBaseRange(): Range {
- return { start: 0, end: 0 };
-}
-
-export const Range: MessageFns<Range> = {
- encode(message: Range, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.start !== 0) {
- writer.uint32(8).int32(message.start);
- }
- if (message.end !== 0) {
- writer.uint32(16).int32(message.end);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Range {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRange();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.start = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.end = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Range {
- return {
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
- end: isSet(object.end) ? globalThis.Number(object.end) : 0,
- };
- },
-
- toJSON(message: Range): unknown {
- const obj: any = {};
- if (message.start !== 0) {
- obj.start = Math.round(message.start);
- }
- if (message.end !== 0) {
- obj.end = Math.round(message.end);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Range>): Range {
- return Range.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Range>): Range {
- const message = createBaseRange();
- message.start = object.start ?? 0;
- message.end = object.end ?? 0;
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/database_catalog_service.ts b/frontend/src/types/proto/v1/database_catalog_service.ts
deleted file mode 100644
index 84a0a6de70..0000000000
--- a/frontend/src/types/proto/v1/database_catalog_service.ts
+++ /dev/null
@@ -1,1423 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/database_catalog_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetDatabaseCatalogRequest {
- /**
- * The name of the database catalog to retrieve.
- * Format: instances/{instance}/databases/{database}/catalog
- */
- name: string;
-}
-
-export interface UpdateDatabaseCatalogRequest {
- /**
- * The database catalog to update.
- *
- * The catalog's `name` field is used to identify the database catalog to update.
- * Format: instances/{instance}/databases/{database}/catalog
- */
- catalog: DatabaseCatalog | undefined;
-}
-
-export interface DatabaseCatalog {
- /**
- * The name of the database catalog.
- * Format: instances/{instance}/databases/{database}/catalog
- */
- name: string;
- schemas: SchemaCatalog[];
-}
-
-export interface SchemaCatalog {
- name: string;
- tables: TableCatalog[];
-}
-
-export interface TableCatalog {
- name: string;
- columns?: TableCatalog_Columns | undefined;
- objectSchema?: ObjectSchema | undefined;
- classification: string;
-}
-
-export interface TableCatalog_Columns {
- columns: ColumnCatalog[];
-}
-
-export interface ColumnCatalog {
- name: string;
- semanticType: string;
- /** The user labels for a column. */
- labels: { [key: string]: string };
- classification: string;
- objectSchema?: ObjectSchema | undefined;
-}
-
-export interface ColumnCatalog_LabelsEntry {
- key: string;
- value: string;
-}
-
-export interface ObjectSchema {
- type: ObjectSchema_Type;
- structKind?: ObjectSchema_StructKind | undefined;
- arrayKind?: ObjectSchema_ArrayKind | undefined;
- semanticType: string;
-}
-
-export enum ObjectSchema_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- STRING = "STRING",
- NUMBER = "NUMBER",
- BOOLEAN = "BOOLEAN",
- OBJECT = "OBJECT",
- ARRAY = "ARRAY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function objectSchema_TypeFromJSON(object: any): ObjectSchema_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return ObjectSchema_Type.TYPE_UNSPECIFIED;
- case 1:
- case "STRING":
- return ObjectSchema_Type.STRING;
- case 2:
- case "NUMBER":
- return ObjectSchema_Type.NUMBER;
- case 3:
- case "BOOLEAN":
- return ObjectSchema_Type.BOOLEAN;
- case 4:
- case "OBJECT":
- return ObjectSchema_Type.OBJECT;
- case 5:
- case "ARRAY":
- return ObjectSchema_Type.ARRAY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ObjectSchema_Type.UNRECOGNIZED;
- }
-}
-
-export function objectSchema_TypeToJSON(object: ObjectSchema_Type): string {
- switch (object) {
- case ObjectSchema_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case ObjectSchema_Type.STRING:
- return "STRING";
- case ObjectSchema_Type.NUMBER:
- return "NUMBER";
- case ObjectSchema_Type.BOOLEAN:
- return "BOOLEAN";
- case ObjectSchema_Type.OBJECT:
- return "OBJECT";
- case ObjectSchema_Type.ARRAY:
- return "ARRAY";
- case ObjectSchema_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function objectSchema_TypeToNumber(object: ObjectSchema_Type): number {
- switch (object) {
- case ObjectSchema_Type.TYPE_UNSPECIFIED:
- return 0;
- case ObjectSchema_Type.STRING:
- return 1;
- case ObjectSchema_Type.NUMBER:
- return 2;
- case ObjectSchema_Type.BOOLEAN:
- return 3;
- case ObjectSchema_Type.OBJECT:
- return 4;
- case ObjectSchema_Type.ARRAY:
- return 5;
- case ObjectSchema_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface ObjectSchema_StructKind {
- properties: { [key: string]: ObjectSchema };
-}
-
-export interface ObjectSchema_StructKind_PropertiesEntry {
- key: string;
- value: ObjectSchema | undefined;
-}
-
-export interface ObjectSchema_ArrayKind {
- kind: ObjectSchema | undefined;
-}
-
-function createBaseGetDatabaseCatalogRequest(): GetDatabaseCatalogRequest {
- return { name: "" };
-}
-
-export const GetDatabaseCatalogRequest: MessageFns<GetDatabaseCatalogRequest> = {
- encode(message: GetDatabaseCatalogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseCatalogRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetDatabaseCatalogRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetDatabaseCatalogRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetDatabaseCatalogRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetDatabaseCatalogRequest>): GetDatabaseCatalogRequest {
- return GetDatabaseCatalogRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetDatabaseCatalogRequest>): GetDatabaseCatalogRequest {
- const message = createBaseGetDatabaseCatalogRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUpdateDatabaseCatalogRequest(): UpdateDatabaseCatalogRequest {
- return { catalog: undefined };
-}
-
-export const UpdateDatabaseCatalogRequest: MessageFns<UpdateDatabaseCatalogRequest> = {
- encode(message: UpdateDatabaseCatalogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.catalog !== undefined) {
- DatabaseCatalog.encode(message.catalog, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateDatabaseCatalogRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateDatabaseCatalogRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.catalog = DatabaseCatalog.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateDatabaseCatalogRequest {
- return { catalog: isSet(object.catalog) ? DatabaseCatalog.fromJSON(object.catalog) : undefined };
- },
-
- toJSON(message: UpdateDatabaseCatalogRequest): unknown {
- const obj: any = {};
- if (message.catalog !== undefined) {
- obj.catalog = DatabaseCatalog.toJSON(message.catalog);
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateDatabaseCatalogRequest>): UpdateDatabaseCatalogRequest {
- return UpdateDatabaseCatalogRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateDatabaseCatalogRequest>): UpdateDatabaseCatalogRequest {
- const message = createBaseUpdateDatabaseCatalogRequest();
- message.catalog = (object.catalog !== undefined && object.catalog !== null)
- ? DatabaseCatalog.fromPartial(object.catalog)
- : undefined;
- return message;
- },
-};
-
-function createBaseDatabaseCatalog(): DatabaseCatalog {
- return { name: "", schemas: [] };
-}
-
-export const DatabaseCatalog: MessageFns<DatabaseCatalog> = {
- encode(message: DatabaseCatalog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.schemas) {
- SchemaCatalog.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DatabaseCatalog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabaseCatalog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemas.push(SchemaCatalog.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DatabaseCatalog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- schemas: globalThis.Array.isArray(object?.schemas)
- ? object.schemas.map((e: any) => SchemaCatalog.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: DatabaseCatalog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.schemas?.length) {
- obj.schemas = message.schemas.map((e) => SchemaCatalog.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<DatabaseCatalog>): DatabaseCatalog {
- return DatabaseCatalog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DatabaseCatalog>): DatabaseCatalog {
- const message = createBaseDatabaseCatalog();
- message.name = object.name ?? "";
- message.schemas = object.schemas?.map((e) => SchemaCatalog.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseSchemaCatalog(): SchemaCatalog {
- return { name: "", tables: [] };
-}
-
-export const SchemaCatalog: MessageFns<SchemaCatalog> = {
- encode(message: SchemaCatalog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.tables) {
- TableCatalog.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaCatalog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaCatalog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tables.push(TableCatalog.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaCatalog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- tables: globalThis.Array.isArray(object?.tables) ? object.tables.map((e: any) => TableCatalog.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: SchemaCatalog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.tables?.length) {
- obj.tables = message.tables.map((e) => TableCatalog.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaCatalog>): SchemaCatalog {
- return SchemaCatalog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaCatalog>): SchemaCatalog {
- const message = createBaseSchemaCatalog();
- message.name = object.name ?? "";
- message.tables = object.tables?.map((e) => TableCatalog.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTableCatalog(): TableCatalog {
- return { name: "", columns: undefined, objectSchema: undefined, classification: "" };
-}
-
-export const TableCatalog: MessageFns<TableCatalog> = {
- encode(message: TableCatalog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.columns !== undefined) {
- TableCatalog_Columns.encode(message.columns, writer.uint32(18).fork()).join();
- }
- if (message.objectSchema !== undefined) {
- ObjectSchema.encode(message.objectSchema, writer.uint32(26).fork()).join();
- }
- if (message.classification !== "") {
- writer.uint32(34).string(message.classification);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TableCatalog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTableCatalog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.columns = TableCatalog_Columns.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.objectSchema = ObjectSchema.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.classification = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TableCatalog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- columns: isSet(object.columns) ? TableCatalog_Columns.fromJSON(object.columns) : undefined,
- objectSchema: isSet(object.objectSchema) ? ObjectSchema.fromJSON(object.objectSchema) : undefined,
- classification: isSet(object.classification) ? globalThis.String(object.classification) : "",
- };
- },
-
- toJSON(message: TableCatalog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.columns !== undefined) {
- obj.columns = TableCatalog_Columns.toJSON(message.columns);
- }
- if (message.objectSchema !== undefined) {
- obj.objectSchema = ObjectSchema.toJSON(message.objectSchema);
- }
- if (message.classification !== "") {
- obj.classification = message.classification;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TableCatalog>): TableCatalog {
- return TableCatalog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TableCatalog>): TableCatalog {
- const message = createBaseTableCatalog();
- message.name = object.name ?? "";
- message.columns = (object.columns !== undefined && object.columns !== null)
- ? TableCatalog_Columns.fromPartial(object.columns)
- : undefined;
- message.objectSchema = (object.objectSchema !== undefined && object.objectSchema !== null)
- ? ObjectSchema.fromPartial(object.objectSchema)
- : undefined;
- message.classification = object.classification ?? "";
- return message;
- },
-};
-
-function createBaseTableCatalog_Columns(): TableCatalog_Columns {
- return { columns: [] };
-}
-
-export const TableCatalog_Columns: MessageFns<TableCatalog_Columns> = {
- encode(message: TableCatalog_Columns, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.columns) {
- ColumnCatalog.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TableCatalog_Columns {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTableCatalog_Columns();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.columns.push(ColumnCatalog.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TableCatalog_Columns {
- return {
- columns: globalThis.Array.isArray(object?.columns)
- ? object.columns.map((e: any) => ColumnCatalog.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: TableCatalog_Columns): unknown {
- const obj: any = {};
- if (message.columns?.length) {
- obj.columns = message.columns.map((e) => ColumnCatalog.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<TableCatalog_Columns>): TableCatalog_Columns {
- return TableCatalog_Columns.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TableCatalog_Columns>): TableCatalog_Columns {
- const message = createBaseTableCatalog_Columns();
- message.columns = object.columns?.map((e) => ColumnCatalog.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseColumnCatalog(): ColumnCatalog {
- return { name: "", semanticType: "", labels: {}, classification: "", objectSchema: undefined };
-}
-
-export const ColumnCatalog: MessageFns<ColumnCatalog> = {
- encode(message: ColumnCatalog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.semanticType !== "") {
- writer.uint32(18).string(message.semanticType);
- }
- Object.entries(message.labels).forEach(([key, value]) => {
- ColumnCatalog_LabelsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
- });
- if (message.classification !== "") {
- writer.uint32(34).string(message.classification);
- }
- if (message.objectSchema !== undefined) {
- ObjectSchema.encode(message.objectSchema, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ColumnCatalog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseColumnCatalog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.semanticType = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- const entry3 = ColumnCatalog_LabelsEntry.decode(reader, reader.uint32());
- if (entry3.value !== undefined) {
- message.labels[entry3.key] = entry3.value;
- }
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.classification = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.objectSchema = ObjectSchema.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ColumnCatalog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
- labels: isObject(object.labels)
- ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- classification: isSet(object.classification) ? globalThis.String(object.classification) : "",
- objectSchema: isSet(object.objectSchema) ? ObjectSchema.fromJSON(object.objectSchema) : undefined,
- };
- },
-
- toJSON(message: ColumnCatalog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.semanticType !== "") {
- obj.semanticType = message.semanticType;
- }
- if (message.labels) {
- const entries = Object.entries(message.labels);
- if (entries.length > 0) {
- obj.labels = {};
- entries.forEach(([k, v]) => {
- obj.labels[k] = v;
- });
- }
- }
- if (message.classification !== "") {
- obj.classification = message.classification;
- }
- if (message.objectSchema !== undefined) {
- obj.objectSchema = ObjectSchema.toJSON(message.objectSchema);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ColumnCatalog>): ColumnCatalog {
- return ColumnCatalog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ColumnCatalog>): ColumnCatalog {
- const message = createBaseColumnCatalog();
- message.name = object.name ?? "";
- message.semanticType = object.semanticType ?? "";
- message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- message.classification = object.classification ?? "";
- message.objectSchema = (object.objectSchema !== undefined && object.objectSchema !== null)
- ? ObjectSchema.fromPartial(object.objectSchema)
- : undefined;
- return message;
- },
-};
-
-function createBaseColumnCatalog_LabelsEntry(): ColumnCatalog_LabelsEntry {
- return { key: "", value: "" };
-}
-
-export const ColumnCatalog_LabelsEntry: MessageFns<ColumnCatalog_LabelsEntry> = {
- encode(message: ColumnCatalog_LabelsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ColumnCatalog_LabelsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseColumnCatalog_LabelsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ColumnCatalog_LabelsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: ColumnCatalog_LabelsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ColumnCatalog_LabelsEntry>): ColumnCatalog_LabelsEntry {
- return ColumnCatalog_LabelsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ColumnCatalog_LabelsEntry>): ColumnCatalog_LabelsEntry {
- const message = createBaseColumnCatalog_LabelsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseObjectSchema(): ObjectSchema {
- return { type: ObjectSchema_Type.TYPE_UNSPECIFIED, structKind: undefined, arrayKind: undefined, semanticType: "" };
-}
-
-export const ObjectSchema: MessageFns<ObjectSchema> = {
- encode(message: ObjectSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== ObjectSchema_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(objectSchema_TypeToNumber(message.type));
- }
- if (message.structKind !== undefined) {
- ObjectSchema_StructKind.encode(message.structKind, writer.uint32(18).fork()).join();
- }
- if (message.arrayKind !== undefined) {
- ObjectSchema_ArrayKind.encode(message.arrayKind, writer.uint32(26).fork()).join();
- }
- if (message.semanticType !== "") {
- writer.uint32(34).string(message.semanticType);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ObjectSchema {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseObjectSchema();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = objectSchema_TypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.structKind = ObjectSchema_StructKind.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.arrayKind = ObjectSchema_ArrayKind.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.semanticType = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ObjectSchema {
- return {
- type: isSet(object.type) ? objectSchema_TypeFromJSON(object.type) : ObjectSchema_Type.TYPE_UNSPECIFIED,
- structKind: isSet(object.structKind) ? ObjectSchema_StructKind.fromJSON(object.structKind) : undefined,
- arrayKind: isSet(object.arrayKind) ? ObjectSchema_ArrayKind.fromJSON(object.arrayKind) : undefined,
- semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
- };
- },
-
- toJSON(message: ObjectSchema): unknown {
- const obj: any = {};
- if (message.type !== ObjectSchema_Type.TYPE_UNSPECIFIED) {
- obj.type = objectSchema_TypeToJSON(message.type);
- }
- if (message.structKind !== undefined) {
- obj.structKind = ObjectSchema_StructKind.toJSON(message.structKind);
- }
- if (message.arrayKind !== undefined) {
- obj.arrayKind = ObjectSchema_ArrayKind.toJSON(message.arrayKind);
- }
- if (message.semanticType !== "") {
- obj.semanticType = message.semanticType;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ObjectSchema>): ObjectSchema {
- return ObjectSchema.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ObjectSchema>): ObjectSchema {
- const message = createBaseObjectSchema();
- message.type = object.type ?? ObjectSchema_Type.TYPE_UNSPECIFIED;
- message.structKind = (object.structKind !== undefined && object.structKind !== null)
- ? ObjectSchema_StructKind.fromPartial(object.structKind)
- : undefined;
- message.arrayKind = (object.arrayKind !== undefined && object.arrayKind !== null)
- ? ObjectSchema_ArrayKind.fromPartial(object.arrayKind)
- : undefined;
- message.semanticType = object.semanticType ?? "";
- return message;
- },
-};
-
-function createBaseObjectSchema_StructKind(): ObjectSchema_StructKind {
- return { properties: {} };
-}
-
-export const ObjectSchema_StructKind: MessageFns<ObjectSchema_StructKind> = {
- encode(message: ObjectSchema_StructKind, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- Object.entries(message.properties).forEach(([key, value]) => {
- ObjectSchema_StructKind_PropertiesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
- });
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ObjectSchema_StructKind {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseObjectSchema_StructKind();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- const entry1 = ObjectSchema_StructKind_PropertiesEntry.decode(reader, reader.uint32());
- if (entry1.value !== undefined) {
- message.properties[entry1.key] = entry1.value;
- }
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ObjectSchema_StructKind {
- return {
- properties: isObject(object.properties)
- ? Object.entries(object.properties).reduce<{ [key: string]: ObjectSchema }>((acc, [key, value]) => {
- acc[key] = ObjectSchema.fromJSON(value);
- return acc;
- }, {})
- : {},
- };
- },
-
- toJSON(message: ObjectSchema_StructKind): unknown {
- const obj: any = {};
- if (message.properties) {
- const entries = Object.entries(message.properties);
- if (entries.length > 0) {
- obj.properties = {};
- entries.forEach(([k, v]) => {
- obj.properties[k] = ObjectSchema.toJSON(v);
- });
- }
- }
- return obj;
- },
-
- create(base?: DeepPartial<ObjectSchema_StructKind>): ObjectSchema_StructKind {
- return ObjectSchema_StructKind.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ObjectSchema_StructKind>): ObjectSchema_StructKind {
- const message = createBaseObjectSchema_StructKind();
- message.properties = Object.entries(object.properties ?? {}).reduce<{ [key: string]: ObjectSchema }>(
- (acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = ObjectSchema.fromPartial(value);
- }
- return acc;
- },
- {},
- );
- return message;
- },
-};
-
-function createBaseObjectSchema_StructKind_PropertiesEntry(): ObjectSchema_StructKind_PropertiesEntry {
- return { key: "", value: undefined };
-}
-
-export const ObjectSchema_StructKind_PropertiesEntry: MessageFns<ObjectSchema_StructKind_PropertiesEntry> = {
- encode(message: ObjectSchema_StructKind_PropertiesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== undefined) {
- ObjectSchema.encode(message.value, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ObjectSchema_StructKind_PropertiesEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseObjectSchema_StructKind_PropertiesEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = ObjectSchema.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ObjectSchema_StructKind_PropertiesEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? ObjectSchema.fromJSON(object.value) : undefined,
- };
- },
-
- toJSON(message: ObjectSchema_StructKind_PropertiesEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== undefined) {
- obj.value = ObjectSchema.toJSON(message.value);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ObjectSchema_StructKind_PropertiesEntry>): ObjectSchema_StructKind_PropertiesEntry {
- return ObjectSchema_StructKind_PropertiesEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ObjectSchema_StructKind_PropertiesEntry>): ObjectSchema_StructKind_PropertiesEntry {
- const message = createBaseObjectSchema_StructKind_PropertiesEntry();
- message.key = object.key ?? "";
- message.value = (object.value !== undefined && object.value !== null)
- ? ObjectSchema.fromPartial(object.value)
- : undefined;
- return message;
- },
-};
-
-function createBaseObjectSchema_ArrayKind(): ObjectSchema_ArrayKind {
- return { kind: undefined };
-}
-
-export const ObjectSchema_ArrayKind: MessageFns<ObjectSchema_ArrayKind> = {
- encode(message: ObjectSchema_ArrayKind, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.kind !== undefined) {
- ObjectSchema.encode(message.kind, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ObjectSchema_ArrayKind {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseObjectSchema_ArrayKind();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.kind = ObjectSchema.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ObjectSchema_ArrayKind {
- return { kind: isSet(object.kind) ? ObjectSchema.fromJSON(object.kind) : undefined };
- },
-
- toJSON(message: ObjectSchema_ArrayKind): unknown {
- const obj: any = {};
- if (message.kind !== undefined) {
- obj.kind = ObjectSchema.toJSON(message.kind);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ObjectSchema_ArrayKind>): ObjectSchema_ArrayKind {
- return ObjectSchema_ArrayKind.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ObjectSchema_ArrayKind>): ObjectSchema_ArrayKind {
- const message = createBaseObjectSchema_ArrayKind();
- message.kind = (object.kind !== undefined && object.kind !== null)
- ? ObjectSchema.fromPartial(object.kind)
- : undefined;
- return message;
- },
-};
-
-export type DatabaseCatalogServiceDefinition = typeof DatabaseCatalogServiceDefinition;
-export const DatabaseCatalogServiceDefinition = {
- name: "DatabaseCatalogService",
- fullName: "bytebase.v1.DatabaseCatalogService",
- methods: {
- /** Permissions required: bb.databaseCatalogs.get */
- getDatabaseCatalog: {
- name: "GetDatabaseCatalog",
- requestType: GetDatabaseCatalogRequest,
- requestStream: false,
- responseType: DatabaseCatalog,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 67,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 44,
- 18,
- 42,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 99,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databaseCatalogs.update */
- updateDatabaseCatalog: {
- name: "UpdateDatabaseCatalog",
- requestType: UpdateDatabaseCatalogRequest,
- requestStream: false,
- responseType: DatabaseCatalog,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 19,
- 99,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 26,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 67,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 61,
- 58,
- 7,
- 99,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 50,
- 50,
- 47,
- 118,
- 49,
- 47,
- 123,
- 99,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 99,
- 97,
- 116,
- 97,
- 108,
- 111,
- 103,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/database_group_service.ts b/frontend/src/types/proto/v1/database_group_service.ts
deleted file mode 100644
index 52e20d4a11..0000000000
--- a/frontend/src/types/proto/v1/database_group_service.ts
+++ /dev/null
@@ -1,1341 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/database_group_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Expr } from "../google/type/expr";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum DatabaseGroupView {
- /**
- * DATABASE_GROUP_VIEW_UNSPECIFIED - The default / unset value.
- * The API will default to the BASIC view.
- */
- 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 = "DATABASE_GROUP_VIEW_BASIC",
- /** DATABASE_GROUP_VIEW_FULL - Include everything. */
- DATABASE_GROUP_VIEW_FULL = "DATABASE_GROUP_VIEW_FULL",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function databaseGroupViewFromJSON(object: any): DatabaseGroupView {
- switch (object) {
- case 0:
- case "DATABASE_GROUP_VIEW_UNSPECIFIED":
- return DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED;
- case 1:
- case "DATABASE_GROUP_VIEW_BASIC":
- return DatabaseGroupView.DATABASE_GROUP_VIEW_BASIC;
- case 2:
- case "DATABASE_GROUP_VIEW_FULL":
- return DatabaseGroupView.DATABASE_GROUP_VIEW_FULL;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DatabaseGroupView.UNRECOGNIZED;
- }
-}
-
-export function databaseGroupViewToJSON(object: DatabaseGroupView): string {
- switch (object) {
- case DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED:
- return "DATABASE_GROUP_VIEW_UNSPECIFIED";
- case DatabaseGroupView.DATABASE_GROUP_VIEW_BASIC:
- return "DATABASE_GROUP_VIEW_BASIC";
- case DatabaseGroupView.DATABASE_GROUP_VIEW_FULL:
- return "DATABASE_GROUP_VIEW_FULL";
- case DatabaseGroupView.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 interface ListDatabaseGroupsRequest {
- /**
- * The parent resource whose database groups are to be listed.
- * Format: projects/{project}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of database groups to return. The service may return fewer than
- * this value.
- * If unspecified, at most 50 database groups will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListDatabaseGroups` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListDatabaseGroups` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC. */
- view: DatabaseGroupView;
-}
-
-export interface ListDatabaseGroupsResponse {
- /** database_groups is the list of database groups. */
- databaseGroups: DatabaseGroup[];
- /**
- * Not used. A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface GetDatabaseGroupRequest {
- /**
- * The name of the database group to retrieve.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- name: string;
- /** The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC. */
- view: DatabaseGroupView;
-}
-
-export interface CreateDatabaseGroupRequest {
- /**
- * The parent resource where this database group will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The database group to create. */
- databaseGroup:
- | DatabaseGroup
- | undefined;
- /**
- * The ID to use for the database group, which will become the final component of
- * the database group's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- databaseGroupId: string;
- /** If set, validate the create request and preview the full database group response, but do not actually create it. */
- validateOnly: boolean;
-}
-
-export interface UpdateDatabaseGroupRequest {
- /**
- * The database group to update.
- *
- * The database group's `name` field is used to identify the database group to update.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- databaseGroup:
- | DatabaseGroup
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteDatabaseGroupRequest {
- /**
- * The name of the database group to delete.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- name: string;
-}
-
-export interface DatabaseGroup {
- /**
- * The name of the database group.
- * Format: projects/{project}/databaseGroups/{databaseGroup}
- */
- name: string;
- /** The short name used in actual databases specified by users. */
- title: string;
- /**
- * The condition that is associated with this database group.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Support variables:
- * resource.environment_name: the environment resource id. Support "==", "!=", "in [XX]", "!(in [xx])" operations.
- * resource.instance_id: the instance resource id. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
- * resource.database_name: the database name. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
- * All variables should join with "&&" condition.
- *
- * For example:
- * resource.environment_name == "test" && resource.database_name.startsWith("sample_")
- */
- databaseExpr:
- | Expr
- | undefined;
- /** The list of databases that match the database group condition. */
- matchedDatabases: DatabaseGroup_Database[];
- /** The list of databases that match the database group condition. */
- unmatchedDatabases: DatabaseGroup_Database[];
-}
-
-export interface DatabaseGroup_Database {
- /**
- * The resource name of the database.
- * Format: instances/{instance}/databases/{database}
- */
- name: string;
-}
-
-function createBaseListDatabaseGroupsRequest(): ListDatabaseGroupsRequest {
- return { parent: "", pageSize: 0, pageToken: "", view: DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED };
-}
-
-export const ListDatabaseGroupsRequest: MessageFns<ListDatabaseGroupsRequest> = {
- encode(message: ListDatabaseGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
- writer.uint32(32).int32(databaseGroupViewToNumber(message.view));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListDatabaseGroupsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListDatabaseGroupsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.view = databaseGroupViewFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListDatabaseGroupsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- view: isSet(object.view)
- ? databaseGroupViewFromJSON(object.view)
- : DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED,
- };
- },
-
- toJSON(message: ListDatabaseGroupsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
- obj.view = databaseGroupViewToJSON(message.view);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListDatabaseGroupsRequest>): ListDatabaseGroupsRequest {
- return ListDatabaseGroupsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListDatabaseGroupsRequest>): ListDatabaseGroupsRequest {
- const message = createBaseListDatabaseGroupsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.view = object.view ?? DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseListDatabaseGroupsResponse(): ListDatabaseGroupsResponse {
- return { databaseGroups: [], nextPageToken: "" };
-}
-
-export const ListDatabaseGroupsResponse: MessageFns<ListDatabaseGroupsResponse> = {
- encode(message: ListDatabaseGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databaseGroups) {
- DatabaseGroup.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListDatabaseGroupsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListDatabaseGroupsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databaseGroups.push(DatabaseGroup.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListDatabaseGroupsResponse {
- return {
- databaseGroups: globalThis.Array.isArray(object?.databaseGroups)
- ? object.databaseGroups.map((e: any) => DatabaseGroup.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListDatabaseGroupsResponse): unknown {
- const obj: any = {};
- if (message.databaseGroups?.length) {
- obj.databaseGroups = message.databaseGroups.map((e) => DatabaseGroup.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListDatabaseGroupsResponse>): ListDatabaseGroupsResponse {
- return ListDatabaseGroupsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListDatabaseGroupsResponse>): ListDatabaseGroupsResponse {
- const message = createBaseListDatabaseGroupsResponse();
- message.databaseGroups = object.databaseGroups?.map((e) => DatabaseGroup.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseGetDatabaseGroupRequest(): GetDatabaseGroupRequest {
- return { name: "", view: DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED };
-}
-
-export const GetDatabaseGroupRequest: MessageFns<GetDatabaseGroupRequest> = {
- encode(message: GetDatabaseGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
- writer.uint32(16).int32(databaseGroupViewToNumber(message.view));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetDatabaseGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.view = databaseGroupViewFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetDatabaseGroupRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view)
- ? databaseGroupViewFromJSON(object.view)
- : DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED,
- };
- },
-
- toJSON(message: GetDatabaseGroupRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
- obj.view = databaseGroupViewToJSON(message.view);
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetDatabaseGroupRequest>): GetDatabaseGroupRequest {
- return GetDatabaseGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetDatabaseGroupRequest>): GetDatabaseGroupRequest {
- const message = createBaseGetDatabaseGroupRequest();
- message.name = object.name ?? "";
- message.view = object.view ?? DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseCreateDatabaseGroupRequest(): CreateDatabaseGroupRequest {
- return { parent: "", databaseGroup: undefined, databaseGroupId: "", validateOnly: false };
-}
-
-export const CreateDatabaseGroupRequest: MessageFns<CreateDatabaseGroupRequest> = {
- encode(message: CreateDatabaseGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.databaseGroup !== undefined) {
- DatabaseGroup.encode(message.databaseGroup, writer.uint32(18).fork()).join();
- }
- if (message.databaseGroupId !== "") {
- writer.uint32(26).string(message.databaseGroupId);
- }
- if (message.validateOnly !== false) {
- writer.uint32(32).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateDatabaseGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateDatabaseGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.databaseGroup = DatabaseGroup.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.databaseGroupId = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateDatabaseGroupRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- databaseGroup: isSet(object.databaseGroup) ? DatabaseGroup.fromJSON(object.databaseGroup) : undefined,
- databaseGroupId: isSet(object.databaseGroupId) ? globalThis.String(object.databaseGroupId) : "",
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: CreateDatabaseGroupRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.databaseGroup !== undefined) {
- obj.databaseGroup = DatabaseGroup.toJSON(message.databaseGroup);
- }
- if (message.databaseGroupId !== "") {
- obj.databaseGroupId = message.databaseGroupId;
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateDatabaseGroupRequest>): CreateDatabaseGroupRequest {
- return CreateDatabaseGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateDatabaseGroupRequest>): CreateDatabaseGroupRequest {
- const message = createBaseCreateDatabaseGroupRequest();
- message.parent = object.parent ?? "";
- message.databaseGroup = (object.databaseGroup !== undefined && object.databaseGroup !== null)
- ? DatabaseGroup.fromPartial(object.databaseGroup)
- : undefined;
- message.databaseGroupId = object.databaseGroupId ?? "";
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBaseUpdateDatabaseGroupRequest(): UpdateDatabaseGroupRequest {
- return { databaseGroup: undefined, updateMask: undefined };
-}
-
-export const UpdateDatabaseGroupRequest: MessageFns<UpdateDatabaseGroupRequest> = {
- encode(message: UpdateDatabaseGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.databaseGroup !== undefined) {
- DatabaseGroup.encode(message.databaseGroup, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateDatabaseGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateDatabaseGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databaseGroup = DatabaseGroup.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateDatabaseGroupRequest {
- return {
- databaseGroup: isSet(object.databaseGroup) ? DatabaseGroup.fromJSON(object.databaseGroup) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateDatabaseGroupRequest): unknown {
- const obj: any = {};
- if (message.databaseGroup !== undefined) {
- obj.databaseGroup = DatabaseGroup.toJSON(message.databaseGroup);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateDatabaseGroupRequest>): UpdateDatabaseGroupRequest {
- return UpdateDatabaseGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateDatabaseGroupRequest>): UpdateDatabaseGroupRequest {
- const message = createBaseUpdateDatabaseGroupRequest();
- message.databaseGroup = (object.databaseGroup !== undefined && object.databaseGroup !== null)
- ? DatabaseGroup.fromPartial(object.databaseGroup)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteDatabaseGroupRequest(): DeleteDatabaseGroupRequest {
- return { name: "" };
-}
-
-export const DeleteDatabaseGroupRequest: MessageFns<DeleteDatabaseGroupRequest> = {
- encode(message: DeleteDatabaseGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteDatabaseGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteDatabaseGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteDatabaseGroupRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteDatabaseGroupRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteDatabaseGroupRequest>): DeleteDatabaseGroupRequest {
- return DeleteDatabaseGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteDatabaseGroupRequest>): DeleteDatabaseGroupRequest {
- const message = createBaseDeleteDatabaseGroupRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseDatabaseGroup(): DatabaseGroup {
- return { name: "", title: "", databaseExpr: undefined, matchedDatabases: [], unmatchedDatabases: [] };
-}
-
-export const DatabaseGroup: MessageFns<DatabaseGroup> = {
- encode(message: DatabaseGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.databaseExpr !== undefined) {
- Expr.encode(message.databaseExpr, writer.uint32(26).fork()).join();
- }
- for (const v of message.matchedDatabases) {
- DatabaseGroup_Database.encode(v!, writer.uint32(34).fork()).join();
- }
- for (const v of message.unmatchedDatabases) {
- DatabaseGroup_Database.encode(v!, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DatabaseGroup {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabaseGroup();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.databaseExpr = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.matchedDatabases.push(DatabaseGroup_Database.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.unmatchedDatabases.push(DatabaseGroup_Database.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DatabaseGroup {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- databaseExpr: isSet(object.databaseExpr) ? Expr.fromJSON(object.databaseExpr) : undefined,
- matchedDatabases: globalThis.Array.isArray(object?.matchedDatabases)
- ? object.matchedDatabases.map((e: any) => DatabaseGroup_Database.fromJSON(e))
- : [],
- unmatchedDatabases: globalThis.Array.isArray(object?.unmatchedDatabases)
- ? object.unmatchedDatabases.map((e: any) => DatabaseGroup_Database.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: DatabaseGroup): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.databaseExpr !== undefined) {
- obj.databaseExpr = Expr.toJSON(message.databaseExpr);
- }
- if (message.matchedDatabases?.length) {
- obj.matchedDatabases = message.matchedDatabases.map((e) => DatabaseGroup_Database.toJSON(e));
- }
- if (message.unmatchedDatabases?.length) {
- obj.unmatchedDatabases = message.unmatchedDatabases.map((e) => DatabaseGroup_Database.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<DatabaseGroup>): DatabaseGroup {
- return DatabaseGroup.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DatabaseGroup>): DatabaseGroup {
- const message = createBaseDatabaseGroup();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.databaseExpr = (object.databaseExpr !== undefined && object.databaseExpr !== null)
- ? Expr.fromPartial(object.databaseExpr)
- : undefined;
- message.matchedDatabases = object.matchedDatabases?.map((e) => DatabaseGroup_Database.fromPartial(e)) || [];
- message.unmatchedDatabases = object.unmatchedDatabases?.map((e) => DatabaseGroup_Database.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseDatabaseGroup_Database(): DatabaseGroup_Database {
- return { name: "" };
-}
-
-export const DatabaseGroup_Database: MessageFns<DatabaseGroup_Database> = {
- encode(message: DatabaseGroup_Database, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DatabaseGroup_Database {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabaseGroup_Database();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DatabaseGroup_Database {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DatabaseGroup_Database): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DatabaseGroup_Database>): DatabaseGroup_Database {
- return DatabaseGroup_Database.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DatabaseGroup_Database>): DatabaseGroup_Database {
- const message = createBaseDatabaseGroup_Database();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-export type DatabaseGroupServiceDefinition = typeof DatabaseGroupServiceDefinition;
-export const DatabaseGroupServiceDefinition = {
- name: "DatabaseGroupService",
- fullName: "bytebase.v1.DatabaseGroupService",
- methods: {
- /** Permissions required: bb.projects.get */
- listDatabaseGroups: {
- name: "ListDatabaseGroups",
- requestType: ListDatabaseGroupsRequest,
- requestStream: false,
- responseType: ListDatabaseGroupsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 18,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.get */
- getDatabaseGroup: {
- name: "GetDatabaseGroup",
- requestType: GetDatabaseGroupRequest,
- requestStream: false,
- responseType: DatabaseGroup,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 18,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- createDatabaseGroup: {
- name: "CreateDatabaseGroup",
- requestType: CreateDatabaseGroupRequest,
- requestStream: false,
- responseType: DatabaseGroup,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 20,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 44,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- ]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 56,
- 58,
- 14,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 95,
- 103,
- 114,
- 111,
- 117,
- 112,
- 34,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- updateDatabaseGroup: {
- name: "UpdateDatabaseGroup",
- requestType: UpdateDatabaseGroupRequest,
- requestStream: false,
- responseType: DatabaseGroup,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 26,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 95,
- 103,
- 114,
- 111,
- 117,
- 112,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 71,
- 58,
- 14,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 95,
- 103,
- 114,
- 111,
- 117,
- 112,
- 50,
- 53,
- 47,
- 118,
- 49,
- 47,
- 123,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 95,
- 103,
- 114,
- 111,
- 117,
- 112,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- deleteDatabaseGroup: {
- name: "DeleteDatabaseGroup",
- requestType: DeleteDatabaseGroupRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 42,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 71,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
deleted file mode 100644
index 5bf50b73d9..0000000000
--- a/frontend/src/types/proto/v1/database_service.ts
+++ /dev/null
@@ -1,11162 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/database_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { Range, State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
-import { InstanceResource } from "./instance_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum ChangelogView {
- /**
- * CHANGELOG_VIEW_UNSPECIFIED - The default / unset value.
- * The API will default to the BASIC view.
- */
- CHANGELOG_VIEW_UNSPECIFIED = "CHANGELOG_VIEW_UNSPECIFIED",
- CHANGELOG_VIEW_BASIC = "CHANGELOG_VIEW_BASIC",
- CHANGELOG_VIEW_FULL = "CHANGELOG_VIEW_FULL",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function changelogViewFromJSON(object: any): ChangelogView {
- switch (object) {
- case 0:
- case "CHANGELOG_VIEW_UNSPECIFIED":
- return ChangelogView.CHANGELOG_VIEW_UNSPECIFIED;
- case 1:
- case "CHANGELOG_VIEW_BASIC":
- return ChangelogView.CHANGELOG_VIEW_BASIC;
- case 2:
- case "CHANGELOG_VIEW_FULL":
- return ChangelogView.CHANGELOG_VIEW_FULL;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ChangelogView.UNRECOGNIZED;
- }
-}
-
-export function changelogViewToJSON(object: ChangelogView): string {
- switch (object) {
- case ChangelogView.CHANGELOG_VIEW_UNSPECIFIED:
- return "CHANGELOG_VIEW_UNSPECIFIED";
- case ChangelogView.CHANGELOG_VIEW_BASIC:
- return "CHANGELOG_VIEW_BASIC";
- case ChangelogView.CHANGELOG_VIEW_FULL:
- return "CHANGELOG_VIEW_FULL";
- case ChangelogView.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function changelogViewToNumber(object: ChangelogView): number {
- switch (object) {
- case ChangelogView.CHANGELOG_VIEW_UNSPECIFIED:
- return 0;
- case ChangelogView.CHANGELOG_VIEW_BASIC:
- return 1;
- case ChangelogView.CHANGELOG_VIEW_FULL:
- return 2;
- case ChangelogView.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GetDatabaseRequest {
- /**
- * The name of the database to retrieve.
- * Format: instances/{instance}/databases/{database}
- */
- name: string;
-}
-
-export interface BatchGetDatabasesRequest {
- /**
- * The parent resource shared by all databases being retrieved.
- * - projects/{project}: batch get databases in a project;
- * - instances/{instances}: batch get databases in a instance;
- * Use "-" as wildcard to batch get databases across parent.
- */
- parent: string;
- /** The list of database names to retrieve. */
- names: string[];
-}
-
-export interface BatchGetDatabasesResponse {
- /** The databases from the specified request. */
- databases: Database[];
-}
-
-export interface ListDatabasesRequest {
- /**
- * - projects/{project}: list databases in a project, require "bb.projects.get" permission.
- * - workspaces/-: list databases in the workspace, require "bb.databases.list" permission.
- * - instances/{instances}: list databases in a instance, require "bb.instances.get" permission
- */
- parent: string;
- /**
- * The maximum number of databases to return. The service may return fewer
- * than this value.
- * If unspecified, at most 10 databases will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListDatabases` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListDatabases` must
- * match the call that provided the page token.
- */
- pageToken: string;
- /**
- * Filter is used to filter databases returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - environment: the environment full name in "environments/{id}" format, support "==" operator.
- * - name: the database name, support ".matches()" operator.
- * - project: the project full name in "projects/{id}" format, support "==" operator.
- * - instance: the instance full name in "instances/{id}" format, support "==" operator.
- * - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- * - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
- * - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
- * - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
- * - table: filter by the database table, support "==" and ".matches()" operator.
- *
- * For example:
- * environment == "environments/{environment resource id}"
- * project == "projects/{project resource id}"
- * instance == "instances/{instance resource id}"
- * name.matches("database name")
- * engine == "MYSQL"
- * engine in ["MYSQL", "POSTGRES"]
- * !(engine in ["MYSQL", "POSTGRES"])
- * label == "region:asia"
- * label == "tenant:asia,europe"
- * label == "region:asia" && label == "tenant:bytebase"
- * exclude_unassigned == true
- * drifted == true
- * table == "sample"
- * table.matches("sam")
- *
- * You can combine filter conditions like:
- * environment == "environments/prod" && name.matches("employee")
- */
- filter: string;
- /** Show deleted database if specified. */
- showDeleted: boolean;
-}
-
-export interface ListDatabasesResponse {
- /** The databases from the specified request. */
- databases: Database[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateDatabaseRequest {
- /**
- * The database to update.
- *
- * The database's `name` field is used to identify the database to update.
- * Format: instances/{instance}/databases/{database}
- */
- database:
- | Database
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface BatchUpdateDatabasesRequest {
- /**
- * The parent resource shared by all databases being updated.
- * Format: instances/{instance}
- * If the operation spans parents, a dash (-) may be accepted as a wildcard.
- * We only support updating the project of databases for now.
- */
- parent: string;
- /**
- * The request message specifying the resources to update.
- * A maximum of 1000 databases can be modified in a batch.
- */
- requests: UpdateDatabaseRequest[];
-}
-
-export interface BatchUpdateDatabasesResponse {
- /** Databases updated. */
- databases: Database[];
-}
-
-export interface BatchSyncDatabasesRequest {
- /**
- * The parent resource shared by all databases being updated.
- * Format: instances/{instance}
- * If the operation spans parents, a dash (-) may be accepted as a wildcard.
- */
- parent: string;
- /** The list of database names to sync. */
- names: string[];
-}
-
-export interface BatchSyncDatabasesResponse {
-}
-
-export interface SyncDatabaseRequest {
- /**
- * The name of the database to sync.
- * Format: instances/{instance}/databases/{database}
- */
- name: string;
-}
-
-export interface SyncDatabaseResponse {
-}
-
-export interface GetDatabaseMetadataRequest {
- /**
- * The name of the database to retrieve metadata.
- * Format: instances/{instance}/databases/{database}/metadata
- */
- name: string;
- /**
- * Filter is used to filter databases returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - schema: the schema name, support "==" operator.
- * - table: the table name, support "==" operator.
- *
- * For example:
- * schema == "schema-a"
- * table == "table-a"
- * schema == "schema-a" && table == "table-a"
- * The filter used for a specific schema object such as
- * "schemas/schema-a/tables/table-a".
- * The column masking level will only be returned when a table filter is used.
- */
- filter: string;
-}
-
-export interface GetDatabaseSchemaRequest {
- /**
- * The name of the database to retrieve schema.
- * Format: instances/{instance}/databases/{database}/schema
- */
- name: string;
- /** Format the schema dump into SDL format. */
- sdlFormat: boolean;
-}
-
-export interface DiffSchemaRequest {
- /**
- * The name of the database or changelog.
- * Format:
- * database: instances/{instance}/databases/{database}
- * changelog: instances/{instance}/databases/{database}/changelogs/{changelog}
- */
- name: string;
- /** The target schema. */
- schema?:
- | string
- | undefined;
- /**
- * The resource name of the changelog
- * Format:
- * instances/{instance}/databases/{database}/changelogs/{changelog}
- */
- changelog?:
- | string
- | undefined;
- /** Format the schema dump into SDL format. */
- sdlFormat: boolean;
-}
-
-export interface DiffSchemaResponse {
- diff: string;
-}
-
-export interface Database {
- /**
- * The name of the database.
- * Format: instances/{instance}/databases/{database}
- * {database} is the database name in the instance.
- */
- name: string;
- /** The existence of a database. */
- state: State;
- /** The latest synchronization time. */
- successfulSyncTime:
- | Timestamp
- | undefined;
- /**
- * The project for a database.
- * Format: projects/{project}
- */
- project: string;
- /** The version of database schema. */
- schemaVersion: string;
- /**
- * The environment resource.
- * Format: environments/prod where prod is the environment resource ID.
- */
- environment: string;
- /**
- * The effective environment based on environment tag above and environment
- * tag on the instance. Inheritance follows
- * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
- */
- effectiveEnvironment: string;
- /** Labels will be used for deployment and policy control. */
- labels: { [key: string]: string };
- /** The instance resource. */
- instanceResource:
- | InstanceResource
- | undefined;
- /** The database is available for DML prior backup. */
- backupAvailable: boolean;
- /** The schema is drifted from the source of truth. */
- drifted: boolean;
-}
-
-export interface Database_LabelsEntry {
- key: string;
- value: string;
-}
-
-/** DatabaseMetadata is the metadata for databases. */
-export interface DatabaseMetadata {
- /**
- * The database metadata name.
- *
- * Format: instances/{instance}/databases/{database}/metadata
- */
- name: string;
- /** The schemas is the list of schemas in a database. */
- schemas: SchemaMetadata[];
- /** The character_set is the character set of a database. */
- characterSet: string;
- /** The collation is the collation of a database. */
- collation: string;
- /** The extensions is the list of extensions in a database. */
- extensions: ExtensionMetadata[];
- owner: string;
- /** The search_path is the search path of a PostgreSQL database. */
- searchPath: string;
-}
-
-/**
- * SchemaMetadata is the metadata for schemas.
- * This is the concept of schema in Postgres, but it's a no-op for MySQL.
- */
-export interface SchemaMetadata {
- /**
- * The name is the schema name.
- * It is an empty string for databases without such concept such as MySQL.
- */
- name: string;
- /** The tables is the list of tables in a schema. */
- tables: TableMetadata[];
- /** The external_tables is the list of external tables in a schema. */
- externalTables: ExternalTableMetadata[];
- /** The views is the list of views in a schema. */
- views: ViewMetadata[];
- /** The functions is the list of functions in a schema. */
- functions: FunctionMetadata[];
- /** The procedures is the list of procedures in a schema. */
- procedures: ProcedureMetadata[];
- /**
- * The streams is the list of streams in a schema, currently, only used for
- * Snowflake.
- */
- streams: StreamMetadata[];
- /**
- * The routines is the list of routines in a schema, currently, only used for
- * Snowflake.
- */
- tasks: TaskMetadata[];
- /** The materialized_views is the list of materialized views in a schema. */
- materializedViews: MaterializedViewMetadata[];
- /** The packages is the list of packages in a schema. */
- packages: PackageMetadata[];
- owner: string;
- /** The sequences is the list of sequences in a schema, sorted by name. */
- sequences: SequenceMetadata[];
- events: EventMetadata[];
- enumTypes: EnumTypeMetadata[];
- skipDump: boolean;
- /** The comment is the comment of a schema. */
- comment: string;
-}
-
-export interface EnumTypeMetadata {
- /** The name of a type. */
- name: string;
- /** The enum values of a type. */
- values: string[];
- comment: string;
- skipDump: boolean;
-}
-
-export interface EventMetadata {
- /** The name of the event. */
- name: string;
- /** The schedule of the event. */
- definition: string;
- /** The time zone of the event. */
- timeZone: string;
- sqlMode: string;
- characterSetClient: string;
- collationConnection: string;
- /** The comment is the comment of an event. */
- comment: string;
-}
-
-export interface SequenceMetadata {
- /** The name of a sequence. */
- name: string;
- /** The data type of a sequence. */
- dataType: string;
- /** The start value of a sequence. */
- start: string;
- /** The minimum value of a sequence. */
- minValue: string;
- /** The maximum value of a sequence. */
- maxValue: string;
- /** Increment value of a sequence. */
- increment: string;
- /** Cycle is whether the sequence cycles. */
- cycle: boolean;
- /** Cache size of a sequence. */
- cacheSize: string;
- /** Last value of a sequence. */
- lastValue: string;
- /** The owner table of the sequence. */
- ownerTable: string;
- /** The owner column of the sequence. */
- ownerColumn: string;
- comment: string;
- skipDump: boolean;
-}
-
-export interface TriggerMetadata {
- /** The name is the name of the trigger. */
- name: string;
- /**
- * The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
- * TRUNCATE.
- */
- event: string;
- /** The timing is the timing of the trigger, such as BEFORE, AFTER. */
- timing: string;
- /** The body is the body of the trigger. */
- body: string;
- sqlMode: string;
- characterSetClient: string;
- collationConnection: string;
- comment: string;
- skipDump: boolean;
-}
-
-export interface ExternalTableMetadata {
- /** The name is the name of a external table. */
- name: string;
- /** The external_server_name is the name of the external server. */
- externalServerName: string;
- /** The external_database_name is the name of the external database. */
- externalDatabaseName: string;
- /** The columns is the ordered list of columns in a foreign table. */
- columns: ColumnMetadata[];
-}
-
-/** TableMetadata is the metadata for tables. */
-export interface TableMetadata {
- /** The name is the name of a table. */
- name: string;
- /** The columns is the ordered list of columns in a table. */
- columns: ColumnMetadata[];
- /** The indexes is the list of indexes in a table. */
- indexes: IndexMetadata[];
- /** The engine is the engine of a table. */
- engine: string;
- /** The collation is the collation of a table. */
- collation: string;
- /** The character set of table. */
- charset: string;
- /** The row_count is the estimated number of rows of a table. */
- rowCount: Long;
- /** The data_size is the estimated data size of a table. */
- dataSize: Long;
- /** The index_size is the estimated index size of a table. */
- indexSize: Long;
- /** The data_free is the estimated free data size of a table. */
- dataFree: Long;
- /** The create_options is the create option of a table. */
- createOptions: string;
- /**
- * The comment is the comment of a table.
- * classification and user_comment is parsed from the comment.
- */
- comment: string;
- /** The user_comment is the user comment of a table parsed from the comment. */
- userComment: string;
- /** The foreign_keys is the list of foreign keys in a table. */
- foreignKeys: ForeignKeyMetadata[];
- /** The partitions is the list of partitions in a table. */
- partitions: TablePartitionMetadata[];
- /** The check_constraints is the list of check constraints in a table. */
- checkConstraints: CheckConstraintMetadata[];
- owner: string;
- /**
- * The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
- * Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
- */
- sortingKeys: string[];
- triggers: TriggerMetadata[];
- skipDump: boolean;
- /** https://docs.pingcap.com/tidb/stable/information-schema-tables/ */
- shardingInfo: string;
- /**
- * https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
- * CLUSTERED or NONCLUSTERED.
- */
- primaryKeyType: string;
-}
-
-/** CheckConstraintMetadata is the metadata for check constraints. */
-export interface CheckConstraintMetadata {
- /** The name is the name of a check constraint. */
- name: string;
- /** The expression is the expression of a check constraint. */
- expression: string;
-}
-
-/** TablePartitionMetadata is the metadata for table partitions. */
-export interface TablePartitionMetadata {
- /** The name is the name of a table partition. */
- name: string;
- /** The type of a table partition. */
- type: TablePartitionMetadata_Type;
- /**
- * The expression is the expression of a table partition.
- * For PostgreSQL, the expression is the text of {FOR VALUES
- * partition_bound_spec}, see
- * https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
- * the expression is the `expr` or `column_list` of the following syntax.
- * PARTITION BY
- * { [LINEAR] HASH(expr)
- * | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
- * | RANGE{(expr) | COLUMNS(column_list)}
- * | LIST{(expr) | COLUMNS(column_list)} }.
- */
- expression: string;
- /**
- * The value is the value of a table partition.
- * For MySQL, the value is for RANGE and LIST partition types,
- * - For a RANGE partition, it contains the value set in the partition's
- * VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
- * - For a LIST partition, this column contains the values defined in the
- * partition's VALUES IN clause, which is a list of comma-separated integer
- * values.
- * - For others, it's an empty string.
- */
- value: string;
- /**
- * The use_default is whether the users use the default partition, it stores
- * the different value for different database engines. For MySQL, it's [INT]
- * type, 0 means not use default partition, otherwise, it's equals to number
- * in syntax [SUB]PARTITION {number}.
- */
- useDefault: string;
- /** The subpartitions is the list of subpartitions in a table partition. */
- subpartitions: TablePartitionMetadata[];
- indexes: IndexMetadata[];
- checkConstraints: CheckConstraintMetadata[];
-}
-
-/**
- * Type is the type of a table partition, some database engines may not
- * support all types. Only avilable for the following database engines now:
- * MySQL: RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, LINEAR HASH, KEY,
- * LINEAR_KEY
- * (https://dev.mysql.com/doc/refman/8.0/en/partitioning-types.html) TiDB:
- * RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, KEY PostgreSQL: RANGE,
- * LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
- */
-export enum TablePartitionMetadata_Type {
- 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 {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return TablePartitionMetadata_Type.TYPE_UNSPECIFIED;
- case 1:
- case "RANGE":
- return TablePartitionMetadata_Type.RANGE;
- case 2:
- case "RANGE_COLUMNS":
- return TablePartitionMetadata_Type.RANGE_COLUMNS;
- case 3:
- case "LIST":
- return TablePartitionMetadata_Type.LIST;
- case 4:
- case "LIST_COLUMNS":
- return TablePartitionMetadata_Type.LIST_COLUMNS;
- case 5:
- case "HASH":
- return TablePartitionMetadata_Type.HASH;
- case 6:
- case "LINEAR_HASH":
- return TablePartitionMetadata_Type.LINEAR_HASH;
- case 7:
- case "KEY":
- return TablePartitionMetadata_Type.KEY;
- case 8:
- case "LINEAR_KEY":
- return TablePartitionMetadata_Type.LINEAR_KEY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TablePartitionMetadata_Type.UNRECOGNIZED;
- }
-}
-
-export function tablePartitionMetadata_TypeToJSON(object: TablePartitionMetadata_Type): string {
- switch (object) {
- case TablePartitionMetadata_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case TablePartitionMetadata_Type.RANGE:
- return "RANGE";
- case TablePartitionMetadata_Type.RANGE_COLUMNS:
- return "RANGE_COLUMNS";
- case TablePartitionMetadata_Type.LIST:
- return "LIST";
- case TablePartitionMetadata_Type.LIST_COLUMNS:
- return "LIST_COLUMNS";
- case TablePartitionMetadata_Type.HASH:
- return "HASH";
- case TablePartitionMetadata_Type.LINEAR_HASH:
- return "LINEAR_HASH";
- case TablePartitionMetadata_Type.KEY:
- return "KEY";
- case TablePartitionMetadata_Type.LINEAR_KEY:
- return "LINEAR_KEY";
- case TablePartitionMetadata_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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. */
- name: string;
- /** The position is the position in columns. */
- position: number;
- hasDefault: boolean;
- /** The default value of column. */
- defaultNull: boolean;
- defaultString: string;
- defaultExpression: string;
- /**
- * Oracle specific metadata.
- * The default_on_null is the default on null of a column.
- */
- defaultOnNull: boolean;
- /**
- * The on_update is the on update action of a column.
- * For MySQL like databases, it's only supported for TIMESTAMP columns with
- * CURRENT_TIMESTAMP as on update value.
- */
- onUpdate: string;
- /** The nullable is the nullable of a column. */
- nullable: boolean;
- /** The type is the type of a column. */
- type: string;
- /** The character_set is the character_set of a column. */
- characterSet: string;
- /** The collation is the collation of a column. */
- collation: string;
- /**
- * The comment is the comment of a column.
- * classification and user_comment is parsed from the comment.
- */
- comment: string;
- /** The user_comment is the user comment of a column parsed from the comment. */
- userComment: string;
- /** The generation is the generation of a column. */
- generation: GenerationMetadata | undefined;
- isIdentity: boolean;
- /** The identity_generation is for identity columns, PG only. */
- identityGeneration: ColumnMetadata_IdentityGeneration;
- /** The identity_seed is for identity columns, MSSQL only. */
- identitySeed: Long;
- /** The identity_increment is for identity columns, MSSQL only. */
- identityIncrement: Long;
- /**
- * The default_constraint_name is the name of the default constraint, MSSQL only.
- * In MSSQL, default values are implemented as named constraints. When modifying or
- * dropping a column's default value, you must reference the constraint by name.
- * This field stores the actual constraint name from the database.
- *
- * Example: A column definition like:
- * CREATE TABLE employees (
- * status NVARCHAR(20) DEFAULT 'active'
- * )
- *
- * Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
- * or a user-defined name if specified:
- * ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status
- *
- * To modify the default, you must first drop the existing constraint by name:
- * ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
- * ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status
- *
- * This field is populated when syncing from the database. When empty (e.g., when parsing
- * from SQL files), the system cannot automatically drop the constraint.
- */
- defaultConstraintName: string;
-}
-
-export enum ColumnMetadata_IdentityGeneration {
- IDENTITY_GENERATION_UNSPECIFIED = "IDENTITY_GENERATION_UNSPECIFIED",
- ALWAYS = "ALWAYS",
- BY_DEFAULT = "BY_DEFAULT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function columnMetadata_IdentityGenerationFromJSON(object: any): ColumnMetadata_IdentityGeneration {
- switch (object) {
- case 0:
- case "IDENTITY_GENERATION_UNSPECIFIED":
- return ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED;
- case 1:
- case "ALWAYS":
- return ColumnMetadata_IdentityGeneration.ALWAYS;
- case 2:
- case "BY_DEFAULT":
- return ColumnMetadata_IdentityGeneration.BY_DEFAULT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ColumnMetadata_IdentityGeneration.UNRECOGNIZED;
- }
-}
-
-export function columnMetadata_IdentityGenerationToJSON(object: ColumnMetadata_IdentityGeneration): string {
- switch (object) {
- case ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED:
- return "IDENTITY_GENERATION_UNSPECIFIED";
- case ColumnMetadata_IdentityGeneration.ALWAYS:
- return "ALWAYS";
- case ColumnMetadata_IdentityGeneration.BY_DEFAULT:
- return "BY_DEFAULT";
- case ColumnMetadata_IdentityGeneration.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function columnMetadata_IdentityGenerationToNumber(object: ColumnMetadata_IdentityGeneration): number {
- switch (object) {
- case ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED:
- return 0;
- case ColumnMetadata_IdentityGeneration.ALWAYS:
- return 1;
- case ColumnMetadata_IdentityGeneration.BY_DEFAULT:
- return 2;
- case ColumnMetadata_IdentityGeneration.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GenerationMetadata {
- type: GenerationMetadata_Type;
- expression: string;
-}
-
-export enum GenerationMetadata_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- TYPE_VIRTUAL = "TYPE_VIRTUAL",
- TYPE_STORED = "TYPE_STORED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function generationMetadata_TypeFromJSON(object: any): GenerationMetadata_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return GenerationMetadata_Type.TYPE_UNSPECIFIED;
- case 1:
- case "TYPE_VIRTUAL":
- return GenerationMetadata_Type.TYPE_VIRTUAL;
- case 2:
- case "TYPE_STORED":
- return GenerationMetadata_Type.TYPE_STORED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return GenerationMetadata_Type.UNRECOGNIZED;
- }
-}
-
-export function generationMetadata_TypeToJSON(object: GenerationMetadata_Type): string {
- switch (object) {
- case GenerationMetadata_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case GenerationMetadata_Type.TYPE_VIRTUAL:
- return "TYPE_VIRTUAL";
- case GenerationMetadata_Type.TYPE_STORED:
- return "TYPE_STORED";
- case GenerationMetadata_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function generationMetadata_TypeToNumber(object: GenerationMetadata_Type): number {
- switch (object) {
- case GenerationMetadata_Type.TYPE_UNSPECIFIED:
- return 0;
- case GenerationMetadata_Type.TYPE_VIRTUAL:
- return 1;
- case GenerationMetadata_Type.TYPE_STORED:
- return 2;
- case GenerationMetadata_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/** ViewMetadata is the metadata for views. */
-export interface ViewMetadata {
- /** The name is the name of a view. */
- name: string;
- /** The definition is the definition of a view. */
- definition: string;
- /** The comment is the comment of a view. */
- comment: string;
- /** The dependency_columns is the list of dependency columns of a view. */
- dependencyColumns: DependencyColumn[];
- /** The columns is the ordered list of columns in a table. */
- columns: ColumnMetadata[];
- /** The triggers is the list of triggers in a view. */
- triggers: TriggerMetadata[];
- skipDump: boolean;
-}
-
-/** DependencyColumn is the metadata for dependency columns. */
-export interface DependencyColumn {
- /** The schema is the schema of a reference column. */
- schema: string;
- /** The table is the table of a reference column. */
- table: string;
- /** The column is the name of a reference column. */
- column: string;
-}
-
-/** MaterializedViewMetadata is the metadata for materialized views. */
-export interface MaterializedViewMetadata {
- /** The name is the name of a materialized view. */
- name: string;
- /** The definition is the definition of a materialized view. */
- definition: string;
- /** The comment is the comment of a materialized view. */
- comment: string;
- /**
- * The dependency_columns is the list of dependency columns of a materialized
- * view.
- */
- dependencyColumns: DependencyColumn[];
- /** The columns is the ordered list of columns in a table. */
- triggers: TriggerMetadata[];
- /** The indexes is the list of indexes in a table. */
- indexes: IndexMetadata[];
- skipDump: boolean;
-}
-
-export interface DependencyTable {
- /** The schema is the schema of a reference table. */
- schema: string;
- /** The table is the name of a reference table. */
- table: string;
-}
-
-/** FunctionMetadata is the metadata for functions. */
-export interface FunctionMetadata {
- /** The name is the name of a function. */
- name: string;
- /** The definition is the definition of a function. */
- definition: string;
- /**
- * The signature is the name with the number and type of input arguments the
- * function takes.
- */
- signature: string;
- /** MySQL specific metadata. */
- characterSetClient: string;
- collationConnection: string;
- databaseCollation: string;
- sqlMode: string;
- comment: string;
- /**
- * The dependency_tables is the list of dependency tables of a function.
- * For PostgreSQL, it's the list of tables that the function depends on the return type definition.
- */
- dependencyTables: DependencyTable[];
- skipDump: boolean;
-}
-
-/** ProcedureMetadata is the metadata for procedures. */
-export interface ProcedureMetadata {
- /** The name is the name of a procedure. */
- name: string;
- /** The definition is the definition of a procedure. */
- definition: string;
- /**
- * The signature is the name with the number and type of input arguments the
- * function takes.
- */
- signature: string;
- /** MySQL specific metadata. */
- characterSetClient: string;
- collationConnection: string;
- databaseCollation: string;
- sqlMode: string;
- /** The comment is the comment of a procedure. */
- comment: string;
- skipDump: boolean;
-}
-
-/** PackageMetadata is the metadata for packages. */
-export interface PackageMetadata {
- /** The name is the name of a package. */
- name: string;
- /** The definition is the definition of a package. */
- definition: string;
-}
-
-export interface TaskMetadata {
- /** The name is the name of a task. */
- name: string;
- /**
- * The id is the snowflake-generated id of a task.
- * Example: 01ad32a0-1bb6-5e93-0000-000000000001
- */
- id: string;
- /** The owner of the task. */
- owner: string;
- /** The comment of the task. */
- comment: string;
- /** The warehouse of the task. */
- warehouse: string;
- /** The schedule interval of the task. */
- schedule: string;
- /** The predecessor tasks of the task. */
- predecessors: string[];
- /** The state of the task. */
- state: TaskMetadata_State;
- /** The condition of the task. */
- condition: string;
- /** The definition of the task. */
- definition: string;
-}
-
-export enum TaskMetadata_State {
- STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
- STATE_STARTED = "STATE_STARTED",
- STATE_SUSPENDED = "STATE_SUSPENDED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskMetadata_StateFromJSON(object: any): TaskMetadata_State {
- switch (object) {
- case 0:
- case "STATE_UNSPECIFIED":
- return TaskMetadata_State.STATE_UNSPECIFIED;
- case 1:
- case "STATE_STARTED":
- return TaskMetadata_State.STATE_STARTED;
- case 2:
- case "STATE_SUSPENDED":
- return TaskMetadata_State.STATE_SUSPENDED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskMetadata_State.UNRECOGNIZED;
- }
-}
-
-export function taskMetadata_StateToJSON(object: TaskMetadata_State): string {
- switch (object) {
- case TaskMetadata_State.STATE_UNSPECIFIED:
- return "STATE_UNSPECIFIED";
- case TaskMetadata_State.STATE_STARTED:
- return "STATE_STARTED";
- case TaskMetadata_State.STATE_SUSPENDED:
- return "STATE_SUSPENDED";
- case TaskMetadata_State.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- /** The table_name is the name of the table/view that the stream is created on. */
- tableName: string;
- /** The owner of the stream. */
- owner: string;
- /** The comment of the stream. */
- comment: string;
- /** The type of the stream. */
- type: StreamMetadata_Type;
- /** Indicates whether the stream was last read before the `stale_after` time. */
- stale: boolean;
- /** The mode of the stream. */
- mode: StreamMetadata_Mode;
- /** The definition of the stream. */
- definition: string;
-}
-
-export enum StreamMetadata_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- TYPE_DELTA = "TYPE_DELTA",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function streamMetadata_TypeFromJSON(object: any): StreamMetadata_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return StreamMetadata_Type.TYPE_UNSPECIFIED;
- case 1:
- case "TYPE_DELTA":
- return StreamMetadata_Type.TYPE_DELTA;
- case -1:
- case "UNRECOGNIZED":
- default:
- return StreamMetadata_Type.UNRECOGNIZED;
- }
-}
-
-export function streamMetadata_TypeToJSON(object: StreamMetadata_Type): string {
- switch (object) {
- case StreamMetadata_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case StreamMetadata_Type.TYPE_DELTA:
- return "TYPE_DELTA";
- case StreamMetadata_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "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 {
- switch (object) {
- case 0:
- case "MODE_UNSPECIFIED":
- return StreamMetadata_Mode.MODE_UNSPECIFIED;
- case 1:
- case "MODE_DEFAULT":
- return StreamMetadata_Mode.MODE_DEFAULT;
- case 2:
- case "MODE_APPEND_ONLY":
- return StreamMetadata_Mode.MODE_APPEND_ONLY;
- case 3:
- case "MODE_INSERT_ONLY":
- return StreamMetadata_Mode.MODE_INSERT_ONLY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return StreamMetadata_Mode.UNRECOGNIZED;
- }
-}
-
-export function streamMetadata_ModeToJSON(object: StreamMetadata_Mode): string {
- switch (object) {
- case StreamMetadata_Mode.MODE_UNSPECIFIED:
- return "MODE_UNSPECIFIED";
- case StreamMetadata_Mode.MODE_DEFAULT:
- return "MODE_DEFAULT";
- case StreamMetadata_Mode.MODE_APPEND_ONLY:
- return "MODE_APPEND_ONLY";
- case StreamMetadata_Mode.MODE_INSERT_ONLY:
- return "MODE_INSERT_ONLY";
- case StreamMetadata_Mode.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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. */
- name: string;
- /**
- * The expressions are the ordered columns or expressions of an index.
- * This could refer to a column or an expression.
- */
- expressions: string[];
- /**
- * The key_lengths are the ordered key lengths of an index.
- * If the key length is not specified, it's -1.
- */
- keyLength: Long[];
- /** The descending is the ordered descending of an index. */
- descending: boolean[];
- /** The type is the type of an index. */
- type: string;
- /** The unique is whether the index is unique. */
- unique: boolean;
- /** The primary is whether the index is a primary key index. */
- primary: boolean;
- /** The visible is whether the index is visible. */
- visible: boolean;
- /** The comment is the comment of an index. */
- comment: string;
- /** The definition of an index. */
- definition: string;
- /** The schema name of the parent index. */
- parentIndexSchema: string;
- /** The index name of the parent index. */
- parentIndexName: string;
- /** The number of granules in the block. It's a ClickHouse specific field. */
- granularity: Long;
- /**
- * It's a PostgreSQL specific field.
- * The unique constraint and unique index are not the same thing in PostgreSQL.
- */
- isConstraint: boolean;
-}
-
-/** ExtensionMetadata is the metadata for extensions. */
-export interface ExtensionMetadata {
- /** The name is the name of an extension. */
- name: string;
- /**
- * The schema is the extension that is installed to. But the extension usage
- * is not limited to the schema.
- */
- schema: string;
- /** The version is the version of an extension. */
- version: string;
- /** The description is the description of an extension. */
- description: string;
-}
-
-/** ForeignKeyMetadata is the metadata for foreign keys. */
-export interface ForeignKeyMetadata {
- /** The name is the name of a foreign key. */
- name: string;
- /** The columns are the ordered referencing columns of a foreign key. */
- columns: string[];
- /**
- * The referenced_schema is the referenced schema name of a foreign key.
- * It is an empty string for databases without such concept such as MySQL.
- */
- referencedSchema: string;
- /** The referenced_table is the referenced table name of a foreign key. */
- referencedTable: string;
- /** The referenced_columns are the ordered referenced columns of a foreign key. */
- referencedColumns: string[];
- /** The on_delete is the on delete action of a foreign key. */
- onDelete: string;
- /** The on_update is the on update action of a foreign key. */
- onUpdate: string;
- /**
- * The match_type is the match type of a foreign key.
- * The match_type is the PostgreSQL specific field.
- * It's empty string for other databases.
- */
- matchType: string;
-}
-
-/** DatabaseSchema is the metadata for databases. */
-export interface DatabaseSchema {
- /** The schema dump from database. */
- schema: string;
-}
-
-export interface ListSecretsRequest {
- /**
- * The parent of the secret.
- * Format: instances/{instance}/databases/{database}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of secrets to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 secrets will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListSecrets` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListSecrets` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListSecretsResponse {
- /** The list of secrets. */
- secrets: Secret[];
- /**
- * Not used. A token, which can be sent as `page_token` to retrieve the next
- * page. If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateSecretRequest {
- /** The secret to be created or updated. */
- secret:
- | Secret
- | undefined;
- /** The mask of the fields to be updated. */
- updateMask:
- | string[]
- | undefined;
- /** If true, the secret will be created if it does not exist. */
- allowMissing: boolean;
-}
-
-export interface DeleteSecretRequest {
- /**
- * The name of the secret to be deleted.
- * Format:
- * instances/{instance}/databases/{database}/secrets/{secret}
- */
- name: string;
-}
-
-/** Secret is the secret of the database now. */
-export interface Secret {
- /**
- * name is the unique name of the secret, which is specified by the client.
- * Format:
- * instances/{instance}/databases/{database}/secrets/{secret}
- */
- name: string;
- /** Not used. The timestamp when the secret resource was created initially. */
- createdTime:
- | Timestamp
- | undefined;
- /** Not used. The timestamp when the secret resource was updated. */
- updatedTime:
- | Timestamp
- | undefined;
- /** The value of the secret. */
- value: string;
- /** The description of the secret. */
- description: string;
-}
-
-export interface ChangedResources {
- databases: ChangedResourceDatabase[];
-}
-
-export interface ChangedResourceDatabase {
- name: string;
- schemas: ChangedResourceSchema[];
-}
-
-export interface ChangedResourceSchema {
- name: string;
- tables: ChangedResourceTable[];
- views: ChangedResourceView[];
- functions: ChangedResourceFunction[];
- procedures: ChangedResourceProcedure[];
-}
-
-export interface ChangedResourceTable {
- name: string;
- /** The ranges of sub-strings correspond to the statements on the sheet. */
- ranges: Range[];
-}
-
-export interface ChangedResourceView {
- name: string;
- /** The ranges of sub-strings correspond to the statements on the sheet. */
- ranges: Range[];
-}
-
-export interface ChangedResourceFunction {
- name: string;
- /** The ranges of sub-strings correspond to the statements on the sheet. */
- ranges: Range[];
-}
-
-export interface ChangedResourceProcedure {
- name: string;
- /** The ranges of sub-strings correspond to the statements on the sheet. */
- ranges: Range[];
-}
-
-export interface ListChangelogsRequest {
- /**
- * The parent of the changelogs.
- * Format: instances/{instance}/databases/{database}
- */
- parent: string;
- /**
- * The maximum number of changelogs to return. The service may return fewer
- * than this value. If unspecified, at most 10 changelogs will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from the previous call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided must match
- * the call that provided the page token.
- */
- pageToken: string;
- view: ChangelogView;
- /**
- * The filter of the changelogs.
- * follow the
- * [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form)
- * syntax. Support filter by type, source or table. For example: table =
- * "tableExists('{database}', '{schema}', '{table}')" table =
- * "tableExists('db', 'public', 'table1') || tableExists('db', 'public',
- * 'table2')"
- *
- * The table filter follow the CEL syntax.
- * currently, we have one function for CEL:
- * - tableExists(database, schema, table): return true if the table exists in
- * changed resources.
- *
- * examples:
- * Use
- * tableExists("db", "public", "table1")
- * to filter the changelogs which have the table "table1" in the schema
- * "public" of the database "db". For MySQL, the schema is always "", such as
- * tableExists("db", "", "table1").
- *
- * Combine multiple functions with "&&" and "||", we MUST use the Disjunctive
- * Normal Form(DNF). In other words, the CEL expression consists of several
- * parts connected by OR operators. For example, the following expression is
- * valid:
- * (
- * tableExists("db", "public", "table1") &&
- * tableExists("db", "public", "table2")
- * ) || (
- * tableExists("db", "public", "table3")
- * )
- */
- filter: string;
-}
-
-export interface ListChangelogsResponse {
- /** The list of changelogs. */
- changelogs: Changelog[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface GetChangelogRequest {
- /**
- * The name of the changelog to retrieve.
- * Format: instances/{instance}/databases/{database}/changelogs/{changelog}
- */
- name: string;
- view: ChangelogView;
- /** Format the schema dump into SDL format. */
- sdlFormat: boolean;
-}
-
-export interface Changelog {
- /** Format: instances/{instance}/databases/{database}/changelogs/{changelog} */
- name: string;
- createTime: Timestamp | undefined;
- status: Changelog_Status;
- /** The statement is used for preview purpose. */
- statement: string;
- statementSize: Long;
- /**
- * The name of the sheet resource.
- * Format: projects/{project}/sheets/{sheet}
- */
- statementSheet: string;
- schema: string;
- schemaSize: Long;
- prevSchema: string;
- prevSchemaSize: Long;
- /** Format: projects/{project}/issues/{issue} */
- issue: string;
- /** Format: projects/{projects}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun} */
- taskRun: string;
- /** Could be empty */
- version: string;
- /**
- * Could be empty
- * Or present but not found if deleted
- */
- revision: string;
- changedResources: ChangedResources | undefined;
- type: Changelog_Type;
-}
-
-export enum Changelog_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- PENDING = "PENDING",
- DONE = "DONE",
- FAILED = "FAILED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function changelog_StatusFromJSON(object: any): Changelog_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return Changelog_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return Changelog_Status.PENDING;
- case 2:
- case "DONE":
- return Changelog_Status.DONE;
- case 3:
- case "FAILED":
- return Changelog_Status.FAILED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Changelog_Status.UNRECOGNIZED;
- }
-}
-
-export function changelog_StatusToJSON(object: Changelog_Status): string {
- switch (object) {
- case Changelog_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case Changelog_Status.PENDING:
- return "PENDING";
- case Changelog_Status.DONE:
- return "DONE";
- case Changelog_Status.FAILED:
- return "FAILED";
- case Changelog_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function changelog_StatusToNumber(object: Changelog_Status): number {
- switch (object) {
- case Changelog_Status.STATUS_UNSPECIFIED:
- return 0;
- case Changelog_Status.PENDING:
- return 1;
- case Changelog_Status.DONE:
- return 2;
- case Changelog_Status.FAILED:
- return 3;
- case Changelog_Status.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum Changelog_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- BASELINE = "BASELINE",
- MIGRATE = "MIGRATE",
- MIGRATE_SDL = "MIGRATE_SDL",
- MIGRATE_GHOST = "MIGRATE_GHOST",
- DATA = "DATA",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function changelog_TypeFromJSON(object: any): Changelog_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Changelog_Type.TYPE_UNSPECIFIED;
- case 1:
- case "BASELINE":
- return Changelog_Type.BASELINE;
- case 2:
- case "MIGRATE":
- return Changelog_Type.MIGRATE;
- case 3:
- case "MIGRATE_SDL":
- return Changelog_Type.MIGRATE_SDL;
- case 4:
- case "MIGRATE_GHOST":
- return Changelog_Type.MIGRATE_GHOST;
- case 6:
- case "DATA":
- return Changelog_Type.DATA;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Changelog_Type.UNRECOGNIZED;
- }
-}
-
-export function changelog_TypeToJSON(object: Changelog_Type): string {
- switch (object) {
- case Changelog_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Changelog_Type.BASELINE:
- return "BASELINE";
- case Changelog_Type.MIGRATE:
- return "MIGRATE";
- case Changelog_Type.MIGRATE_SDL:
- return "MIGRATE_SDL";
- case Changelog_Type.MIGRATE_GHOST:
- return "MIGRATE_GHOST";
- case Changelog_Type.DATA:
- return "DATA";
- case Changelog_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function changelog_TypeToNumber(object: Changelog_Type): number {
- switch (object) {
- case Changelog_Type.TYPE_UNSPECIFIED:
- return 0;
- case Changelog_Type.BASELINE:
- return 1;
- case Changelog_Type.MIGRATE:
- return 2;
- case Changelog_Type.MIGRATE_SDL:
- return 3;
- case Changelog_Type.MIGRATE_GHOST:
- return 4;
- case Changelog_Type.DATA:
- return 6;
- case Changelog_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GetSchemaStringRequest {
- /**
- * The name of the database.
- * Format: instances/{instance}/databases/{database}
- */
- name: string;
- type: GetSchemaStringRequest_ObjectType;
- /** It's empty for DATABASE. */
- schema: string;
- /** It's empty for DATABASE and SCHEMA. */
- object: string;
- /**
- * If use the metadata to generate the schema string, the type is OBJECT_TYPE_UNSPECIFIED.
- * Also the schema and object are empty.
- */
- metadata: DatabaseMetadata | undefined;
-}
-
-export enum GetSchemaStringRequest_ObjectType {
- OBJECT_TYPE_UNSPECIFIED = "OBJECT_TYPE_UNSPECIFIED",
- DATABASE = "DATABASE",
- SCHEMA = "SCHEMA",
- TABLE = "TABLE",
- VIEW = "VIEW",
- MATERIALIZED_VIEW = "MATERIALIZED_VIEW",
- FUNCTION = "FUNCTION",
- PROCEDURE = "PROCEDURE",
- SEQUENCE = "SEQUENCE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function getSchemaStringRequest_ObjectTypeFromJSON(object: any): GetSchemaStringRequest_ObjectType {
- switch (object) {
- case 0:
- case "OBJECT_TYPE_UNSPECIFIED":
- return GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED;
- case 1:
- case "DATABASE":
- return GetSchemaStringRequest_ObjectType.DATABASE;
- case 2:
- case "SCHEMA":
- return GetSchemaStringRequest_ObjectType.SCHEMA;
- case 3:
- case "TABLE":
- return GetSchemaStringRequest_ObjectType.TABLE;
- case 4:
- case "VIEW":
- return GetSchemaStringRequest_ObjectType.VIEW;
- case 5:
- case "MATERIALIZED_VIEW":
- return GetSchemaStringRequest_ObjectType.MATERIALIZED_VIEW;
- case 6:
- case "FUNCTION":
- return GetSchemaStringRequest_ObjectType.FUNCTION;
- case 7:
- case "PROCEDURE":
- return GetSchemaStringRequest_ObjectType.PROCEDURE;
- case 8:
- case "SEQUENCE":
- return GetSchemaStringRequest_ObjectType.SEQUENCE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return GetSchemaStringRequest_ObjectType.UNRECOGNIZED;
- }
-}
-
-export function getSchemaStringRequest_ObjectTypeToJSON(object: GetSchemaStringRequest_ObjectType): string {
- switch (object) {
- case GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED:
- return "OBJECT_TYPE_UNSPECIFIED";
- case GetSchemaStringRequest_ObjectType.DATABASE:
- return "DATABASE";
- case GetSchemaStringRequest_ObjectType.SCHEMA:
- return "SCHEMA";
- case GetSchemaStringRequest_ObjectType.TABLE:
- return "TABLE";
- case GetSchemaStringRequest_ObjectType.VIEW:
- return "VIEW";
- case GetSchemaStringRequest_ObjectType.MATERIALIZED_VIEW:
- return "MATERIALIZED_VIEW";
- case GetSchemaStringRequest_ObjectType.FUNCTION:
- return "FUNCTION";
- case GetSchemaStringRequest_ObjectType.PROCEDURE:
- return "PROCEDURE";
- case GetSchemaStringRequest_ObjectType.SEQUENCE:
- return "SEQUENCE";
- case GetSchemaStringRequest_ObjectType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function getSchemaStringRequest_ObjectTypeToNumber(object: GetSchemaStringRequest_ObjectType): number {
- switch (object) {
- case GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED:
- return 0;
- case GetSchemaStringRequest_ObjectType.DATABASE:
- return 1;
- case GetSchemaStringRequest_ObjectType.SCHEMA:
- return 2;
- case GetSchemaStringRequest_ObjectType.TABLE:
- return 3;
- case GetSchemaStringRequest_ObjectType.VIEW:
- return 4;
- case GetSchemaStringRequest_ObjectType.MATERIALIZED_VIEW:
- return 5;
- case GetSchemaStringRequest_ObjectType.FUNCTION:
- return 6;
- case GetSchemaStringRequest_ObjectType.PROCEDURE:
- return 7;
- case GetSchemaStringRequest_ObjectType.SEQUENCE:
- return 8;
- case GetSchemaStringRequest_ObjectType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GetSchemaStringResponse {
- schemaString: string;
-}
-
-function createBaseGetDatabaseRequest(): GetDatabaseRequest {
- return { name: "" };
-}
-
-export const GetDatabaseRequest: MessageFns<GetDatabaseRequest> = {
- encode(message: GetDatabaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetDatabaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetDatabaseRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetDatabaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetDatabaseRequest>): GetDatabaseRequest {
- return GetDatabaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetDatabaseRequest>): GetDatabaseRequest {
- const message = createBaseGetDatabaseRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseBatchGetDatabasesRequest(): BatchGetDatabasesRequest {
- return { parent: "", names: [] };
-}
-
-export const BatchGetDatabasesRequest: MessageFns<BatchGetDatabasesRequest> = {
- encode(message: BatchGetDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.names) {
- writer.uint32(18).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetDatabasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetDatabasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.names.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetDatabasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: BatchGetDatabasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.names?.length) {
- obj.names = message.names;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetDatabasesRequest>): BatchGetDatabasesRequest {
- return BatchGetDatabasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetDatabasesRequest>): BatchGetDatabasesRequest {
- const message = createBaseBatchGetDatabasesRequest();
- message.parent = object.parent ?? "";
- message.names = object.names?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchGetDatabasesResponse(): BatchGetDatabasesResponse {
- return { databases: [] };
-}
-
-export const BatchGetDatabasesResponse: MessageFns<BatchGetDatabasesResponse> = {
- encode(message: BatchGetDatabasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- Database.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetDatabasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetDatabasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(Database.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetDatabasesResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => Database.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchGetDatabasesResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases.map((e) => Database.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetDatabasesResponse>): BatchGetDatabasesResponse {
- return BatchGetDatabasesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetDatabasesResponse>): BatchGetDatabasesResponse {
- const message = createBaseBatchGetDatabasesResponse();
- message.databases = object.databases?.map((e) => Database.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseListDatabasesRequest(): ListDatabasesRequest {
- return { parent: "", pageSize: 0, pageToken: "", filter: "", showDeleted: false };
-}
-
-export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
- encode(message: ListDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- if (message.showDeleted !== false) {
- writer.uint32(40).bool(message.showDeleted);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListDatabasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListDatabasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListDatabasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- };
- },
-
- toJSON(message: ListDatabasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListDatabasesRequest>): ListDatabasesRequest {
- return ListDatabasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListDatabasesRequest>): ListDatabasesRequest {
- const message = createBaseListDatabasesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- message.showDeleted = object.showDeleted ?? false;
- return message;
- },
-};
-
-function createBaseListDatabasesResponse(): ListDatabasesResponse {
- return { databases: [], nextPageToken: "" };
-}
-
-export const ListDatabasesResponse: MessageFns<ListDatabasesResponse> = {
- encode(message: ListDatabasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- Database.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListDatabasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListDatabasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(Database.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListDatabasesResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => Database.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListDatabasesResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases.map((e) => Database.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListDatabasesResponse>): ListDatabasesResponse {
- return ListDatabasesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListDatabasesResponse>): ListDatabasesResponse {
- const message = createBaseListDatabasesResponse();
- message.databases = object.databases?.map((e) => Database.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateDatabaseRequest(): UpdateDatabaseRequest {
- return { database: undefined, updateMask: undefined };
-}
-
-export const UpdateDatabaseRequest: MessageFns<UpdateDatabaseRequest> = {
- encode(message: UpdateDatabaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.database !== undefined) {
- Database.encode(message.database, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateDatabaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateDatabaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.database = Database.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateDatabaseRequest {
- return {
- database: isSet(object.database) ? Database.fromJSON(object.database) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateDatabaseRequest): unknown {
- const obj: any = {};
- if (message.database !== undefined) {
- obj.database = Database.toJSON(message.database);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateDatabaseRequest>): UpdateDatabaseRequest {
- return UpdateDatabaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateDatabaseRequest>): UpdateDatabaseRequest {
- const message = createBaseUpdateDatabaseRequest();
- message.database = (object.database !== undefined && object.database !== null)
- ? Database.fromPartial(object.database)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseBatchUpdateDatabasesRequest(): BatchUpdateDatabasesRequest {
- return { parent: "", requests: [] };
-}
-
-export const BatchUpdateDatabasesRequest: MessageFns<BatchUpdateDatabasesRequest> = {
- encode(message: BatchUpdateDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.requests) {
- UpdateDatabaseRequest.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateDatabasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateDatabasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.requests.push(UpdateDatabaseRequest.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchUpdateDatabasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- requests: globalThis.Array.isArray(object?.requests)
- ? object.requests.map((e: any) => UpdateDatabaseRequest.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchUpdateDatabasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.requests?.length) {
- obj.requests = message.requests.map((e) => UpdateDatabaseRequest.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateDatabasesRequest>): BatchUpdateDatabasesRequest {
- return BatchUpdateDatabasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchUpdateDatabasesRequest>): BatchUpdateDatabasesRequest {
- const message = createBaseBatchUpdateDatabasesRequest();
- message.parent = object.parent ?? "";
- message.requests = object.requests?.map((e) => UpdateDatabaseRequest.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchUpdateDatabasesResponse(): BatchUpdateDatabasesResponse {
- return { databases: [] };
-}
-
-export const BatchUpdateDatabasesResponse: MessageFns<BatchUpdateDatabasesResponse> = {
- encode(message: BatchUpdateDatabasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- Database.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateDatabasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateDatabasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(Database.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchUpdateDatabasesResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => Database.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchUpdateDatabasesResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases.map((e) => Database.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateDatabasesResponse>): BatchUpdateDatabasesResponse {
- return BatchUpdateDatabasesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchUpdateDatabasesResponse>): BatchUpdateDatabasesResponse {
- const message = createBaseBatchUpdateDatabasesResponse();
- message.databases = object.databases?.map((e) => Database.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchSyncDatabasesRequest(): BatchSyncDatabasesRequest {
- return { parent: "", names: [] };
-}
-
-export const BatchSyncDatabasesRequest: MessageFns<BatchSyncDatabasesRequest> = {
- encode(message: BatchSyncDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.names) {
- writer.uint32(18).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSyncDatabasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSyncDatabasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.names.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchSyncDatabasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: BatchSyncDatabasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.names?.length) {
- obj.names = message.names;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchSyncDatabasesRequest>): BatchSyncDatabasesRequest {
- return BatchSyncDatabasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchSyncDatabasesRequest>): BatchSyncDatabasesRequest {
- const message = createBaseBatchSyncDatabasesRequest();
- message.parent = object.parent ?? "";
- message.names = object.names?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchSyncDatabasesResponse(): BatchSyncDatabasesResponse {
- return {};
-}
-
-export const BatchSyncDatabasesResponse: MessageFns<BatchSyncDatabasesResponse> = {
- encode(_: BatchSyncDatabasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSyncDatabasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSyncDatabasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchSyncDatabasesResponse {
- return {};
- },
-
- toJSON(_: BatchSyncDatabasesResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchSyncDatabasesResponse>): BatchSyncDatabasesResponse {
- return BatchSyncDatabasesResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchSyncDatabasesResponse>): BatchSyncDatabasesResponse {
- const message = createBaseBatchSyncDatabasesResponse();
- return message;
- },
-};
-
-function createBaseSyncDatabaseRequest(): SyncDatabaseRequest {
- return { name: "" };
-}
-
-export const SyncDatabaseRequest: MessageFns<SyncDatabaseRequest> = {
- encode(message: SyncDatabaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SyncDatabaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSyncDatabaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SyncDatabaseRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: SyncDatabaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SyncDatabaseRequest>): SyncDatabaseRequest {
- return SyncDatabaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SyncDatabaseRequest>): SyncDatabaseRequest {
- const message = createBaseSyncDatabaseRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseSyncDatabaseResponse(): SyncDatabaseResponse {
- return {};
-}
-
-export const SyncDatabaseResponse: MessageFns<SyncDatabaseResponse> = {
- encode(_: SyncDatabaseResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SyncDatabaseResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSyncDatabaseResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): SyncDatabaseResponse {
- return {};
- },
-
- toJSON(_: SyncDatabaseResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<SyncDatabaseResponse>): SyncDatabaseResponse {
- return SyncDatabaseResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<SyncDatabaseResponse>): SyncDatabaseResponse {
- const message = createBaseSyncDatabaseResponse();
- return message;
- },
-};
-
-function createBaseGetDatabaseMetadataRequest(): GetDatabaseMetadataRequest {
- return { name: "", filter: "" };
-}
-
-export const GetDatabaseMetadataRequest: MessageFns<GetDatabaseMetadataRequest> = {
- encode(message: GetDatabaseMetadataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.filter !== "") {
- writer.uint32(18).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseMetadataRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetDatabaseMetadataRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetDatabaseMetadataRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: GetDatabaseMetadataRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetDatabaseMetadataRequest>): GetDatabaseMetadataRequest {
- return GetDatabaseMetadataRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetDatabaseMetadataRequest>): GetDatabaseMetadataRequest {
- const message = createBaseGetDatabaseMetadataRequest();
- message.name = object.name ?? "";
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseGetDatabaseSchemaRequest(): GetDatabaseSchemaRequest {
- return { name: "", sdlFormat: false };
-}
-
-export const GetDatabaseSchemaRequest: MessageFns<GetDatabaseSchemaRequest> = {
- encode(message: GetDatabaseSchemaRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.sdlFormat !== false) {
- writer.uint32(16).bool(message.sdlFormat);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseSchemaRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetDatabaseSchemaRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.sdlFormat = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetDatabaseSchemaRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
- };
- },
-
- toJSON(message: GetDatabaseSchemaRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.sdlFormat !== false) {
- obj.sdlFormat = message.sdlFormat;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetDatabaseSchemaRequest>): GetDatabaseSchemaRequest {
- return GetDatabaseSchemaRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetDatabaseSchemaRequest>): GetDatabaseSchemaRequest {
- const message = createBaseGetDatabaseSchemaRequest();
- message.name = object.name ?? "";
- message.sdlFormat = object.sdlFormat ?? false;
- return message;
- },
-};
-
-function createBaseDiffSchemaRequest(): DiffSchemaRequest {
- return { name: "", schema: undefined, changelog: undefined, sdlFormat: false };
-}
-
-export const DiffSchemaRequest: MessageFns<DiffSchemaRequest> = {
- encode(message: DiffSchemaRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.schema !== undefined) {
- writer.uint32(18).string(message.schema);
- }
- if (message.changelog !== undefined) {
- writer.uint32(26).string(message.changelog);
- }
- if (message.sdlFormat !== false) {
- writer.uint32(32).bool(message.sdlFormat);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DiffSchemaRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDiffSchemaRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.changelog = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.sdlFormat = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DiffSchemaRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
- changelog: isSet(object.changelog) ? globalThis.String(object.changelog) : undefined,
- sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
- };
- },
-
- toJSON(message: DiffSchemaRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.schema !== undefined) {
- obj.schema = message.schema;
- }
- if (message.changelog !== undefined) {
- obj.changelog = message.changelog;
- }
- if (message.sdlFormat !== false) {
- obj.sdlFormat = message.sdlFormat;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DiffSchemaRequest>): DiffSchemaRequest {
- return DiffSchemaRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DiffSchemaRequest>): DiffSchemaRequest {
- const message = createBaseDiffSchemaRequest();
- message.name = object.name ?? "";
- message.schema = object.schema ?? undefined;
- message.changelog = object.changelog ?? undefined;
- message.sdlFormat = object.sdlFormat ?? false;
- return message;
- },
-};
-
-function createBaseDiffSchemaResponse(): DiffSchemaResponse {
- return { diff: "" };
-}
-
-export const DiffSchemaResponse: MessageFns<DiffSchemaResponse> = {
- encode(message: DiffSchemaResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.diff !== "") {
- writer.uint32(10).string(message.diff);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DiffSchemaResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDiffSchemaResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.diff = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DiffSchemaResponse {
- return { diff: isSet(object.diff) ? globalThis.String(object.diff) : "" };
- },
-
- toJSON(message: DiffSchemaResponse): unknown {
- const obj: any = {};
- if (message.diff !== "") {
- obj.diff = message.diff;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DiffSchemaResponse>): DiffSchemaResponse {
- return DiffSchemaResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DiffSchemaResponse>): DiffSchemaResponse {
- const message = createBaseDiffSchemaResponse();
- message.diff = object.diff ?? "";
- return message;
- },
-};
-
-function createBaseDatabase(): Database {
- return {
- name: "",
- state: State.STATE_UNSPECIFIED,
- successfulSyncTime: undefined,
- project: "",
- schemaVersion: "",
- environment: "",
- effectiveEnvironment: "",
- labels: {},
- instanceResource: undefined,
- backupAvailable: false,
- drifted: false,
- };
-}
-
-export const Database: MessageFns<Database> = {
- encode(message: Database, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- writer.uint32(24).int32(stateToNumber(message.state));
- }
- if (message.successfulSyncTime !== undefined) {
- Timestamp.encode(message.successfulSyncTime, writer.uint32(34).fork()).join();
- }
- if (message.project !== "") {
- writer.uint32(42).string(message.project);
- }
- if (message.schemaVersion !== "") {
- writer.uint32(50).string(message.schemaVersion);
- }
- if (message.environment !== "") {
- writer.uint32(58).string(message.environment);
- }
- if (message.effectiveEnvironment !== "") {
- writer.uint32(66).string(message.effectiveEnvironment);
- }
- Object.entries(message.labels).forEach(([key, value]) => {
- Database_LabelsEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join();
- });
- if (message.instanceResource !== undefined) {
- InstanceResource.encode(message.instanceResource, writer.uint32(82).fork()).join();
- }
- if (message.backupAvailable !== false) {
- writer.uint32(88).bool(message.backupAvailable);
- }
- if (message.drifted !== false) {
- writer.uint32(96).bool(message.drifted);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Database {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabase();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.successfulSyncTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.schemaVersion = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.effectiveEnvironment = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- const entry9 = Database_LabelsEntry.decode(reader, reader.uint32());
- if (entry9.value !== undefined) {
- message.labels[entry9.key] = entry9.value;
- }
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.instanceResource = InstanceResource.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.backupAvailable = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 96) {
- break;
- }
-
- message.drifted = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Database {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- successfulSyncTime: isSet(object.successfulSyncTime) ? fromJsonTimestamp(object.successfulSyncTime) : undefined,
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- effectiveEnvironment: isSet(object.effectiveEnvironment) ? globalThis.String(object.effectiveEnvironment) : "",
- labels: isObject(object.labels)
- ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- instanceResource: isSet(object.instanceResource) ? InstanceResource.fromJSON(object.instanceResource) : undefined,
- backupAvailable: isSet(object.backupAvailable) ? globalThis.Boolean(object.backupAvailable) : false,
- drifted: isSet(object.drifted) ? globalThis.Boolean(object.drifted) : false,
- };
- },
-
- toJSON(message: Database): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- if (message.successfulSyncTime !== undefined) {
- obj.successfulSyncTime = fromTimestamp(message.successfulSyncTime).toISOString();
- }
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.schemaVersion !== "") {
- obj.schemaVersion = message.schemaVersion;
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- if (message.effectiveEnvironment !== "") {
- obj.effectiveEnvironment = message.effectiveEnvironment;
- }
- if (message.labels) {
- const entries = Object.entries(message.labels);
- if (entries.length > 0) {
- obj.labels = {};
- entries.forEach(([k, v]) => {
- obj.labels[k] = v;
- });
- }
- }
- if (message.instanceResource !== undefined) {
- obj.instanceResource = InstanceResource.toJSON(message.instanceResource);
- }
- if (message.backupAvailable !== false) {
- obj.backupAvailable = message.backupAvailable;
- }
- if (message.drifted !== false) {
- obj.drifted = message.drifted;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Database>): Database {
- return Database.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Database>): Database {
- const message = createBaseDatabase();
- message.name = object.name ?? "";
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- message.successfulSyncTime = (object.successfulSyncTime !== undefined && object.successfulSyncTime !== null)
- ? Timestamp.fromPartial(object.successfulSyncTime)
- : undefined;
- message.project = object.project ?? "";
- message.schemaVersion = object.schemaVersion ?? "";
- message.environment = object.environment ?? "";
- message.effectiveEnvironment = object.effectiveEnvironment ?? "";
- message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- message.instanceResource = (object.instanceResource !== undefined && object.instanceResource !== null)
- ? InstanceResource.fromPartial(object.instanceResource)
- : undefined;
- message.backupAvailable = object.backupAvailable ?? false;
- message.drifted = object.drifted ?? false;
- return message;
- },
-};
-
-function createBaseDatabase_LabelsEntry(): Database_LabelsEntry {
- return { key: "", value: "" };
-}
-
-export const Database_LabelsEntry: MessageFns<Database_LabelsEntry> = {
- encode(message: Database_LabelsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Database_LabelsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabase_LabelsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Database_LabelsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: Database_LabelsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Database_LabelsEntry>): Database_LabelsEntry {
- return Database_LabelsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Database_LabelsEntry>): Database_LabelsEntry {
- const message = createBaseDatabase_LabelsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseDatabaseMetadata(): DatabaseMetadata {
- return { name: "", schemas: [], characterSet: "", collation: "", extensions: [], owner: "", searchPath: "" };
-}
-
-export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
- encode(message: DatabaseMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.schemas) {
- SchemaMetadata.encode(v!, writer.uint32(18).fork()).join();
- }
- if (message.characterSet !== "") {
- writer.uint32(26).string(message.characterSet);
- }
- if (message.collation !== "") {
- writer.uint32(34).string(message.collation);
- }
- for (const v of message.extensions) {
- ExtensionMetadata.encode(v!, writer.uint32(42).fork()).join();
- }
- if (message.owner !== "") {
- writer.uint32(58).string(message.owner);
- }
- if (message.searchPath !== "") {
- writer.uint32(66).string(message.searchPath);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DatabaseMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabaseMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemas.push(SchemaMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.characterSet = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.collation = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.extensions.push(ExtensionMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.searchPath = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DatabaseMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- schemas: globalThis.Array.isArray(object?.schemas)
- ? object.schemas.map((e: any) => SchemaMetadata.fromJSON(e))
- : [],
- characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
- collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
- extensions: globalThis.Array.isArray(object?.extensions)
- ? object.extensions.map((e: any) => ExtensionMetadata.fromJSON(e))
- : [],
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- searchPath: isSet(object.searchPath) ? globalThis.String(object.searchPath) : "",
- };
- },
-
- toJSON(message: DatabaseMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.schemas?.length) {
- obj.schemas = message.schemas.map((e) => SchemaMetadata.toJSON(e));
- }
- if (message.characterSet !== "") {
- obj.characterSet = message.characterSet;
- }
- if (message.collation !== "") {
- obj.collation = message.collation;
- }
- if (message.extensions?.length) {
- obj.extensions = message.extensions.map((e) => ExtensionMetadata.toJSON(e));
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.searchPath !== "") {
- obj.searchPath = message.searchPath;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DatabaseMetadata>): DatabaseMetadata {
- return DatabaseMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DatabaseMetadata>): DatabaseMetadata {
- const message = createBaseDatabaseMetadata();
- message.name = object.name ?? "";
- message.schemas = object.schemas?.map((e) => SchemaMetadata.fromPartial(e)) || [];
- message.characterSet = object.characterSet ?? "";
- message.collation = object.collation ?? "";
- message.extensions = object.extensions?.map((e) => ExtensionMetadata.fromPartial(e)) || [];
- message.owner = object.owner ?? "";
- message.searchPath = object.searchPath ?? "";
- return message;
- },
-};
-
-function createBaseSchemaMetadata(): SchemaMetadata {
- return {
- name: "",
- tables: [],
- externalTables: [],
- views: [],
- functions: [],
- procedures: [],
- streams: [],
- tasks: [],
- materializedViews: [],
- packages: [],
- owner: "",
- sequences: [],
- events: [],
- enumTypes: [],
- skipDump: false,
- comment: "",
- };
-}
-
-export const SchemaMetadata: MessageFns<SchemaMetadata> = {
- encode(message: SchemaMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.tables) {
- TableMetadata.encode(v!, writer.uint32(18).fork()).join();
- }
- for (const v of message.externalTables) {
- ExternalTableMetadata.encode(v!, writer.uint32(26).fork()).join();
- }
- for (const v of message.views) {
- ViewMetadata.encode(v!, writer.uint32(34).fork()).join();
- }
- for (const v of message.functions) {
- FunctionMetadata.encode(v!, writer.uint32(42).fork()).join();
- }
- for (const v of message.procedures) {
- ProcedureMetadata.encode(v!, writer.uint32(50).fork()).join();
- }
- for (const v of message.streams) {
- StreamMetadata.encode(v!, writer.uint32(58).fork()).join();
- }
- for (const v of message.tasks) {
- TaskMetadata.encode(v!, writer.uint32(66).fork()).join();
- }
- for (const v of message.materializedViews) {
- MaterializedViewMetadata.encode(v!, writer.uint32(74).fork()).join();
- }
- for (const v of message.packages) {
- PackageMetadata.encode(v!, writer.uint32(82).fork()).join();
- }
- if (message.owner !== "") {
- writer.uint32(90).string(message.owner);
- }
- for (const v of message.sequences) {
- SequenceMetadata.encode(v!, writer.uint32(106).fork()).join();
- }
- for (const v of message.events) {
- EventMetadata.encode(v!, writer.uint32(114).fork()).join();
- }
- for (const v of message.enumTypes) {
- EnumTypeMetadata.encode(v!, writer.uint32(122).fork()).join();
- }
- if (message.skipDump !== false) {
- writer.uint32(128).bool(message.skipDump);
- }
- if (message.comment !== "") {
- writer.uint32(138).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tables.push(TableMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.externalTables.push(ExternalTableMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.views.push(ViewMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.functions.push(FunctionMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.procedures.push(ProcedureMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.streams.push(StreamMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.tasks.push(TaskMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.materializedViews.push(MaterializedViewMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.packages.push(PackageMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.sequences.push(SequenceMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.events.push(EventMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.enumTypes.push(EnumTypeMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- tables: globalThis.Array.isArray(object?.tables) ? object.tables.map((e: any) => TableMetadata.fromJSON(e)) : [],
- externalTables: globalThis.Array.isArray(object?.externalTables)
- ? object.externalTables.map((e: any) => ExternalTableMetadata.fromJSON(e))
- : [],
- views: globalThis.Array.isArray(object?.views) ? object.views.map((e: any) => ViewMetadata.fromJSON(e)) : [],
- functions: globalThis.Array.isArray(object?.functions)
- ? object.functions.map((e: any) => FunctionMetadata.fromJSON(e))
- : [],
- procedures: globalThis.Array.isArray(object?.procedures)
- ? object.procedures.map((e: any) => ProcedureMetadata.fromJSON(e))
- : [],
- streams: globalThis.Array.isArray(object?.streams)
- ? object.streams.map((e: any) => StreamMetadata.fromJSON(e))
- : [],
- tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => TaskMetadata.fromJSON(e)) : [],
- materializedViews: globalThis.Array.isArray(object?.materializedViews)
- ? object.materializedViews.map((e: any) => MaterializedViewMetadata.fromJSON(e))
- : [],
- packages: globalThis.Array.isArray(object?.packages)
- ? object.packages.map((e: any) => PackageMetadata.fromJSON(e))
- : [],
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- sequences: globalThis.Array.isArray(object?.sequences)
- ? object.sequences.map((e: any) => SequenceMetadata.fromJSON(e))
- : [],
- events: globalThis.Array.isArray(object?.events) ? object.events.map((e: any) => EventMetadata.fromJSON(e)) : [],
- enumTypes: globalThis.Array.isArray(object?.enumTypes)
- ? object.enumTypes.map((e: any) => EnumTypeMetadata.fromJSON(e))
- : [],
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: SchemaMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.tables?.length) {
- obj.tables = message.tables.map((e) => TableMetadata.toJSON(e));
- }
- if (message.externalTables?.length) {
- obj.externalTables = message.externalTables.map((e) => ExternalTableMetadata.toJSON(e));
- }
- if (message.views?.length) {
- obj.views = message.views.map((e) => ViewMetadata.toJSON(e));
- }
- if (message.functions?.length) {
- obj.functions = message.functions.map((e) => FunctionMetadata.toJSON(e));
- }
- if (message.procedures?.length) {
- obj.procedures = message.procedures.map((e) => ProcedureMetadata.toJSON(e));
- }
- if (message.streams?.length) {
- obj.streams = message.streams.map((e) => StreamMetadata.toJSON(e));
- }
- if (message.tasks?.length) {
- obj.tasks = message.tasks.map((e) => TaskMetadata.toJSON(e));
- }
- if (message.materializedViews?.length) {
- obj.materializedViews = message.materializedViews.map((e) => MaterializedViewMetadata.toJSON(e));
- }
- if (message.packages?.length) {
- obj.packages = message.packages.map((e) => PackageMetadata.toJSON(e));
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.sequences?.length) {
- obj.sequences = message.sequences.map((e) => SequenceMetadata.toJSON(e));
- }
- if (message.events?.length) {
- obj.events = message.events.map((e) => EventMetadata.toJSON(e));
- }
- if (message.enumTypes?.length) {
- obj.enumTypes = message.enumTypes.map((e) => EnumTypeMetadata.toJSON(e));
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaMetadata>): SchemaMetadata {
- return SchemaMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaMetadata>): SchemaMetadata {
- const message = createBaseSchemaMetadata();
- message.name = object.name ?? "";
- message.tables = object.tables?.map((e) => TableMetadata.fromPartial(e)) || [];
- message.externalTables = object.externalTables?.map((e) => ExternalTableMetadata.fromPartial(e)) || [];
- message.views = object.views?.map((e) => ViewMetadata.fromPartial(e)) || [];
- message.functions = object.functions?.map((e) => FunctionMetadata.fromPartial(e)) || [];
- message.procedures = object.procedures?.map((e) => ProcedureMetadata.fromPartial(e)) || [];
- message.streams = object.streams?.map((e) => StreamMetadata.fromPartial(e)) || [];
- message.tasks = object.tasks?.map((e) => TaskMetadata.fromPartial(e)) || [];
- message.materializedViews = object.materializedViews?.map((e) => MaterializedViewMetadata.fromPartial(e)) || [];
- message.packages = object.packages?.map((e) => PackageMetadata.fromPartial(e)) || [];
- message.owner = object.owner ?? "";
- message.sequences = object.sequences?.map((e) => SequenceMetadata.fromPartial(e)) || [];
- message.events = object.events?.map((e) => EventMetadata.fromPartial(e)) || [];
- message.enumTypes = object.enumTypes?.map((e) => EnumTypeMetadata.fromPartial(e)) || [];
- message.skipDump = object.skipDump ?? false;
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseEnumTypeMetadata(): EnumTypeMetadata {
- return { name: "", values: [], comment: "", skipDump: false };
-}
-
-export const EnumTypeMetadata: MessageFns<EnumTypeMetadata> = {
- encode(message: EnumTypeMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.values) {
- writer.uint32(18).string(v!);
- }
- if (message.comment !== "") {
- writer.uint32(26).string(message.comment);
- }
- if (message.skipDump !== false) {
- writer.uint32(32).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): EnumTypeMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEnumTypeMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.values.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): EnumTypeMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: EnumTypeMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.values?.length) {
- obj.values = message.values;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<EnumTypeMetadata>): EnumTypeMetadata {
- return EnumTypeMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<EnumTypeMetadata>): EnumTypeMetadata {
- const message = createBaseEnumTypeMetadata();
- message.name = object.name ?? "";
- message.values = object.values?.map((e) => e) || [];
- message.comment = object.comment ?? "";
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseEventMetadata(): EventMetadata {
- return {
- name: "",
- definition: "",
- timeZone: "",
- sqlMode: "",
- characterSetClient: "",
- collationConnection: "",
- comment: "",
- };
-}
-
-export const EventMetadata: MessageFns<EventMetadata> = {
- encode(message: EventMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- if (message.timeZone !== "") {
- writer.uint32(26).string(message.timeZone);
- }
- if (message.sqlMode !== "") {
- writer.uint32(34).string(message.sqlMode);
- }
- if (message.characterSetClient !== "") {
- writer.uint32(42).string(message.characterSetClient);
- }
- if (message.collationConnection !== "") {
- writer.uint32(50).string(message.collationConnection);
- }
- if (message.comment !== "") {
- writer.uint32(58).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): EventMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEventMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.timeZone = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.sqlMode = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.characterSetClient = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.collationConnection = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): EventMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : "",
- sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
- characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
- collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: EventMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.timeZone !== "") {
- obj.timeZone = message.timeZone;
- }
- if (message.sqlMode !== "") {
- obj.sqlMode = message.sqlMode;
- }
- if (message.characterSetClient !== "") {
- obj.characterSetClient = message.characterSetClient;
- }
- if (message.collationConnection !== "") {
- obj.collationConnection = message.collationConnection;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<EventMetadata>): EventMetadata {
- return EventMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<EventMetadata>): EventMetadata {
- const message = createBaseEventMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- message.timeZone = object.timeZone ?? "";
- message.sqlMode = object.sqlMode ?? "";
- message.characterSetClient = object.characterSetClient ?? "";
- message.collationConnection = object.collationConnection ?? "";
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseSequenceMetadata(): SequenceMetadata {
- return {
- name: "",
- dataType: "",
- start: "",
- minValue: "",
- maxValue: "",
- increment: "",
- cycle: false,
- cacheSize: "",
- lastValue: "",
- ownerTable: "",
- ownerColumn: "",
- comment: "",
- skipDump: false,
- };
-}
-
-export const SequenceMetadata: MessageFns<SequenceMetadata> = {
- encode(message: SequenceMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.dataType !== "") {
- writer.uint32(18).string(message.dataType);
- }
- if (message.start !== "") {
- writer.uint32(26).string(message.start);
- }
- if (message.minValue !== "") {
- writer.uint32(34).string(message.minValue);
- }
- if (message.maxValue !== "") {
- writer.uint32(42).string(message.maxValue);
- }
- if (message.increment !== "") {
- writer.uint32(50).string(message.increment);
- }
- if (message.cycle !== false) {
- writer.uint32(56).bool(message.cycle);
- }
- if (message.cacheSize !== "") {
- writer.uint32(66).string(message.cacheSize);
- }
- if (message.lastValue !== "") {
- writer.uint32(74).string(message.lastValue);
- }
- if (message.ownerTable !== "") {
- writer.uint32(82).string(message.ownerTable);
- }
- if (message.ownerColumn !== "") {
- writer.uint32(90).string(message.ownerColumn);
- }
- if (message.comment !== "") {
- writer.uint32(98).string(message.comment);
- }
- if (message.skipDump !== false) {
- writer.uint32(104).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SequenceMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSequenceMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.dataType = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.start = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.minValue = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.maxValue = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.increment = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.cycle = reader.bool();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.cacheSize = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.lastValue = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.ownerTable = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.ownerColumn = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 104) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SequenceMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- dataType: isSet(object.dataType) ? globalThis.String(object.dataType) : "",
- start: isSet(object.start) ? globalThis.String(object.start) : "",
- minValue: isSet(object.minValue) ? globalThis.String(object.minValue) : "",
- maxValue: isSet(object.maxValue) ? globalThis.String(object.maxValue) : "",
- increment: isSet(object.increment) ? globalThis.String(object.increment) : "",
- cycle: isSet(object.cycle) ? globalThis.Boolean(object.cycle) : false,
- cacheSize: isSet(object.cacheSize) ? globalThis.String(object.cacheSize) : "",
- lastValue: isSet(object.lastValue) ? globalThis.String(object.lastValue) : "",
- ownerTable: isSet(object.ownerTable) ? globalThis.String(object.ownerTable) : "",
- ownerColumn: isSet(object.ownerColumn) ? globalThis.String(object.ownerColumn) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: SequenceMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.dataType !== "") {
- obj.dataType = message.dataType;
- }
- if (message.start !== "") {
- obj.start = message.start;
- }
- if (message.minValue !== "") {
- obj.minValue = message.minValue;
- }
- if (message.maxValue !== "") {
- obj.maxValue = message.maxValue;
- }
- if (message.increment !== "") {
- obj.increment = message.increment;
- }
- if (message.cycle !== false) {
- obj.cycle = message.cycle;
- }
- if (message.cacheSize !== "") {
- obj.cacheSize = message.cacheSize;
- }
- if (message.lastValue !== "") {
- obj.lastValue = message.lastValue;
- }
- if (message.ownerTable !== "") {
- obj.ownerTable = message.ownerTable;
- }
- if (message.ownerColumn !== "") {
- obj.ownerColumn = message.ownerColumn;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SequenceMetadata>): SequenceMetadata {
- return SequenceMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SequenceMetadata>): SequenceMetadata {
- const message = createBaseSequenceMetadata();
- message.name = object.name ?? "";
- message.dataType = object.dataType ?? "";
- message.start = object.start ?? "";
- message.minValue = object.minValue ?? "";
- message.maxValue = object.maxValue ?? "";
- message.increment = object.increment ?? "";
- message.cycle = object.cycle ?? false;
- message.cacheSize = object.cacheSize ?? "";
- message.lastValue = object.lastValue ?? "";
- message.ownerTable = object.ownerTable ?? "";
- message.ownerColumn = object.ownerColumn ?? "";
- message.comment = object.comment ?? "";
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseTriggerMetadata(): TriggerMetadata {
- return {
- name: "",
- event: "",
- timing: "",
- body: "",
- sqlMode: "",
- characterSetClient: "",
- collationConnection: "",
- comment: "",
- skipDump: false,
- };
-}
-
-export const TriggerMetadata: MessageFns<TriggerMetadata> = {
- encode(message: TriggerMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.event !== "") {
- writer.uint32(26).string(message.event);
- }
- if (message.timing !== "") {
- writer.uint32(34).string(message.timing);
- }
- if (message.body !== "") {
- writer.uint32(42).string(message.body);
- }
- if (message.sqlMode !== "") {
- writer.uint32(50).string(message.sqlMode);
- }
- if (message.characterSetClient !== "") {
- writer.uint32(58).string(message.characterSetClient);
- }
- if (message.collationConnection !== "") {
- writer.uint32(66).string(message.collationConnection);
- }
- if (message.comment !== "") {
- writer.uint32(74).string(message.comment);
- }
- if (message.skipDump !== false) {
- writer.uint32(80).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TriggerMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTriggerMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.event = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.timing = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.body = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.sqlMode = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.characterSetClient = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.collationConnection = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TriggerMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- event: isSet(object.event) ? globalThis.String(object.event) : "",
- timing: isSet(object.timing) ? globalThis.String(object.timing) : "",
- body: isSet(object.body) ? globalThis.String(object.body) : "",
- sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
- characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
- collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: TriggerMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.event !== "") {
- obj.event = message.event;
- }
- if (message.timing !== "") {
- obj.timing = message.timing;
- }
- if (message.body !== "") {
- obj.body = message.body;
- }
- if (message.sqlMode !== "") {
- obj.sqlMode = message.sqlMode;
- }
- if (message.characterSetClient !== "") {
- obj.characterSetClient = message.characterSetClient;
- }
- if (message.collationConnection !== "") {
- obj.collationConnection = message.collationConnection;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TriggerMetadata>): TriggerMetadata {
- return TriggerMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TriggerMetadata>): TriggerMetadata {
- const message = createBaseTriggerMetadata();
- message.name = object.name ?? "";
- message.event = object.event ?? "";
- message.timing = object.timing ?? "";
- message.body = object.body ?? "";
- message.sqlMode = object.sqlMode ?? "";
- message.characterSetClient = object.characterSetClient ?? "";
- message.collationConnection = object.collationConnection ?? "";
- message.comment = object.comment ?? "";
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseExternalTableMetadata(): ExternalTableMetadata {
- return { name: "", externalServerName: "", externalDatabaseName: "", columns: [] };
-}
-
-export const ExternalTableMetadata: MessageFns<ExternalTableMetadata> = {
- encode(message: ExternalTableMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.externalServerName !== "") {
- writer.uint32(18).string(message.externalServerName);
- }
- if (message.externalDatabaseName !== "") {
- writer.uint32(26).string(message.externalDatabaseName);
- }
- for (const v of message.columns) {
- ColumnMetadata.encode(v!, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExternalTableMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExternalTableMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.externalServerName = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.externalDatabaseName = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.columns.push(ColumnMetadata.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExternalTableMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- externalServerName: isSet(object.externalServerName) ? globalThis.String(object.externalServerName) : "",
- externalDatabaseName: isSet(object.externalDatabaseName) ? globalThis.String(object.externalDatabaseName) : "",
- columns: globalThis.Array.isArray(object?.columns)
- ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ExternalTableMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.externalServerName !== "") {
- obj.externalServerName = message.externalServerName;
- }
- if (message.externalDatabaseName !== "") {
- obj.externalDatabaseName = message.externalDatabaseName;
- }
- if (message.columns?.length) {
- obj.columns = message.columns.map((e) => ColumnMetadata.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExternalTableMetadata>): ExternalTableMetadata {
- return ExternalTableMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExternalTableMetadata>): ExternalTableMetadata {
- const message = createBaseExternalTableMetadata();
- message.name = object.name ?? "";
- message.externalServerName = object.externalServerName ?? "";
- message.externalDatabaseName = object.externalDatabaseName ?? "";
- message.columns = object.columns?.map((e) => ColumnMetadata.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTableMetadata(): TableMetadata {
- return {
- name: "",
- columns: [],
- indexes: [],
- engine: "",
- collation: "",
- charset: "",
- rowCount: Long.ZERO,
- dataSize: Long.ZERO,
- indexSize: Long.ZERO,
- dataFree: Long.ZERO,
- createOptions: "",
- comment: "",
- userComment: "",
- foreignKeys: [],
- partitions: [],
- checkConstraints: [],
- owner: "",
- sortingKeys: [],
- triggers: [],
- skipDump: false,
- shardingInfo: "",
- primaryKeyType: "",
- };
-}
-
-export const TableMetadata: MessageFns<TableMetadata> = {
- encode(message: TableMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.columns) {
- ColumnMetadata.encode(v!, writer.uint32(18).fork()).join();
- }
- for (const v of message.indexes) {
- IndexMetadata.encode(v!, writer.uint32(26).fork()).join();
- }
- if (message.engine !== "") {
- writer.uint32(34).string(message.engine);
- }
- if (message.collation !== "") {
- writer.uint32(42).string(message.collation);
- }
- if (message.charset !== "") {
- writer.uint32(138).string(message.charset);
- }
- if (!message.rowCount.equals(Long.ZERO)) {
- writer.uint32(48).int64(message.rowCount.toString());
- }
- if (!message.dataSize.equals(Long.ZERO)) {
- writer.uint32(56).int64(message.dataSize.toString());
- }
- if (!message.indexSize.equals(Long.ZERO)) {
- writer.uint32(64).int64(message.indexSize.toString());
- }
- if (!message.dataFree.equals(Long.ZERO)) {
- writer.uint32(72).int64(message.dataFree.toString());
- }
- if (message.createOptions !== "") {
- writer.uint32(82).string(message.createOptions);
- }
- if (message.comment !== "") {
- writer.uint32(90).string(message.comment);
- }
- if (message.userComment !== "") {
- writer.uint32(114).string(message.userComment);
- }
- for (const v of message.foreignKeys) {
- ForeignKeyMetadata.encode(v!, writer.uint32(98).fork()).join();
- }
- for (const v of message.partitions) {
- TablePartitionMetadata.encode(v!, writer.uint32(122).fork()).join();
- }
- for (const v of message.checkConstraints) {
- CheckConstraintMetadata.encode(v!, writer.uint32(130).fork()).join();
- }
- if (message.owner !== "") {
- writer.uint32(146).string(message.owner);
- }
- for (const v of message.sortingKeys) {
- writer.uint32(154).string(v!);
- }
- for (const v of message.triggers) {
- TriggerMetadata.encode(v!, writer.uint32(162).fork()).join();
- }
- if (message.skipDump !== false) {
- writer.uint32(168).bool(message.skipDump);
- }
- if (message.shardingInfo !== "") {
- writer.uint32(178).string(message.shardingInfo);
- }
- if (message.primaryKeyType !== "") {
- writer.uint32(186).string(message.primaryKeyType);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TableMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTableMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.columns.push(ColumnMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.indexes.push(IndexMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.engine = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.collation = reader.string();
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.charset = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.rowCount = Long.fromString(reader.int64().toString());
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.dataSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.indexSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.dataFree = Long.fromString(reader.int64().toString());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.createOptions = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.userComment = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.foreignKeys.push(ForeignKeyMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.partitions.push(TablePartitionMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.checkConstraints.push(CheckConstraintMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.sortingKeys.push(reader.string());
- continue;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 21: {
- if (tag !== 168) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- message.shardingInfo = reader.string();
- continue;
- }
- case 23: {
- if (tag !== 186) {
- break;
- }
-
- message.primaryKeyType = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TableMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- columns: globalThis.Array.isArray(object?.columns)
- ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
- : [],
- indexes: globalThis.Array.isArray(object?.indexes)
- ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
- : [],
- engine: isSet(object.engine) ? globalThis.String(object.engine) : "",
- collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
- charset: isSet(object.charset) ? globalThis.String(object.charset) : "",
- rowCount: isSet(object.rowCount) ? Long.fromValue(object.rowCount) : Long.ZERO,
- dataSize: isSet(object.dataSize) ? Long.fromValue(object.dataSize) : Long.ZERO,
- indexSize: isSet(object.indexSize) ? Long.fromValue(object.indexSize) : Long.ZERO,
- dataFree: isSet(object.dataFree) ? Long.fromValue(object.dataFree) : Long.ZERO,
- createOptions: isSet(object.createOptions) ? globalThis.String(object.createOptions) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- userComment: isSet(object.userComment) ? globalThis.String(object.userComment) : "",
- foreignKeys: globalThis.Array.isArray(object?.foreignKeys)
- ? object.foreignKeys.map((e: any) => ForeignKeyMetadata.fromJSON(e))
- : [],
- partitions: globalThis.Array.isArray(object?.partitions)
- ? object.partitions.map((e: any) => TablePartitionMetadata.fromJSON(e))
- : [],
- checkConstraints: globalThis.Array.isArray(object?.checkConstraints)
- ? object.checkConstraints.map((e: any) => CheckConstraintMetadata.fromJSON(e))
- : [],
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- sortingKeys: globalThis.Array.isArray(object?.sortingKeys)
- ? object.sortingKeys.map((e: any) => globalThis.String(e))
- : [],
- triggers: globalThis.Array.isArray(object?.triggers)
- ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
- : [],
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- shardingInfo: isSet(object.shardingInfo) ? globalThis.String(object.shardingInfo) : "",
- primaryKeyType: isSet(object.primaryKeyType) ? globalThis.String(object.primaryKeyType) : "",
- };
- },
-
- toJSON(message: TableMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.columns?.length) {
- obj.columns = message.columns.map((e) => ColumnMetadata.toJSON(e));
- }
- if (message.indexes?.length) {
- obj.indexes = message.indexes.map((e) => IndexMetadata.toJSON(e));
- }
- if (message.engine !== "") {
- obj.engine = message.engine;
- }
- if (message.collation !== "") {
- obj.collation = message.collation;
- }
- if (message.charset !== "") {
- obj.charset = message.charset;
- }
- if (!message.rowCount.equals(Long.ZERO)) {
- obj.rowCount = (message.rowCount || Long.ZERO).toString();
- }
- if (!message.dataSize.equals(Long.ZERO)) {
- obj.dataSize = (message.dataSize || Long.ZERO).toString();
- }
- if (!message.indexSize.equals(Long.ZERO)) {
- obj.indexSize = (message.indexSize || Long.ZERO).toString();
- }
- if (!message.dataFree.equals(Long.ZERO)) {
- obj.dataFree = (message.dataFree || Long.ZERO).toString();
- }
- if (message.createOptions !== "") {
- obj.createOptions = message.createOptions;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.userComment !== "") {
- obj.userComment = message.userComment;
- }
- if (message.foreignKeys?.length) {
- obj.foreignKeys = message.foreignKeys.map((e) => ForeignKeyMetadata.toJSON(e));
- }
- if (message.partitions?.length) {
- obj.partitions = message.partitions.map((e) => TablePartitionMetadata.toJSON(e));
- }
- if (message.checkConstraints?.length) {
- obj.checkConstraints = message.checkConstraints.map((e) => CheckConstraintMetadata.toJSON(e));
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.sortingKeys?.length) {
- obj.sortingKeys = message.sortingKeys;
- }
- if (message.triggers?.length) {
- obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- if (message.shardingInfo !== "") {
- obj.shardingInfo = message.shardingInfo;
- }
- if (message.primaryKeyType !== "") {
- obj.primaryKeyType = message.primaryKeyType;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TableMetadata>): TableMetadata {
- return TableMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TableMetadata>): TableMetadata {
- const message = createBaseTableMetadata();
- message.name = object.name ?? "";
- message.columns = object.columns?.map((e) => ColumnMetadata.fromPartial(e)) || [];
- message.indexes = object.indexes?.map((e) => IndexMetadata.fromPartial(e)) || [];
- message.engine = object.engine ?? "";
- message.collation = object.collation ?? "";
- message.charset = object.charset ?? "";
- message.rowCount = (object.rowCount !== undefined && object.rowCount !== null)
- ? Long.fromValue(object.rowCount)
- : Long.ZERO;
- message.dataSize = (object.dataSize !== undefined && object.dataSize !== null)
- ? Long.fromValue(object.dataSize)
- : Long.ZERO;
- message.indexSize = (object.indexSize !== undefined && object.indexSize !== null)
- ? Long.fromValue(object.indexSize)
- : Long.ZERO;
- message.dataFree = (object.dataFree !== undefined && object.dataFree !== null)
- ? Long.fromValue(object.dataFree)
- : Long.ZERO;
- message.createOptions = object.createOptions ?? "";
- message.comment = object.comment ?? "";
- message.userComment = object.userComment ?? "";
- message.foreignKeys = object.foreignKeys?.map((e) => ForeignKeyMetadata.fromPartial(e)) || [];
- message.partitions = object.partitions?.map((e) => TablePartitionMetadata.fromPartial(e)) || [];
- message.checkConstraints = object.checkConstraints?.map((e) => CheckConstraintMetadata.fromPartial(e)) || [];
- message.owner = object.owner ?? "";
- message.sortingKeys = object.sortingKeys?.map((e) => e) || [];
- message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];
- message.skipDump = object.skipDump ?? false;
- message.shardingInfo = object.shardingInfo ?? "";
- message.primaryKeyType = object.primaryKeyType ?? "";
- return message;
- },
-};
-
-function createBaseCheckConstraintMetadata(): CheckConstraintMetadata {
- return { name: "", expression: "" };
-}
-
-export const CheckConstraintMetadata: MessageFns<CheckConstraintMetadata> = {
- encode(message: CheckConstraintMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.expression !== "") {
- writer.uint32(18).string(message.expression);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckConstraintMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckConstraintMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.expression = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckConstraintMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
- };
- },
-
- toJSON(message: CheckConstraintMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.expression !== "") {
- obj.expression = message.expression;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckConstraintMetadata>): CheckConstraintMetadata {
- return CheckConstraintMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckConstraintMetadata>): CheckConstraintMetadata {
- const message = createBaseCheckConstraintMetadata();
- message.name = object.name ?? "";
- message.expression = object.expression ?? "";
- return message;
- },
-};
-
-function createBaseTablePartitionMetadata(): TablePartitionMetadata {
- return {
- name: "",
- type: TablePartitionMetadata_Type.TYPE_UNSPECIFIED,
- expression: "",
- value: "",
- useDefault: "",
- subpartitions: [],
- indexes: [],
- checkConstraints: [],
- };
-}
-
-export const TablePartitionMetadata: MessageFns<TablePartitionMetadata> = {
- encode(message: TablePartitionMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
- writer.uint32(16).int32(tablePartitionMetadata_TypeToNumber(message.type));
- }
- if (message.expression !== "") {
- writer.uint32(26).string(message.expression);
- }
- if (message.value !== "") {
- writer.uint32(34).string(message.value);
- }
- if (message.useDefault !== "") {
- writer.uint32(42).string(message.useDefault);
- }
- for (const v of message.subpartitions) {
- TablePartitionMetadata.encode(v!, writer.uint32(50).fork()).join();
- }
- for (const v of message.indexes) {
- IndexMetadata.encode(v!, writer.uint32(58).fork()).join();
- }
- for (const v of message.checkConstraints) {
- CheckConstraintMetadata.encode(v!, writer.uint32(66).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TablePartitionMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTablePartitionMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.type = tablePartitionMetadata_TypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.expression = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.useDefault = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.subpartitions.push(TablePartitionMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.indexes.push(IndexMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.checkConstraints.push(CheckConstraintMetadata.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TablePartitionMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type)
- ? tablePartitionMetadata_TypeFromJSON(object.type)
- : TablePartitionMetadata_Type.TYPE_UNSPECIFIED,
- expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- useDefault: isSet(object.useDefault) ? globalThis.String(object.useDefault) : "",
- subpartitions: globalThis.Array.isArray(object?.subpartitions)
- ? object.subpartitions.map((e: any) => TablePartitionMetadata.fromJSON(e))
- : [],
- indexes: globalThis.Array.isArray(object?.indexes)
- ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
- : [],
- checkConstraints: globalThis.Array.isArray(object?.checkConstraints)
- ? object.checkConstraints.map((e: any) => CheckConstraintMetadata.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: TablePartitionMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
- obj.type = tablePartitionMetadata_TypeToJSON(message.type);
- }
- if (message.expression !== "") {
- obj.expression = message.expression;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- if (message.useDefault !== "") {
- obj.useDefault = message.useDefault;
- }
- if (message.subpartitions?.length) {
- obj.subpartitions = message.subpartitions.map((e) => TablePartitionMetadata.toJSON(e));
- }
- if (message.indexes?.length) {
- obj.indexes = message.indexes.map((e) => IndexMetadata.toJSON(e));
- }
- if (message.checkConstraints?.length) {
- obj.checkConstraints = message.checkConstraints.map((e) => CheckConstraintMetadata.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<TablePartitionMetadata>): TablePartitionMetadata {
- return TablePartitionMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TablePartitionMetadata>): TablePartitionMetadata {
- const message = createBaseTablePartitionMetadata();
- message.name = object.name ?? "";
- message.type = object.type ?? TablePartitionMetadata_Type.TYPE_UNSPECIFIED;
- message.expression = object.expression ?? "";
- message.value = object.value ?? "";
- message.useDefault = object.useDefault ?? "";
- message.subpartitions = object.subpartitions?.map((e) => TablePartitionMetadata.fromPartial(e)) || [];
- message.indexes = object.indexes?.map((e) => IndexMetadata.fromPartial(e)) || [];
- message.checkConstraints = object.checkConstraints?.map((e) => CheckConstraintMetadata.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseColumnMetadata(): ColumnMetadata {
- return {
- name: "",
- position: 0,
- hasDefault: false,
- defaultNull: false,
- defaultString: "",
- defaultExpression: "",
- defaultOnNull: false,
- onUpdate: "",
- nullable: false,
- type: "",
- characterSet: "",
- collation: "",
- comment: "",
- userComment: "",
- generation: undefined,
- isIdentity: false,
- identityGeneration: ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED,
- identitySeed: Long.ZERO,
- identityIncrement: Long.ZERO,
- defaultConstraintName: "",
- };
-}
-
-export const ColumnMetadata: MessageFns<ColumnMetadata> = {
- encode(message: ColumnMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.position !== 0) {
- writer.uint32(16).int32(message.position);
- }
- if (message.hasDefault !== false) {
- writer.uint32(24).bool(message.hasDefault);
- }
- if (message.defaultNull !== false) {
- writer.uint32(32).bool(message.defaultNull);
- }
- if (message.defaultString !== "") {
- writer.uint32(42).string(message.defaultString);
- }
- if (message.defaultExpression !== "") {
- writer.uint32(50).string(message.defaultExpression);
- }
- if (message.defaultOnNull !== false) {
- writer.uint32(144).bool(message.defaultOnNull);
- }
- if (message.onUpdate !== "") {
- writer.uint32(122).string(message.onUpdate);
- }
- if (message.nullable !== false) {
- writer.uint32(56).bool(message.nullable);
- }
- if (message.type !== "") {
- writer.uint32(66).string(message.type);
- }
- if (message.characterSet !== "") {
- writer.uint32(74).string(message.characterSet);
- }
- if (message.collation !== "") {
- writer.uint32(82).string(message.collation);
- }
- if (message.comment !== "") {
- writer.uint32(90).string(message.comment);
- }
- if (message.userComment !== "") {
- writer.uint32(106).string(message.userComment);
- }
- if (message.generation !== undefined) {
- GenerationMetadata.encode(message.generation, writer.uint32(130).fork()).join();
- }
- if (message.isIdentity !== false) {
- writer.uint32(152).bool(message.isIdentity);
- }
- if (message.identityGeneration !== ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED) {
- writer.uint32(136).int32(columnMetadata_IdentityGenerationToNumber(message.identityGeneration));
- }
- if (!message.identitySeed.equals(Long.ZERO)) {
- writer.uint32(160).int64(message.identitySeed.toString());
- }
- if (!message.identityIncrement.equals(Long.ZERO)) {
- writer.uint32(168).int64(message.identityIncrement.toString());
- }
- if (message.defaultConstraintName !== "") {
- writer.uint32(178).string(message.defaultConstraintName);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ColumnMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseColumnMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.position = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.hasDefault = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.defaultNull = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.defaultString = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.defaultExpression = reader.string();
- continue;
- }
- case 18: {
- if (tag !== 144) {
- break;
- }
-
- message.defaultOnNull = reader.bool();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.onUpdate = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.nullable = reader.bool();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.type = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.characterSet = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.collation = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.userComment = reader.string();
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.generation = GenerationMetadata.decode(reader, reader.uint32());
- continue;
- }
- case 19: {
- if (tag !== 152) {
- break;
- }
-
- message.isIdentity = reader.bool();
- continue;
- }
- case 17: {
- if (tag !== 136) {
- break;
- }
-
- message.identityGeneration = columnMetadata_IdentityGenerationFromJSON(reader.int32());
- continue;
- }
- case 20: {
- if (tag !== 160) {
- break;
- }
-
- message.identitySeed = Long.fromString(reader.int64().toString());
- continue;
- }
- case 21: {
- if (tag !== 168) {
- break;
- }
-
- message.identityIncrement = Long.fromString(reader.int64().toString());
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- message.defaultConstraintName = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ColumnMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- position: isSet(object.position) ? globalThis.Number(object.position) : 0,
- hasDefault: isSet(object.hasDefault) ? globalThis.Boolean(object.hasDefault) : false,
- defaultNull: isSet(object.defaultNull) ? globalThis.Boolean(object.defaultNull) : false,
- defaultString: isSet(object.defaultString) ? globalThis.String(object.defaultString) : "",
- defaultExpression: isSet(object.defaultExpression) ? globalThis.String(object.defaultExpression) : "",
- defaultOnNull: isSet(object.defaultOnNull) ? globalThis.Boolean(object.defaultOnNull) : false,
- onUpdate: isSet(object.onUpdate) ? globalThis.String(object.onUpdate) : "",
- nullable: isSet(object.nullable) ? globalThis.Boolean(object.nullable) : false,
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
- collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- userComment: isSet(object.userComment) ? globalThis.String(object.userComment) : "",
- generation: isSet(object.generation) ? GenerationMetadata.fromJSON(object.generation) : undefined,
- isIdentity: isSet(object.isIdentity) ? globalThis.Boolean(object.isIdentity) : false,
- identityGeneration: isSet(object.identityGeneration)
- ? columnMetadata_IdentityGenerationFromJSON(object.identityGeneration)
- : ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED,
- identitySeed: isSet(object.identitySeed) ? Long.fromValue(object.identitySeed) : Long.ZERO,
- identityIncrement: isSet(object.identityIncrement) ? Long.fromValue(object.identityIncrement) : Long.ZERO,
- defaultConstraintName: isSet(object.defaultConstraintName) ? globalThis.String(object.defaultConstraintName) : "",
- };
- },
-
- toJSON(message: ColumnMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.position !== 0) {
- obj.position = Math.round(message.position);
- }
- if (message.hasDefault !== false) {
- obj.hasDefault = message.hasDefault;
- }
- if (message.defaultNull !== false) {
- obj.defaultNull = message.defaultNull;
- }
- if (message.defaultString !== "") {
- obj.defaultString = message.defaultString;
- }
- if (message.defaultExpression !== "") {
- obj.defaultExpression = message.defaultExpression;
- }
- if (message.defaultOnNull !== false) {
- obj.defaultOnNull = message.defaultOnNull;
- }
- if (message.onUpdate !== "") {
- obj.onUpdate = message.onUpdate;
- }
- if (message.nullable !== false) {
- obj.nullable = message.nullable;
- }
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.characterSet !== "") {
- obj.characterSet = message.characterSet;
- }
- if (message.collation !== "") {
- obj.collation = message.collation;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.userComment !== "") {
- obj.userComment = message.userComment;
- }
- if (message.generation !== undefined) {
- obj.generation = GenerationMetadata.toJSON(message.generation);
- }
- if (message.isIdentity !== false) {
- obj.isIdentity = message.isIdentity;
- }
- if (message.identityGeneration !== ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED) {
- obj.identityGeneration = columnMetadata_IdentityGenerationToJSON(message.identityGeneration);
- }
- if (!message.identitySeed.equals(Long.ZERO)) {
- obj.identitySeed = (message.identitySeed || Long.ZERO).toString();
- }
- if (!message.identityIncrement.equals(Long.ZERO)) {
- obj.identityIncrement = (message.identityIncrement || Long.ZERO).toString();
- }
- if (message.defaultConstraintName !== "") {
- obj.defaultConstraintName = message.defaultConstraintName;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ColumnMetadata>): ColumnMetadata {
- return ColumnMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ColumnMetadata>): ColumnMetadata {
- const message = createBaseColumnMetadata();
- message.name = object.name ?? "";
- message.position = object.position ?? 0;
- message.hasDefault = object.hasDefault ?? false;
- message.defaultNull = object.defaultNull ?? false;
- message.defaultString = object.defaultString ?? "";
- message.defaultExpression = object.defaultExpression ?? "";
- message.defaultOnNull = object.defaultOnNull ?? false;
- message.onUpdate = object.onUpdate ?? "";
- message.nullable = object.nullable ?? false;
- message.type = object.type ?? "";
- message.characterSet = object.characterSet ?? "";
- message.collation = object.collation ?? "";
- message.comment = object.comment ?? "";
- message.userComment = object.userComment ?? "";
- message.generation = (object.generation !== undefined && object.generation !== null)
- ? GenerationMetadata.fromPartial(object.generation)
- : undefined;
- message.isIdentity = object.isIdentity ?? false;
- message.identityGeneration = object.identityGeneration ??
- ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED;
- message.identitySeed = (object.identitySeed !== undefined && object.identitySeed !== null)
- ? Long.fromValue(object.identitySeed)
- : Long.ZERO;
- message.identityIncrement = (object.identityIncrement !== undefined && object.identityIncrement !== null)
- ? Long.fromValue(object.identityIncrement)
- : Long.ZERO;
- message.defaultConstraintName = object.defaultConstraintName ?? "";
- return message;
- },
-};
-
-function createBaseGenerationMetadata(): GenerationMetadata {
- return { type: GenerationMetadata_Type.TYPE_UNSPECIFIED, expression: "" };
-}
-
-export const GenerationMetadata: MessageFns<GenerationMetadata> = {
- encode(message: GenerationMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== GenerationMetadata_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(generationMetadata_TypeToNumber(message.type));
- }
- if (message.expression !== "") {
- writer.uint32(18).string(message.expression);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GenerationMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGenerationMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = generationMetadata_TypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.expression = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GenerationMetadata {
- return {
- type: isSet(object.type)
- ? generationMetadata_TypeFromJSON(object.type)
- : GenerationMetadata_Type.TYPE_UNSPECIFIED,
- expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
- };
- },
-
- toJSON(message: GenerationMetadata): unknown {
- const obj: any = {};
- if (message.type !== GenerationMetadata_Type.TYPE_UNSPECIFIED) {
- obj.type = generationMetadata_TypeToJSON(message.type);
- }
- if (message.expression !== "") {
- obj.expression = message.expression;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GenerationMetadata>): GenerationMetadata {
- return GenerationMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GenerationMetadata>): GenerationMetadata {
- const message = createBaseGenerationMetadata();
- message.type = object.type ?? GenerationMetadata_Type.TYPE_UNSPECIFIED;
- message.expression = object.expression ?? "";
- return message;
- },
-};
-
-function createBaseViewMetadata(): ViewMetadata {
- return { name: "", definition: "", comment: "", dependencyColumns: [], columns: [], triggers: [], skipDump: false };
-}
-
-export const ViewMetadata: MessageFns<ViewMetadata> = {
- encode(message: ViewMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- if (message.comment !== "") {
- writer.uint32(26).string(message.comment);
- }
- for (const v of message.dependencyColumns) {
- DependencyColumn.encode(v!, writer.uint32(34).fork()).join();
- }
- for (const v of message.columns) {
- ColumnMetadata.encode(v!, writer.uint32(42).fork()).join();
- }
- for (const v of message.triggers) {
- TriggerMetadata.encode(v!, writer.uint32(50).fork()).join();
- }
- if (message.skipDump !== false) {
- writer.uint32(56).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ViewMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseViewMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.dependencyColumns.push(DependencyColumn.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.columns.push(ColumnMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ViewMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- dependencyColumns: globalThis.Array.isArray(object?.dependencyColumns)
- ? object.dependencyColumns.map((e: any) => DependencyColumn.fromJSON(e))
- : [],
- columns: globalThis.Array.isArray(object?.columns)
- ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
- : [],
- triggers: globalThis.Array.isArray(object?.triggers)
- ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
- : [],
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: ViewMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.dependencyColumns?.length) {
- obj.dependencyColumns = message.dependencyColumns.map((e) => DependencyColumn.toJSON(e));
- }
- if (message.columns?.length) {
- obj.columns = message.columns.map((e) => ColumnMetadata.toJSON(e));
- }
- if (message.triggers?.length) {
- obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ViewMetadata>): ViewMetadata {
- return ViewMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ViewMetadata>): ViewMetadata {
- const message = createBaseViewMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- message.comment = object.comment ?? "";
- message.dependencyColumns = object.dependencyColumns?.map((e) => DependencyColumn.fromPartial(e)) || [];
- message.columns = object.columns?.map((e) => ColumnMetadata.fromPartial(e)) || [];
- message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseDependencyColumn(): DependencyColumn {
- return { schema: "", table: "", column: "" };
-}
-
-export const DependencyColumn: MessageFns<DependencyColumn> = {
- encode(message: DependencyColumn, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.schema !== "") {
- writer.uint32(10).string(message.schema);
- }
- if (message.table !== "") {
- writer.uint32(18).string(message.table);
- }
- if (message.column !== "") {
- writer.uint32(26).string(message.column);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DependencyColumn {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDependencyColumn();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.column = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DependencyColumn {
- return {
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- column: isSet(object.column) ? globalThis.String(object.column) : "",
- };
- },
-
- toJSON(message: DependencyColumn): unknown {
- const obj: any = {};
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- if (message.column !== "") {
- obj.column = message.column;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DependencyColumn>): DependencyColumn {
- return DependencyColumn.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DependencyColumn>): DependencyColumn {
- const message = createBaseDependencyColumn();
- message.schema = object.schema ?? "";
- message.table = object.table ?? "";
- message.column = object.column ?? "";
- return message;
- },
-};
-
-function createBaseMaterializedViewMetadata(): MaterializedViewMetadata {
- return { name: "", definition: "", comment: "", dependencyColumns: [], triggers: [], indexes: [], skipDump: false };
-}
-
-export const MaterializedViewMetadata: MessageFns<MaterializedViewMetadata> = {
- encode(message: MaterializedViewMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- if (message.comment !== "") {
- writer.uint32(26).string(message.comment);
- }
- for (const v of message.dependencyColumns) {
- DependencyColumn.encode(v!, writer.uint32(34).fork()).join();
- }
- for (const v of message.triggers) {
- TriggerMetadata.encode(v!, writer.uint32(42).fork()).join();
- }
- for (const v of message.indexes) {
- IndexMetadata.encode(v!, writer.uint32(50).fork()).join();
- }
- if (message.skipDump !== false) {
- writer.uint32(56).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MaterializedViewMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMaterializedViewMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.dependencyColumns.push(DependencyColumn.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.indexes.push(IndexMetadata.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MaterializedViewMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- dependencyColumns: globalThis.Array.isArray(object?.dependencyColumns)
- ? object.dependencyColumns.map((e: any) => DependencyColumn.fromJSON(e))
- : [],
- triggers: globalThis.Array.isArray(object?.triggers)
- ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
- : [],
- indexes: globalThis.Array.isArray(object?.indexes)
- ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
- : [],
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: MaterializedViewMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.dependencyColumns?.length) {
- obj.dependencyColumns = message.dependencyColumns.map((e) => DependencyColumn.toJSON(e));
- }
- if (message.triggers?.length) {
- obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));
- }
- if (message.indexes?.length) {
- obj.indexes = message.indexes.map((e) => IndexMetadata.toJSON(e));
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<MaterializedViewMetadata>): MaterializedViewMetadata {
- return MaterializedViewMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MaterializedViewMetadata>): MaterializedViewMetadata {
- const message = createBaseMaterializedViewMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- message.comment = object.comment ?? "";
- message.dependencyColumns = object.dependencyColumns?.map((e) => DependencyColumn.fromPartial(e)) || [];
- message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];
- message.indexes = object.indexes?.map((e) => IndexMetadata.fromPartial(e)) || [];
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseDependencyTable(): DependencyTable {
- return { schema: "", table: "" };
-}
-
-export const DependencyTable: MessageFns<DependencyTable> = {
- encode(message: DependencyTable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.schema !== "") {
- writer.uint32(10).string(message.schema);
- }
- if (message.table !== "") {
- writer.uint32(18).string(message.table);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DependencyTable {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDependencyTable();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DependencyTable {
- return {
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- };
- },
-
- toJSON(message: DependencyTable): unknown {
- const obj: any = {};
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DependencyTable>): DependencyTable {
- return DependencyTable.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DependencyTable>): DependencyTable {
- const message = createBaseDependencyTable();
- message.schema = object.schema ?? "";
- message.table = object.table ?? "";
- return message;
- },
-};
-
-function createBaseFunctionMetadata(): FunctionMetadata {
- return {
- name: "",
- definition: "",
- signature: "",
- characterSetClient: "",
- collationConnection: "",
- databaseCollation: "",
- sqlMode: "",
- comment: "",
- dependencyTables: [],
- skipDump: false,
- };
-}
-
-export const FunctionMetadata: MessageFns<FunctionMetadata> = {
- encode(message: FunctionMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- if (message.signature !== "") {
- writer.uint32(26).string(message.signature);
- }
- if (message.characterSetClient !== "") {
- writer.uint32(34).string(message.characterSetClient);
- }
- if (message.collationConnection !== "") {
- writer.uint32(42).string(message.collationConnection);
- }
- if (message.databaseCollation !== "") {
- writer.uint32(50).string(message.databaseCollation);
- }
- if (message.sqlMode !== "") {
- writer.uint32(58).string(message.sqlMode);
- }
- if (message.comment !== "") {
- writer.uint32(66).string(message.comment);
- }
- for (const v of message.dependencyTables) {
- DependencyTable.encode(v!, writer.uint32(74).fork()).join();
- }
- if (message.skipDump !== false) {
- writer.uint32(80).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FunctionMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFunctionMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.signature = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.characterSetClient = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.collationConnection = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.databaseCollation = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.sqlMode = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.dependencyTables.push(DependencyTable.decode(reader, reader.uint32()));
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FunctionMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- signature: isSet(object.signature) ? globalThis.String(object.signature) : "",
- characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
- collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
- databaseCollation: isSet(object.databaseCollation) ? globalThis.String(object.databaseCollation) : "",
- sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- dependencyTables: globalThis.Array.isArray(object?.dependencyTables)
- ? object.dependencyTables.map((e: any) => DependencyTable.fromJSON(e))
- : [],
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: FunctionMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.signature !== "") {
- obj.signature = message.signature;
- }
- if (message.characterSetClient !== "") {
- obj.characterSetClient = message.characterSetClient;
- }
- if (message.collationConnection !== "") {
- obj.collationConnection = message.collationConnection;
- }
- if (message.databaseCollation !== "") {
- obj.databaseCollation = message.databaseCollation;
- }
- if (message.sqlMode !== "") {
- obj.sqlMode = message.sqlMode;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.dependencyTables?.length) {
- obj.dependencyTables = message.dependencyTables.map((e) => DependencyTable.toJSON(e));
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<FunctionMetadata>): FunctionMetadata {
- return FunctionMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FunctionMetadata>): FunctionMetadata {
- const message = createBaseFunctionMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- message.signature = object.signature ?? "";
- message.characterSetClient = object.characterSetClient ?? "";
- message.collationConnection = object.collationConnection ?? "";
- message.databaseCollation = object.databaseCollation ?? "";
- message.sqlMode = object.sqlMode ?? "";
- message.comment = object.comment ?? "";
- message.dependencyTables = object.dependencyTables?.map((e) => DependencyTable.fromPartial(e)) || [];
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBaseProcedureMetadata(): ProcedureMetadata {
- return {
- name: "",
- definition: "",
- signature: "",
- characterSetClient: "",
- collationConnection: "",
- databaseCollation: "",
- sqlMode: "",
- comment: "",
- skipDump: false,
- };
-}
-
-export const ProcedureMetadata: MessageFns<ProcedureMetadata> = {
- encode(message: ProcedureMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- if (message.signature !== "") {
- writer.uint32(26).string(message.signature);
- }
- if (message.characterSetClient !== "") {
- writer.uint32(34).string(message.characterSetClient);
- }
- if (message.collationConnection !== "") {
- writer.uint32(42).string(message.collationConnection);
- }
- if (message.databaseCollation !== "") {
- writer.uint32(50).string(message.databaseCollation);
- }
- if (message.sqlMode !== "") {
- writer.uint32(58).string(message.sqlMode);
- }
- if (message.comment !== "") {
- writer.uint32(74).string(message.comment);
- }
- if (message.skipDump !== false) {
- writer.uint32(64).bool(message.skipDump);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ProcedureMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseProcedureMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.signature = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.characterSetClient = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.collationConnection = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.databaseCollation = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.sqlMode = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.skipDump = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ProcedureMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- signature: isSet(object.signature) ? globalThis.String(object.signature) : "",
- characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
- collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
- databaseCollation: isSet(object.databaseCollation) ? globalThis.String(object.databaseCollation) : "",
- sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
- };
- },
-
- toJSON(message: ProcedureMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.signature !== "") {
- obj.signature = message.signature;
- }
- if (message.characterSetClient !== "") {
- obj.characterSetClient = message.characterSetClient;
- }
- if (message.collationConnection !== "") {
- obj.collationConnection = message.collationConnection;
- }
- if (message.databaseCollation !== "") {
- obj.databaseCollation = message.databaseCollation;
- }
- if (message.sqlMode !== "") {
- obj.sqlMode = message.sqlMode;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.skipDump !== false) {
- obj.skipDump = message.skipDump;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ProcedureMetadata>): ProcedureMetadata {
- return ProcedureMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ProcedureMetadata>): ProcedureMetadata {
- const message = createBaseProcedureMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- message.signature = object.signature ?? "";
- message.characterSetClient = object.characterSetClient ?? "";
- message.collationConnection = object.collationConnection ?? "";
- message.databaseCollation = object.databaseCollation ?? "";
- message.sqlMode = object.sqlMode ?? "";
- message.comment = object.comment ?? "";
- message.skipDump = object.skipDump ?? false;
- return message;
- },
-};
-
-function createBasePackageMetadata(): PackageMetadata {
- return { name: "", definition: "" };
-}
-
-export const PackageMetadata: MessageFns<PackageMetadata> = {
- encode(message: PackageMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.definition !== "") {
- writer.uint32(18).string(message.definition);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PackageMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePackageMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PackageMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- };
- },
-
- toJSON(message: PackageMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- return obj;
- },
-
- create(base?: DeepPartial<PackageMetadata>): PackageMetadata {
- return PackageMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PackageMetadata>): PackageMetadata {
- const message = createBasePackageMetadata();
- message.name = object.name ?? "";
- message.definition = object.definition ?? "";
- return message;
- },
-};
-
-function createBaseTaskMetadata(): TaskMetadata {
- return {
- name: "",
- id: "",
- owner: "",
- comment: "",
- warehouse: "",
- schedule: "",
- predecessors: [],
- state: TaskMetadata_State.STATE_UNSPECIFIED,
- condition: "",
- definition: "",
- };
-}
-
-export const TaskMetadata: MessageFns<TaskMetadata> = {
- encode(message: TaskMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.id !== "") {
- writer.uint32(18).string(message.id);
- }
- if (message.owner !== "") {
- writer.uint32(26).string(message.owner);
- }
- if (message.comment !== "") {
- writer.uint32(34).string(message.comment);
- }
- if (message.warehouse !== "") {
- writer.uint32(42).string(message.warehouse);
- }
- if (message.schedule !== "") {
- writer.uint32(50).string(message.schedule);
- }
- for (const v of message.predecessors) {
- writer.uint32(58).string(v!);
- }
- if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
- writer.uint32(64).int32(taskMetadata_StateToNumber(message.state));
- }
- if (message.condition !== "") {
- writer.uint32(74).string(message.condition);
- }
- if (message.definition !== "") {
- writer.uint32(82).string(message.definition);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.warehouse = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.schedule = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.predecessors.push(reader.string());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.state = taskMetadata_StateFromJSON(reader.int32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.condition = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- warehouse: isSet(object.warehouse) ? globalThis.String(object.warehouse) : "",
- schedule: isSet(object.schedule) ? globalThis.String(object.schedule) : "",
- predecessors: globalThis.Array.isArray(object?.predecessors)
- ? object.predecessors.map((e: any) => globalThis.String(e))
- : [],
- state: isSet(object.state) ? taskMetadata_StateFromJSON(object.state) : TaskMetadata_State.STATE_UNSPECIFIED,
- condition: isSet(object.condition) ? globalThis.String(object.condition) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- };
- },
-
- toJSON(message: TaskMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.warehouse !== "") {
- obj.warehouse = message.warehouse;
- }
- if (message.schedule !== "") {
- obj.schedule = message.schedule;
- }
- if (message.predecessors?.length) {
- obj.predecessors = message.predecessors;
- }
- if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
- obj.state = taskMetadata_StateToJSON(message.state);
- }
- if (message.condition !== "") {
- obj.condition = message.condition;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskMetadata>): TaskMetadata {
- return TaskMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskMetadata>): TaskMetadata {
- const message = createBaseTaskMetadata();
- message.name = object.name ?? "";
- message.id = object.id ?? "";
- message.owner = object.owner ?? "";
- message.comment = object.comment ?? "";
- message.warehouse = object.warehouse ?? "";
- message.schedule = object.schedule ?? "";
- message.predecessors = object.predecessors?.map((e) => e) || [];
- message.state = object.state ?? TaskMetadata_State.STATE_UNSPECIFIED;
- message.condition = object.condition ?? "";
- message.definition = object.definition ?? "";
- return message;
- },
-};
-
-function createBaseStreamMetadata(): StreamMetadata {
- return {
- name: "",
- tableName: "",
- owner: "",
- comment: "",
- type: StreamMetadata_Type.TYPE_UNSPECIFIED,
- stale: false,
- mode: StreamMetadata_Mode.MODE_UNSPECIFIED,
- definition: "",
- };
-}
-
-export const StreamMetadata: MessageFns<StreamMetadata> = {
- encode(message: StreamMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.tableName !== "") {
- writer.uint32(18).string(message.tableName);
- }
- if (message.owner !== "") {
- writer.uint32(26).string(message.owner);
- }
- if (message.comment !== "") {
- writer.uint32(34).string(message.comment);
- }
- if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
- writer.uint32(40).int32(streamMetadata_TypeToNumber(message.type));
- }
- if (message.stale !== false) {
- writer.uint32(48).bool(message.stale);
- }
- if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
- writer.uint32(56).int32(streamMetadata_ModeToNumber(message.mode));
- }
- if (message.definition !== "") {
- writer.uint32(66).string(message.definition);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): StreamMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseStreamMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tableName = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.type = streamMetadata_TypeFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.stale = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.mode = streamMetadata_ModeFromJSON(reader.int32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): StreamMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- type: isSet(object.type) ? streamMetadata_TypeFromJSON(object.type) : StreamMetadata_Type.TYPE_UNSPECIFIED,
- stale: isSet(object.stale) ? globalThis.Boolean(object.stale) : false,
- mode: isSet(object.mode) ? streamMetadata_ModeFromJSON(object.mode) : StreamMetadata_Mode.MODE_UNSPECIFIED,
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- };
- },
-
- toJSON(message: StreamMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.tableName !== "") {
- obj.tableName = message.tableName;
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
- obj.type = streamMetadata_TypeToJSON(message.type);
- }
- if (message.stale !== false) {
- obj.stale = message.stale;
- }
- if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
- obj.mode = streamMetadata_ModeToJSON(message.mode);
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- return obj;
- },
-
- create(base?: DeepPartial<StreamMetadata>): StreamMetadata {
- return StreamMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<StreamMetadata>): StreamMetadata {
- const message = createBaseStreamMetadata();
- message.name = object.name ?? "";
- message.tableName = object.tableName ?? "";
- message.owner = object.owner ?? "";
- message.comment = object.comment ?? "";
- message.type = object.type ?? StreamMetadata_Type.TYPE_UNSPECIFIED;
- message.stale = object.stale ?? false;
- message.mode = object.mode ?? StreamMetadata_Mode.MODE_UNSPECIFIED;
- message.definition = object.definition ?? "";
- return message;
- },
-};
-
-function createBaseIndexMetadata(): IndexMetadata {
- return {
- name: "",
- expressions: [],
- keyLength: [],
- descending: [],
- type: "",
- unique: false,
- primary: false,
- visible: false,
- comment: "",
- definition: "",
- parentIndexSchema: "",
- parentIndexName: "",
- granularity: Long.ZERO,
- isConstraint: false,
- };
-}
-
-export const IndexMetadata: MessageFns<IndexMetadata> = {
- encode(message: IndexMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.expressions) {
- writer.uint32(18).string(v!);
- }
- writer.uint32(74).fork();
- for (const v of message.keyLength) {
- writer.int64(v.toString());
- }
- writer.join();
- writer.uint32(82).fork();
- for (const v of message.descending) {
- writer.bool(v);
- }
- writer.join();
- if (message.type !== "") {
- writer.uint32(26).string(message.type);
- }
- if (message.unique !== false) {
- writer.uint32(32).bool(message.unique);
- }
- if (message.primary !== false) {
- writer.uint32(40).bool(message.primary);
- }
- if (message.visible !== false) {
- writer.uint32(48).bool(message.visible);
- }
- if (message.comment !== "") {
- writer.uint32(58).string(message.comment);
- }
- if (message.definition !== "") {
- writer.uint32(66).string(message.definition);
- }
- if (message.parentIndexSchema !== "") {
- writer.uint32(90).string(message.parentIndexSchema);
- }
- if (message.parentIndexName !== "") {
- writer.uint32(98).string(message.parentIndexName);
- }
- if (!message.granularity.equals(Long.ZERO)) {
- writer.uint32(104).int64(message.granularity.toString());
- }
- if (message.isConstraint !== false) {
- writer.uint32(112).bool(message.isConstraint);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IndexMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIndexMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.expressions.push(reader.string());
- continue;
- }
- case 9: {
- if (tag === 72) {
- message.keyLength.push(Long.fromString(reader.int64().toString()));
-
- continue;
- }
-
- if (tag === 74) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.keyLength.push(Long.fromString(reader.int64().toString()));
- }
-
- continue;
- }
-
- break;
- }
- case 10: {
- if (tag === 80) {
- message.descending.push(reader.bool());
-
- continue;
- }
-
- if (tag === 82) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.descending.push(reader.bool());
- }
-
- continue;
- }
-
- break;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.type = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.unique = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.primary = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.visible = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.definition = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.parentIndexSchema = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.parentIndexName = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 104) {
- break;
- }
-
- message.granularity = Long.fromString(reader.int64().toString());
- continue;
- }
- case 14: {
- if (tag !== 112) {
- break;
- }
-
- message.isConstraint = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IndexMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- expressions: globalThis.Array.isArray(object?.expressions)
- ? object.expressions.map((e: any) => globalThis.String(e))
- : [],
- keyLength: globalThis.Array.isArray(object?.keyLength) ? object.keyLength.map((e: any) => Long.fromValue(e)) : [],
- descending: globalThis.Array.isArray(object?.descending)
- ? object.descending.map((e: any) => globalThis.Boolean(e))
- : [],
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- unique: isSet(object.unique) ? globalThis.Boolean(object.unique) : false,
- primary: isSet(object.primary) ? globalThis.Boolean(object.primary) : false,
- visible: isSet(object.visible) ? globalThis.Boolean(object.visible) : false,
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
- parentIndexSchema: isSet(object.parentIndexSchema) ? globalThis.String(object.parentIndexSchema) : "",
- parentIndexName: isSet(object.parentIndexName) ? globalThis.String(object.parentIndexName) : "",
- granularity: isSet(object.granularity) ? Long.fromValue(object.granularity) : Long.ZERO,
- isConstraint: isSet(object.isConstraint) ? globalThis.Boolean(object.isConstraint) : false,
- };
- },
-
- toJSON(message: IndexMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.expressions?.length) {
- obj.expressions = message.expressions;
- }
- if (message.keyLength?.length) {
- obj.keyLength = message.keyLength.map((e) => (e || Long.ZERO).toString());
- }
- if (message.descending?.length) {
- obj.descending = message.descending;
- }
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.unique !== false) {
- obj.unique = message.unique;
- }
- if (message.primary !== false) {
- obj.primary = message.primary;
- }
- if (message.visible !== false) {
- obj.visible = message.visible;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.definition !== "") {
- obj.definition = message.definition;
- }
- if (message.parentIndexSchema !== "") {
- obj.parentIndexSchema = message.parentIndexSchema;
- }
- if (message.parentIndexName !== "") {
- obj.parentIndexName = message.parentIndexName;
- }
- if (!message.granularity.equals(Long.ZERO)) {
- obj.granularity = (message.granularity || Long.ZERO).toString();
- }
- if (message.isConstraint !== false) {
- obj.isConstraint = message.isConstraint;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IndexMetadata>): IndexMetadata {
- return IndexMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IndexMetadata>): IndexMetadata {
- const message = createBaseIndexMetadata();
- message.name = object.name ?? "";
- message.expressions = object.expressions?.map((e) => e) || [];
- message.keyLength = object.keyLength?.map((e) => Long.fromValue(e)) || [];
- message.descending = object.descending?.map((e) => e) || [];
- message.type = object.type ?? "";
- message.unique = object.unique ?? false;
- message.primary = object.primary ?? false;
- message.visible = object.visible ?? false;
- message.comment = object.comment ?? "";
- message.definition = object.definition ?? "";
- message.parentIndexSchema = object.parentIndexSchema ?? "";
- message.parentIndexName = object.parentIndexName ?? "";
- message.granularity = (object.granularity !== undefined && object.granularity !== null)
- ? Long.fromValue(object.granularity)
- : Long.ZERO;
- message.isConstraint = object.isConstraint ?? false;
- return message;
- },
-};
-
-function createBaseExtensionMetadata(): ExtensionMetadata {
- return { name: "", schema: "", version: "", description: "" };
-}
-
-export const ExtensionMetadata: MessageFns<ExtensionMetadata> = {
- encode(message: ExtensionMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.schema !== "") {
- writer.uint32(18).string(message.schema);
- }
- if (message.version !== "") {
- writer.uint32(26).string(message.version);
- }
- if (message.description !== "") {
- writer.uint32(34).string(message.description);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExtensionMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExtensionMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExtensionMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- };
- },
-
- toJSON(message: ExtensionMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.version !== "") {
- obj.version = message.version;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExtensionMetadata>): ExtensionMetadata {
- return ExtensionMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExtensionMetadata>): ExtensionMetadata {
- const message = createBaseExtensionMetadata();
- message.name = object.name ?? "";
- message.schema = object.schema ?? "";
- message.version = object.version ?? "";
- message.description = object.description ?? "";
- return message;
- },
-};
-
-function createBaseForeignKeyMetadata(): ForeignKeyMetadata {
- return {
- name: "",
- columns: [],
- referencedSchema: "",
- referencedTable: "",
- referencedColumns: [],
- onDelete: "",
- onUpdate: "",
- matchType: "",
- };
-}
-
-export const ForeignKeyMetadata: MessageFns<ForeignKeyMetadata> = {
- encode(message: ForeignKeyMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.columns) {
- writer.uint32(18).string(v!);
- }
- if (message.referencedSchema !== "") {
- writer.uint32(26).string(message.referencedSchema);
- }
- if (message.referencedTable !== "") {
- writer.uint32(34).string(message.referencedTable);
- }
- for (const v of message.referencedColumns) {
- writer.uint32(42).string(v!);
- }
- if (message.onDelete !== "") {
- writer.uint32(50).string(message.onDelete);
- }
- if (message.onUpdate !== "") {
- writer.uint32(58).string(message.onUpdate);
- }
- if (message.matchType !== "") {
- writer.uint32(66).string(message.matchType);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ForeignKeyMetadata {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseForeignKeyMetadata();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.columns.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.referencedSchema = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.referencedTable = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.referencedColumns.push(reader.string());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.onDelete = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.onUpdate = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.matchType = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ForeignKeyMetadata {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- columns: globalThis.Array.isArray(object?.columns) ? object.columns.map((e: any) => globalThis.String(e)) : [],
- referencedSchema: isSet(object.referencedSchema) ? globalThis.String(object.referencedSchema) : "",
- referencedTable: isSet(object.referencedTable) ? globalThis.String(object.referencedTable) : "",
- referencedColumns: globalThis.Array.isArray(object?.referencedColumns)
- ? object.referencedColumns.map((e: any) => globalThis.String(e))
- : [],
- onDelete: isSet(object.onDelete) ? globalThis.String(object.onDelete) : "",
- onUpdate: isSet(object.onUpdate) ? globalThis.String(object.onUpdate) : "",
- matchType: isSet(object.matchType) ? globalThis.String(object.matchType) : "",
- };
- },
-
- toJSON(message: ForeignKeyMetadata): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.columns?.length) {
- obj.columns = message.columns;
- }
- if (message.referencedSchema !== "") {
- obj.referencedSchema = message.referencedSchema;
- }
- if (message.referencedTable !== "") {
- obj.referencedTable = message.referencedTable;
- }
- if (message.referencedColumns?.length) {
- obj.referencedColumns = message.referencedColumns;
- }
- if (message.onDelete !== "") {
- obj.onDelete = message.onDelete;
- }
- if (message.onUpdate !== "") {
- obj.onUpdate = message.onUpdate;
- }
- if (message.matchType !== "") {
- obj.matchType = message.matchType;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ForeignKeyMetadata>): ForeignKeyMetadata {
- return ForeignKeyMetadata.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ForeignKeyMetadata>): ForeignKeyMetadata {
- const message = createBaseForeignKeyMetadata();
- message.name = object.name ?? "";
- message.columns = object.columns?.map((e) => e) || [];
- message.referencedSchema = object.referencedSchema ?? "";
- message.referencedTable = object.referencedTable ?? "";
- message.referencedColumns = object.referencedColumns?.map((e) => e) || [];
- message.onDelete = object.onDelete ?? "";
- message.onUpdate = object.onUpdate ?? "";
- message.matchType = object.matchType ?? "";
- return message;
- },
-};
-
-function createBaseDatabaseSchema(): DatabaseSchema {
- return { schema: "" };
-}
-
-export const DatabaseSchema: MessageFns<DatabaseSchema> = {
- encode(message: DatabaseSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.schema !== "") {
- writer.uint32(10).string(message.schema);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DatabaseSchema {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDatabaseSchema();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DatabaseSchema {
- return { schema: isSet(object.schema) ? globalThis.String(object.schema) : "" };
- },
-
- toJSON(message: DatabaseSchema): unknown {
- const obj: any = {};
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DatabaseSchema>): DatabaseSchema {
- return DatabaseSchema.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DatabaseSchema>): DatabaseSchema {
- const message = createBaseDatabaseSchema();
- message.schema = object.schema ?? "";
- return message;
- },
-};
-
-function createBaseListSecretsRequest(): ListSecretsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListSecretsRequest: MessageFns<ListSecretsRequest> = {
- encode(message: ListSecretsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListSecretsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListSecretsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListSecretsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListSecretsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListSecretsRequest>): ListSecretsRequest {
- return ListSecretsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListSecretsRequest>): ListSecretsRequest {
- const message = createBaseListSecretsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListSecretsResponse(): ListSecretsResponse {
- return { secrets: [], nextPageToken: "" };
-}
-
-export const ListSecretsResponse: MessageFns<ListSecretsResponse> = {
- encode(message: ListSecretsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.secrets) {
- Secret.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListSecretsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListSecretsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.secrets.push(Secret.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListSecretsResponse {
- return {
- secrets: globalThis.Array.isArray(object?.secrets) ? object.secrets.map((e: any) => Secret.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListSecretsResponse): unknown {
- const obj: any = {};
- if (message.secrets?.length) {
- obj.secrets = message.secrets.map((e) => Secret.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListSecretsResponse>): ListSecretsResponse {
- return ListSecretsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListSecretsResponse>): ListSecretsResponse {
- const message = createBaseListSecretsResponse();
- message.secrets = object.secrets?.map((e) => Secret.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateSecretRequest(): UpdateSecretRequest {
- return { secret: undefined, updateMask: undefined, allowMissing: false };
-}
-
-export const UpdateSecretRequest: MessageFns<UpdateSecretRequest> = {
- encode(message: UpdateSecretRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.secret !== undefined) {
- Secret.encode(message.secret, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateSecretRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateSecretRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.secret = Secret.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateSecretRequest {
- return {
- secret: isSet(object.secret) ? Secret.fromJSON(object.secret) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- };
- },
-
- toJSON(message: UpdateSecretRequest): unknown {
- const obj: any = {};
- if (message.secret !== undefined) {
- obj.secret = Secret.toJSON(message.secret);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateSecretRequest>): UpdateSecretRequest {
- return UpdateSecretRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateSecretRequest>): UpdateSecretRequest {
- const message = createBaseUpdateSecretRequest();
- message.secret = (object.secret !== undefined && object.secret !== null)
- ? Secret.fromPartial(object.secret)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.allowMissing = object.allowMissing ?? false;
- return message;
- },
-};
-
-function createBaseDeleteSecretRequest(): DeleteSecretRequest {
- return { name: "" };
-}
-
-export const DeleteSecretRequest: MessageFns<DeleteSecretRequest> = {
- encode(message: DeleteSecretRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteSecretRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteSecretRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteSecretRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteSecretRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteSecretRequest>): DeleteSecretRequest {
- return DeleteSecretRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteSecretRequest>): DeleteSecretRequest {
- const message = createBaseDeleteSecretRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseSecret(): Secret {
- return { name: "", createdTime: undefined, updatedTime: undefined, value: "", description: "" };
-}
-
-export const Secret: MessageFns<Secret> = {
- encode(message: Secret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.createdTime !== undefined) {
- Timestamp.encode(message.createdTime, writer.uint32(18).fork()).join();
- }
- if (message.updatedTime !== undefined) {
- Timestamp.encode(message.updatedTime, writer.uint32(26).fork()).join();
- }
- if (message.value !== "") {
- writer.uint32(34).string(message.value);
- }
- if (message.description !== "") {
- writer.uint32(42).string(message.description);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Secret {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSecret();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.createdTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.updatedTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Secret {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- createdTime: isSet(object.createdTime) ? fromJsonTimestamp(object.createdTime) : undefined,
- updatedTime: isSet(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : undefined,
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- };
- },
-
- toJSON(message: Secret): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.createdTime !== undefined) {
- obj.createdTime = fromTimestamp(message.createdTime).toISOString();
- }
- if (message.updatedTime !== undefined) {
- obj.updatedTime = fromTimestamp(message.updatedTime).toISOString();
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Secret>): Secret {
- return Secret.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Secret>): Secret {
- const message = createBaseSecret();
- message.name = object.name ?? "";
- message.createdTime = (object.createdTime !== undefined && object.createdTime !== null)
- ? Timestamp.fromPartial(object.createdTime)
- : undefined;
- message.updatedTime = (object.updatedTime !== undefined && object.updatedTime !== null)
- ? Timestamp.fromPartial(object.updatedTime)
- : undefined;
- message.value = object.value ?? "";
- message.description = object.description ?? "";
- return message;
- },
-};
-
-function createBaseChangedResources(): ChangedResources {
- return { databases: [] };
-}
-
-export const ChangedResources: MessageFns<ChangedResources> = {
- encode(message: ChangedResources, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- ChangedResourceDatabase.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResources {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResources();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(ChangedResourceDatabase.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResources {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => ChangedResourceDatabase.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ChangedResources): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases.map((e) => ChangedResourceDatabase.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResources>): ChangedResources {
- return ChangedResources.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResources>): ChangedResources {
- const message = createBaseChangedResources();
- message.databases = object.databases?.map((e) => ChangedResourceDatabase.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceDatabase(): ChangedResourceDatabase {
- return { name: "", schemas: [] };
-}
-
-export const ChangedResourceDatabase: MessageFns<ChangedResourceDatabase> = {
- encode(message: ChangedResourceDatabase, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.schemas) {
- ChangedResourceSchema.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceDatabase {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceDatabase();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemas.push(ChangedResourceSchema.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceDatabase {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- schemas: globalThis.Array.isArray(object?.schemas)
- ? object.schemas.map((e: any) => ChangedResourceSchema.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ChangedResourceDatabase): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.schemas?.length) {
- obj.schemas = message.schemas.map((e) => ChangedResourceSchema.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceDatabase>): ChangedResourceDatabase {
- return ChangedResourceDatabase.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceDatabase>): ChangedResourceDatabase {
- const message = createBaseChangedResourceDatabase();
- message.name = object.name ?? "";
- message.schemas = object.schemas?.map((e) => ChangedResourceSchema.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceSchema(): ChangedResourceSchema {
- return { name: "", tables: [], views: [], functions: [], procedures: [] };
-}
-
-export const ChangedResourceSchema: MessageFns<ChangedResourceSchema> = {
- encode(message: ChangedResourceSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.tables) {
- ChangedResourceTable.encode(v!, writer.uint32(18).fork()).join();
- }
- for (const v of message.views) {
- ChangedResourceView.encode(v!, writer.uint32(26).fork()).join();
- }
- for (const v of message.functions) {
- ChangedResourceFunction.encode(v!, writer.uint32(34).fork()).join();
- }
- for (const v of message.procedures) {
- ChangedResourceProcedure.encode(v!, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceSchema {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceSchema();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tables.push(ChangedResourceTable.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.views.push(ChangedResourceView.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.functions.push(ChangedResourceFunction.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.procedures.push(ChangedResourceProcedure.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceSchema {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- tables: globalThis.Array.isArray(object?.tables)
- ? object.tables.map((e: any) => ChangedResourceTable.fromJSON(e))
- : [],
- views: globalThis.Array.isArray(object?.views)
- ? object.views.map((e: any) => ChangedResourceView.fromJSON(e))
- : [],
- functions: globalThis.Array.isArray(object?.functions)
- ? object.functions.map((e: any) => ChangedResourceFunction.fromJSON(e))
- : [],
- procedures: globalThis.Array.isArray(object?.procedures)
- ? object.procedures.map((e: any) => ChangedResourceProcedure.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: ChangedResourceSchema): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.tables?.length) {
- obj.tables = message.tables.map((e) => ChangedResourceTable.toJSON(e));
- }
- if (message.views?.length) {
- obj.views = message.views.map((e) => ChangedResourceView.toJSON(e));
- }
- if (message.functions?.length) {
- obj.functions = message.functions.map((e) => ChangedResourceFunction.toJSON(e));
- }
- if (message.procedures?.length) {
- obj.procedures = message.procedures.map((e) => ChangedResourceProcedure.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceSchema>): ChangedResourceSchema {
- return ChangedResourceSchema.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceSchema>): ChangedResourceSchema {
- const message = createBaseChangedResourceSchema();
- message.name = object.name ?? "";
- message.tables = object.tables?.map((e) => ChangedResourceTable.fromPartial(e)) || [];
- message.views = object.views?.map((e) => ChangedResourceView.fromPartial(e)) || [];
- message.functions = object.functions?.map((e) => ChangedResourceFunction.fromPartial(e)) || [];
- message.procedures = object.procedures?.map((e) => ChangedResourceProcedure.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceTable(): ChangedResourceTable {
- return { name: "", ranges: [] };
-}
-
-export const ChangedResourceTable: MessageFns<ChangedResourceTable> = {
- encode(message: ChangedResourceTable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.ranges) {
- Range.encode(v!, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceTable {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceTable();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.ranges.push(Range.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceTable {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ChangedResourceTable): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.ranges?.length) {
- obj.ranges = message.ranges.map((e) => Range.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceTable>): ChangedResourceTable {
- return ChangedResourceTable.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceTable>): ChangedResourceTable {
- const message = createBaseChangedResourceTable();
- message.name = object.name ?? "";
- message.ranges = object.ranges?.map((e) => Range.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceView(): ChangedResourceView {
- return { name: "", ranges: [] };
-}
-
-export const ChangedResourceView: MessageFns<ChangedResourceView> = {
- encode(message: ChangedResourceView, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.ranges) {
- Range.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceView {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceView();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.ranges.push(Range.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceView {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ChangedResourceView): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.ranges?.length) {
- obj.ranges = message.ranges.map((e) => Range.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceView>): ChangedResourceView {
- return ChangedResourceView.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceView>): ChangedResourceView {
- const message = createBaseChangedResourceView();
- message.name = object.name ?? "";
- message.ranges = object.ranges?.map((e) => Range.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceFunction(): ChangedResourceFunction {
- return { name: "", ranges: [] };
-}
-
-export const ChangedResourceFunction: MessageFns<ChangedResourceFunction> = {
- encode(message: ChangedResourceFunction, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.ranges) {
- Range.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceFunction {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceFunction();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.ranges.push(Range.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceFunction {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ChangedResourceFunction): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.ranges?.length) {
- obj.ranges = message.ranges.map((e) => Range.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceFunction>): ChangedResourceFunction {
- return ChangedResourceFunction.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceFunction>): ChangedResourceFunction {
- const message = createBaseChangedResourceFunction();
- message.name = object.name ?? "";
- message.ranges = object.ranges?.map((e) => Range.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseChangedResourceProcedure(): ChangedResourceProcedure {
- return { name: "", ranges: [] };
-}
-
-export const ChangedResourceProcedure: MessageFns<ChangedResourceProcedure> = {
- encode(message: ChangedResourceProcedure, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.ranges) {
- Range.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangedResourceProcedure {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangedResourceProcedure();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.ranges.push(Range.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangedResourceProcedure {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ChangedResourceProcedure): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.ranges?.length) {
- obj.ranges = message.ranges.map((e) => Range.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangedResourceProcedure>): ChangedResourceProcedure {
- return ChangedResourceProcedure.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangedResourceProcedure>): ChangedResourceProcedure {
- const message = createBaseChangedResourceProcedure();
- message.name = object.name ?? "";
- message.ranges = object.ranges?.map((e) => Range.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseListChangelogsRequest(): ListChangelogsRequest {
- return { parent: "", pageSize: 0, pageToken: "", view: ChangelogView.CHANGELOG_VIEW_UNSPECIFIED, filter: "" };
-}
-
-export const ListChangelogsRequest: MessageFns<ListChangelogsRequest> = {
- encode(message: ListChangelogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.view !== ChangelogView.CHANGELOG_VIEW_UNSPECIFIED) {
- writer.uint32(32).int32(changelogViewToNumber(message.view));
- }
- if (message.filter !== "") {
- writer.uint32(42).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListChangelogsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListChangelogsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.view = changelogViewFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListChangelogsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- view: isSet(object.view) ? changelogViewFromJSON(object.view) : ChangelogView.CHANGELOG_VIEW_UNSPECIFIED,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListChangelogsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.view !== ChangelogView.CHANGELOG_VIEW_UNSPECIFIED) {
- obj.view = changelogViewToJSON(message.view);
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListChangelogsRequest>): ListChangelogsRequest {
- return ListChangelogsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListChangelogsRequest>): ListChangelogsRequest {
- const message = createBaseListChangelogsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.view = object.view ?? ChangelogView.CHANGELOG_VIEW_UNSPECIFIED;
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListChangelogsResponse(): ListChangelogsResponse {
- return { changelogs: [], nextPageToken: "" };
-}
-
-export const ListChangelogsResponse: MessageFns<ListChangelogsResponse> = {
- encode(message: ListChangelogsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.changelogs) {
- Changelog.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListChangelogsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListChangelogsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.changelogs.push(Changelog.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListChangelogsResponse {
- return {
- changelogs: globalThis.Array.isArray(object?.changelogs)
- ? object.changelogs.map((e: any) => Changelog.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListChangelogsResponse): unknown {
- const obj: any = {};
- if (message.changelogs?.length) {
- obj.changelogs = message.changelogs.map((e) => Changelog.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListChangelogsResponse>): ListChangelogsResponse {
- return ListChangelogsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListChangelogsResponse>): ListChangelogsResponse {
- const message = createBaseListChangelogsResponse();
- message.changelogs = object.changelogs?.map((e) => Changelog.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseGetChangelogRequest(): GetChangelogRequest {
- return { name: "", view: ChangelogView.CHANGELOG_VIEW_UNSPECIFIED, sdlFormat: false };
-}
-
-export const GetChangelogRequest: MessageFns<GetChangelogRequest> = {
- encode(message: GetChangelogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.view !== ChangelogView.CHANGELOG_VIEW_UNSPECIFIED) {
- writer.uint32(16).int32(changelogViewToNumber(message.view));
- }
- if (message.sdlFormat !== false) {
- writer.uint32(24).bool(message.sdlFormat);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetChangelogRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetChangelogRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.view = changelogViewFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.sdlFormat = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetChangelogRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view) ? changelogViewFromJSON(object.view) : ChangelogView.CHANGELOG_VIEW_UNSPECIFIED,
- sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
- };
- },
-
- toJSON(message: GetChangelogRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.view !== ChangelogView.CHANGELOG_VIEW_UNSPECIFIED) {
- obj.view = changelogViewToJSON(message.view);
- }
- if (message.sdlFormat !== false) {
- obj.sdlFormat = message.sdlFormat;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetChangelogRequest>): GetChangelogRequest {
- return GetChangelogRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetChangelogRequest>): GetChangelogRequest {
- const message = createBaseGetChangelogRequest();
- message.name = object.name ?? "";
- message.view = object.view ?? ChangelogView.CHANGELOG_VIEW_UNSPECIFIED;
- message.sdlFormat = object.sdlFormat ?? false;
- return message;
- },
-};
-
-function createBaseChangelog(): Changelog {
- return {
- name: "",
- createTime: undefined,
- status: Changelog_Status.STATUS_UNSPECIFIED,
- statement: "",
- statementSize: Long.ZERO,
- statementSheet: "",
- schema: "",
- schemaSize: Long.ZERO,
- prevSchema: "",
- prevSchemaSize: Long.ZERO,
- issue: "",
- taskRun: "",
- version: "",
- revision: "",
- changedResources: undefined,
- type: Changelog_Type.TYPE_UNSPECIFIED,
- };
-}
-
-export const Changelog: MessageFns<Changelog> = {
- encode(message: Changelog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(26).fork()).join();
- }
- if (message.status !== Changelog_Status.STATUS_UNSPECIFIED) {
- writer.uint32(32).int32(changelog_StatusToNumber(message.status));
- }
- if (message.statement !== "") {
- writer.uint32(42).string(message.statement);
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- writer.uint32(48).int64(message.statementSize.toString());
- }
- if (message.statementSheet !== "") {
- writer.uint32(58).string(message.statementSheet);
- }
- if (message.schema !== "") {
- writer.uint32(66).string(message.schema);
- }
- if (!message.schemaSize.equals(Long.ZERO)) {
- writer.uint32(72).int64(message.schemaSize.toString());
- }
- if (message.prevSchema !== "") {
- writer.uint32(82).string(message.prevSchema);
- }
- if (!message.prevSchemaSize.equals(Long.ZERO)) {
- writer.uint32(88).int64(message.prevSchemaSize.toString());
- }
- if (message.issue !== "") {
- writer.uint32(98).string(message.issue);
- }
- if (message.taskRun !== "") {
- writer.uint32(106).string(message.taskRun);
- }
- if (message.version !== "") {
- writer.uint32(114).string(message.version);
- }
- if (message.revision !== "") {
- writer.uint32(122).string(message.revision);
- }
- if (message.changedResources !== undefined) {
- ChangedResources.encode(message.changedResources, writer.uint32(130).fork()).join();
- }
- if (message.type !== Changelog_Type.TYPE_UNSPECIFIED) {
- writer.uint32(136).int32(changelog_TypeToNumber(message.type));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Changelog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.status = changelog_StatusFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.statementSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.statementSheet = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.schemaSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.prevSchema = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.prevSchemaSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.issue = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.taskRun = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.revision = reader.string();
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.changedResources = ChangedResources.decode(reader, reader.uint32());
- continue;
- }
- case 17: {
- if (tag !== 136) {
- break;
- }
-
- message.type = changelog_TypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Changelog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- status: isSet(object.status) ? changelog_StatusFromJSON(object.status) : Changelog_Status.STATUS_UNSPECIFIED,
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
- statementSheet: isSet(object.statementSheet) ? globalThis.String(object.statementSheet) : "",
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- schemaSize: isSet(object.schemaSize) ? Long.fromValue(object.schemaSize) : Long.ZERO,
- prevSchema: isSet(object.prevSchema) ? globalThis.String(object.prevSchema) : "",
- prevSchemaSize: isSet(object.prevSchemaSize) ? Long.fromValue(object.prevSchemaSize) : Long.ZERO,
- issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
- taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- revision: isSet(object.revision) ? globalThis.String(object.revision) : "",
- changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
- type: isSet(object.type) ? changelog_TypeFromJSON(object.type) : Changelog_Type.TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: Changelog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.status !== Changelog_Status.STATUS_UNSPECIFIED) {
- obj.status = changelog_StatusToJSON(message.status);
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- obj.statementSize = (message.statementSize || Long.ZERO).toString();
- }
- if (message.statementSheet !== "") {
- obj.statementSheet = message.statementSheet;
- }
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (!message.schemaSize.equals(Long.ZERO)) {
- obj.schemaSize = (message.schemaSize || Long.ZERO).toString();
- }
- if (message.prevSchema !== "") {
- obj.prevSchema = message.prevSchema;
- }
- if (!message.prevSchemaSize.equals(Long.ZERO)) {
- obj.prevSchemaSize = (message.prevSchemaSize || Long.ZERO).toString();
- }
- if (message.issue !== "") {
- obj.issue = message.issue;
- }
- if (message.taskRun !== "") {
- obj.taskRun = message.taskRun;
- }
- if (message.version !== "") {
- obj.version = message.version;
- }
- if (message.revision !== "") {
- obj.revision = message.revision;
- }
- if (message.changedResources !== undefined) {
- obj.changedResources = ChangedResources.toJSON(message.changedResources);
- }
- if (message.type !== Changelog_Type.TYPE_UNSPECIFIED) {
- obj.type = changelog_TypeToJSON(message.type);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Changelog>): Changelog {
- return Changelog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Changelog>): Changelog {
- const message = createBaseChangelog();
- message.name = object.name ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.status = object.status ?? Changelog_Status.STATUS_UNSPECIFIED;
- message.statement = object.statement ?? "";
- message.statementSize = (object.statementSize !== undefined && object.statementSize !== null)
- ? Long.fromValue(object.statementSize)
- : Long.ZERO;
- message.statementSheet = object.statementSheet ?? "";
- message.schema = object.schema ?? "";
- message.schemaSize = (object.schemaSize !== undefined && object.schemaSize !== null)
- ? Long.fromValue(object.schemaSize)
- : Long.ZERO;
- message.prevSchema = object.prevSchema ?? "";
- message.prevSchemaSize = (object.prevSchemaSize !== undefined && object.prevSchemaSize !== null)
- ? Long.fromValue(object.prevSchemaSize)
- : Long.ZERO;
- message.issue = object.issue ?? "";
- message.taskRun = object.taskRun ?? "";
- message.version = object.version ?? "";
- message.revision = object.revision ?? "";
- message.changedResources = (object.changedResources !== undefined && object.changedResources !== null)
- ? ChangedResources.fromPartial(object.changedResources)
- : undefined;
- message.type = object.type ?? Changelog_Type.TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseGetSchemaStringRequest(): GetSchemaStringRequest {
- return {
- name: "",
- type: GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED,
- schema: "",
- object: "",
- metadata: undefined,
- };
-}
-
-export const GetSchemaStringRequest: MessageFns<GetSchemaStringRequest> = {
- encode(message: GetSchemaStringRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.type !== GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED) {
- writer.uint32(16).int32(getSchemaStringRequest_ObjectTypeToNumber(message.type));
- }
- if (message.schema !== "") {
- writer.uint32(26).string(message.schema);
- }
- if (message.object !== "") {
- writer.uint32(34).string(message.object);
- }
- if (message.metadata !== undefined) {
- DatabaseMetadata.encode(message.metadata, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSchemaStringRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSchemaStringRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.type = getSchemaStringRequest_ObjectTypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.object = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.metadata = DatabaseMetadata.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetSchemaStringRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type)
- ? getSchemaStringRequest_ObjectTypeFromJSON(object.type)
- : GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED,
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- object: isSet(object.object) ? globalThis.String(object.object) : "",
- metadata: isSet(object.metadata) ? DatabaseMetadata.fromJSON(object.metadata) : undefined,
- };
- },
-
- toJSON(message: GetSchemaStringRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.type !== GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED) {
- obj.type = getSchemaStringRequest_ObjectTypeToJSON(message.type);
- }
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.object !== "") {
- obj.object = message.object;
- }
- if (message.metadata !== undefined) {
- obj.metadata = DatabaseMetadata.toJSON(message.metadata);
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetSchemaStringRequest>): GetSchemaStringRequest {
- return GetSchemaStringRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetSchemaStringRequest>): GetSchemaStringRequest {
- const message = createBaseGetSchemaStringRequest();
- message.name = object.name ?? "";
- message.type = object.type ?? GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED;
- message.schema = object.schema ?? "";
- message.object = object.object ?? "";
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
- ? DatabaseMetadata.fromPartial(object.metadata)
- : undefined;
- return message;
- },
-};
-
-function createBaseGetSchemaStringResponse(): GetSchemaStringResponse {
- return { schemaString: "" };
-}
-
-export const GetSchemaStringResponse: MessageFns<GetSchemaStringResponse> = {
- encode(message: GetSchemaStringResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.schemaString !== "") {
- writer.uint32(10).string(message.schemaString);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSchemaStringResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSchemaStringResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.schemaString = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetSchemaStringResponse {
- return { schemaString: isSet(object.schemaString) ? globalThis.String(object.schemaString) : "" };
- },
-
- toJSON(message: GetSchemaStringResponse): unknown {
- const obj: any = {};
- if (message.schemaString !== "") {
- obj.schemaString = message.schemaString;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetSchemaStringResponse>): GetSchemaStringResponse {
- return GetSchemaStringResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetSchemaStringResponse>): GetSchemaStringResponse {
- const message = createBaseGetSchemaStringResponse();
- message.schemaString = object.schemaString ?? "";
- return message;
- },
-};
-
-export type DatabaseServiceDefinition = typeof DatabaseServiceDefinition;
-export const DatabaseServiceDefinition = {
- name: "DatabaseService",
- fullName: "bytebase.v1.DatabaseService",
- methods: {
- /** Permissions required: bb.databases.get */
- getDatabase: {
- name: "GetDatabase",
- requestType: GetDatabaseRequest,
- requestStream: false,
- responseType: Database,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 36,
- 18,
- 34,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.get */
- batchGetDatabases: {
- name: "BatchGetDatabases",
- requestType: BatchGetDatabasesRequest,
- requestStream: false,
- responseType: BatchGetDatabasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 91,
- 90,
- 45,
- 18,
- 43,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 71,
- 101,
- 116,
- 18,
- 42,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 71,
- 101,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.list */
- listDatabases: {
- name: "ListDatabases",
- requestType: ListDatabasesRequest,
- requestStream: false,
- responseType: ListDatabasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([17, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 112,
- 90,
- 36,
- 18,
- 34,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 90,
- 37,
- 18,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 112,
- 97,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 18,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.update */
- updateDatabase: {
- name: "UpdateDatabase",
- requestType: UpdateDatabaseRequest,
- requestStream: false,
- responseType: Database,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 20,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([19, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 55,
- 58,
- 8,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 50,
- 43,
- 47,
- 118,
- 49,
- 47,
- 123,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.update */
- batchUpdateDatabases: {
- name: "BatchUpdateDatabases",
- requestType: BatchUpdateDatabasesRequest,
- requestStream: false,
- responseType: BatchUpdateDatabasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([19, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 51,
- 58,
- 1,
- 42,
- 34,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 85,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.sync */
- syncDatabase: {
- name: "SyncDatabase",
- requestType: SyncDatabaseRequest,
- requestStream: false,
- responseType: SyncDatabaseResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([17, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 115, 121, 110, 99])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 44,
- 58,
- 1,
- 42,
- 34,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 115,
- 121,
- 110,
- 99,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.sync */
- batchSyncDatabases: {
- name: "BatchSyncDatabases",
- requestType: BatchSyncDatabasesRequest,
- requestStream: false,
- responseType: BatchSyncDatabasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([17, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 115, 121, 110, 99])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 58,
- 1,
- 42,
- 34,
- 44,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 83,
- 121,
- 110,
- 99,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.getSchema */
- getDatabaseMetadata: {
- name: "GetDatabaseMetadata",
- requestType: GetDatabaseMetadataRequest,
- requestStream: false,
- responseType: DatabaseMetadata,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- 83,
- 99,
- 104,
- 101,
- 109,
- 97,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 45,
- 18,
- 43,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 109,
- 101,
- 116,
- 97,
- 100,
- 97,
- 116,
- 97,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.getSchema */
- getDatabaseSchema: {
- name: "GetDatabaseSchema",
- requestType: GetDatabaseSchemaRequest,
- requestStream: false,
- responseType: DatabaseSchema,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- 83,
- 99,
- 104,
- 101,
- 109,
- 97,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 18,
- 41,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 115,
- 99,
- 104,
- 101,
- 109,
- 97,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.get */
- diffSchema: {
- name: "DiffSchema",
- requestType: DiffSchemaRequest,
- requestStream: false,
- responseType: DiffSchemaResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 115,
- 58,
- 1,
- 42,
- 90,
- 63,
- 58,
- 1,
- 42,
- 34,
- 58,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 111,
- 103,
- 115,
- 47,
- 42,
- 125,
- 58,
- 100,
- 105,
- 102,
- 102,
- 83,
- 99,
- 104,
- 101,
- 109,
- 97,
- 34,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 100,
- 105,
- 102,
- 102,
- 83,
- 99,
- 104,
- 101,
- 109,
- 97,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databaseSecrets.list */
- listSecrets: {
- name: "ListSecrets",
- requestType: ListSecretsRequest,
- requestStream: false,
- responseType: ListSecretsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 83,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 46,
- 18,
- 44,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 115,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databaseSecrets.update */
- updateSecret: {
- name: "UpdateSecret",
- requestType: UpdateSecretRequest,
- requestStream: false,
- responseType: Secret,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 25,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 83,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 61,
- 58,
- 6,
- 115,
- 101,
- 99,
- 114,
- 101,
- 116,
- 50,
- 51,
- 47,
- 118,
- 49,
- 47,
- 123,
- 115,
- 101,
- 99,
- 114,
- 101,
- 116,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 115,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databaseSecrets.delete */
- deleteSecret: {
- name: "DeleteSecret",
- requestType: DeleteSecretRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 25,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 83,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 46,
- 42,
- 44,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 115,
- 101,
- 99,
- 114,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.changelogs.list */
- listChangelogs: {
- name: "ListChangelogs",
- requestType: ListChangelogsRequest,
- requestStream: false,
- responseType: ListChangelogsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 99, 104, 97, 110, 103, 101, 108, 111, 103, 115, 46, 108, 105, 115, 116]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 18,
- 47,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 111,
- 103,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: changelogs.get */
- getChangelog: {
- name: "GetChangelog",
- requestType: GetChangelogRequest,
- requestStream: false,
- responseType: Changelog,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([17, 98, 98, 46, 99, 104, 97, 110, 103, 101, 108, 111, 103, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 18,
- 47,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 99,
- 104,
- 97,
- 110,
- 103,
- 101,
- 108,
- 111,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: databases.getSchema */
- getSchemaString: {
- name: "GetSchemaString",
- requestType: GetSchemaStringRequest,
- requestStream: false,
- responseType: GetSchemaStringResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 22,
- 98,
- 98,
- 46,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- 83,
- 99,
- 104,
- 101,
- 109,
- 97,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 49,
- 18,
- 47,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 115,
- 99,
- 104,
- 101,
- 109,
- 97,
- 83,
- 116,
- 114,
- 105,
- 110,
- 103,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/group_service.ts b/frontend/src/types/proto/v1/group_service.ts
deleted file mode 100644
index f7e2c8f4c7..0000000000
--- a/frontend/src/types/proto/v1/group_service.ts
+++ /dev/null
@@ -1,1010 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/group_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetGroupRequest {
- /**
- * The name of the group to retrieve.
- * Format: groups/{email}
- */
- name: string;
-}
-
-export interface ListGroupsRequest {
- /**
- * Not used.
- * The maximum number of groups to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 groups will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListGroups` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListGroups` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListGroupsResponse {
- /** The groups from the specified request. */
- groups: Group[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateGroupRequest {
- /** The group to create. */
- group:
- | Group
- | undefined;
- /**
- * The email to use for the group, which will become the final component
- * of the group's resource name.
- */
- groupEmail: string;
-}
-
-export interface UpdateGroupRequest {
- /**
- * The group to update.
- *
- * The group's `name` field is used to identify the group to update.
- * Format: groups/{email}
- */
- group:
- | Group
- | undefined;
- /** The list of fields to update. */
- updateMask:
- | string[]
- | undefined;
- /**
- * If set to true, and the group is not found, a new group will be created.
- * In this situation, `update_mask` is ignored.
- */
- allowMissing: boolean;
-}
-
-export interface DeleteGroupRequest {
- /**
- * The name of the group to delete.
- * Format: groups/{email}
- */
- name: string;
-}
-
-export interface GroupMember {
- /**
- * Member is the principal who belong to this group.
- *
- * Format: users/[email protected]
- */
- member: string;
- role: GroupMember_Role;
-}
-
-export enum GroupMember_Role {
- ROLE_UNSPECIFIED = "ROLE_UNSPECIFIED",
- OWNER = "OWNER",
- MEMBER = "MEMBER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function groupMember_RoleFromJSON(object: any): GroupMember_Role {
- switch (object) {
- case 0:
- case "ROLE_UNSPECIFIED":
- return GroupMember_Role.ROLE_UNSPECIFIED;
- case 1:
- case "OWNER":
- return GroupMember_Role.OWNER;
- case 2:
- case "MEMBER":
- return GroupMember_Role.MEMBER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return GroupMember_Role.UNRECOGNIZED;
- }
-}
-
-export function groupMember_RoleToJSON(object: GroupMember_Role): string {
- switch (object) {
- case GroupMember_Role.ROLE_UNSPECIFIED:
- return "ROLE_UNSPECIFIED";
- case GroupMember_Role.OWNER:
- return "OWNER";
- case GroupMember_Role.MEMBER:
- return "MEMBER";
- case GroupMember_Role.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function groupMember_RoleToNumber(object: GroupMember_Role): number {
- switch (object) {
- case GroupMember_Role.ROLE_UNSPECIFIED:
- return 0;
- case GroupMember_Role.OWNER:
- return 1;
- case GroupMember_Role.MEMBER:
- return 2;
- case GroupMember_Role.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface Group {
- /**
- * The name of the group to retrieve.
- * Format: groups/{group}, group is an email.
- */
- name: string;
- title: string;
- description: string;
- members: GroupMember[];
- /** source means where the group comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID. */
- source: string;
-}
-
-function createBaseGetGroupRequest(): GetGroupRequest {
- return { name: "" };
-}
-
-export const GetGroupRequest: MessageFns<GetGroupRequest> = {
- encode(message: GetGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetGroupRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetGroupRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetGroupRequest>): GetGroupRequest {
- return GetGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetGroupRequest>): GetGroupRequest {
- const message = createBaseGetGroupRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListGroupsRequest(): ListGroupsRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListGroupsRequest: MessageFns<ListGroupsRequest> = {
- encode(message: ListGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListGroupsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListGroupsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListGroupsRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListGroupsRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListGroupsRequest>): ListGroupsRequest {
- return ListGroupsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListGroupsRequest>): ListGroupsRequest {
- const message = createBaseListGroupsRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListGroupsResponse(): ListGroupsResponse {
- return { groups: [], nextPageToken: "" };
-}
-
-export const ListGroupsResponse: MessageFns<ListGroupsResponse> = {
- encode(message: ListGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.groups) {
- Group.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListGroupsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListGroupsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.groups.push(Group.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListGroupsResponse {
- return {
- groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListGroupsResponse): unknown {
- const obj: any = {};
- if (message.groups?.length) {
- obj.groups = message.groups.map((e) => Group.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListGroupsResponse>): ListGroupsResponse {
- return ListGroupsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListGroupsResponse>): ListGroupsResponse {
- const message = createBaseListGroupsResponse();
- message.groups = object.groups?.map((e) => Group.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateGroupRequest(): CreateGroupRequest {
- return { group: undefined, groupEmail: "" };
-}
-
-export const CreateGroupRequest: MessageFns<CreateGroupRequest> = {
- encode(message: CreateGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.group !== undefined) {
- Group.encode(message.group, writer.uint32(10).fork()).join();
- }
- if (message.groupEmail !== "") {
- writer.uint32(18).string(message.groupEmail);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.group = Group.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.groupEmail = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateGroupRequest {
- return {
- group: isSet(object.group) ? Group.fromJSON(object.group) : undefined,
- groupEmail: isSet(object.groupEmail) ? globalThis.String(object.groupEmail) : "",
- };
- },
-
- toJSON(message: CreateGroupRequest): unknown {
- const obj: any = {};
- if (message.group !== undefined) {
- obj.group = Group.toJSON(message.group);
- }
- if (message.groupEmail !== "") {
- obj.groupEmail = message.groupEmail;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateGroupRequest>): CreateGroupRequest {
- return CreateGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateGroupRequest>): CreateGroupRequest {
- const message = createBaseCreateGroupRequest();
- message.group = (object.group !== undefined && object.group !== null) ? Group.fromPartial(object.group) : undefined;
- message.groupEmail = object.groupEmail ?? "";
- return message;
- },
-};
-
-function createBaseUpdateGroupRequest(): UpdateGroupRequest {
- return { group: undefined, updateMask: undefined, allowMissing: false };
-}
-
-export const UpdateGroupRequest: MessageFns<UpdateGroupRequest> = {
- encode(message: UpdateGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.group !== undefined) {
- Group.encode(message.group, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.group = Group.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateGroupRequest {
- return {
- group: isSet(object.group) ? Group.fromJSON(object.group) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- };
- },
-
- toJSON(message: UpdateGroupRequest): unknown {
- const obj: any = {};
- if (message.group !== undefined) {
- obj.group = Group.toJSON(message.group);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateGroupRequest>): UpdateGroupRequest {
- return UpdateGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateGroupRequest>): UpdateGroupRequest {
- const message = createBaseUpdateGroupRequest();
- message.group = (object.group !== undefined && object.group !== null) ? Group.fromPartial(object.group) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.allowMissing = object.allowMissing ?? false;
- return message;
- },
-};
-
-function createBaseDeleteGroupRequest(): DeleteGroupRequest {
- return { name: "" };
-}
-
-export const DeleteGroupRequest: MessageFns<DeleteGroupRequest> = {
- encode(message: DeleteGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteGroupRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteGroupRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteGroupRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteGroupRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteGroupRequest>): DeleteGroupRequest {
- return DeleteGroupRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteGroupRequest>): DeleteGroupRequest {
- const message = createBaseDeleteGroupRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseGroupMember(): GroupMember {
- return { member: "", role: GroupMember_Role.ROLE_UNSPECIFIED };
-}
-
-export const GroupMember: MessageFns<GroupMember> = {
- encode(message: GroupMember, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.member !== "") {
- writer.uint32(10).string(message.member);
- }
- if (message.role !== GroupMember_Role.ROLE_UNSPECIFIED) {
- writer.uint32(16).int32(groupMember_RoleToNumber(message.role));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GroupMember {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGroupMember();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.member = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.role = groupMember_RoleFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GroupMember {
- return {
- member: isSet(object.member) ? globalThis.String(object.member) : "",
- role: isSet(object.role) ? groupMember_RoleFromJSON(object.role) : GroupMember_Role.ROLE_UNSPECIFIED,
- };
- },
-
- toJSON(message: GroupMember): unknown {
- const obj: any = {};
- if (message.member !== "") {
- obj.member = message.member;
- }
- if (message.role !== GroupMember_Role.ROLE_UNSPECIFIED) {
- obj.role = groupMember_RoleToJSON(message.role);
- }
- return obj;
- },
-
- create(base?: DeepPartial<GroupMember>): GroupMember {
- return GroupMember.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GroupMember>): GroupMember {
- const message = createBaseGroupMember();
- message.member = object.member ?? "";
- message.role = object.role ?? GroupMember_Role.ROLE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseGroup(): Group {
- return { name: "", title: "", description: "", members: [], source: "" };
-}
-
-export const Group: MessageFns<Group> = {
- encode(message: Group, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- for (const v of message.members) {
- GroupMember.encode(v!, writer.uint32(42).fork()).join();
- }
- if (message.source !== "") {
- writer.uint32(58).string(message.source);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Group {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGroup();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.members.push(GroupMember.decode(reader, reader.uint32()));
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.source = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Group {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- members: globalThis.Array.isArray(object?.members) ? object.members.map((e: any) => GroupMember.fromJSON(e)) : [],
- source: isSet(object.source) ? globalThis.String(object.source) : "",
- };
- },
-
- toJSON(message: Group): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.members?.length) {
- obj.members = message.members.map((e) => GroupMember.toJSON(e));
- }
- if (message.source !== "") {
- obj.source = message.source;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Group>): Group {
- return Group.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Group>): Group {
- const message = createBaseGroup();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.members = object.members?.map((e) => GroupMember.fromPartial(e)) || [];
- message.source = object.source ?? "";
- return message;
- },
-};
-
-export type GroupServiceDefinition = typeof GroupServiceDefinition;
-export const GroupServiceDefinition = {
- name: "GroupService",
- fullName: "bytebase.v1.GroupService",
- methods: {
- /** Permissions required: bb.groups.get */
- getGroup: {
- name: "GetGroup",
- requestType: GetGroupRequest,
- requestStream: false,
- responseType: Group,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([13, 98, 98, 46, 103, 114, 111, 117, 112, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 21,
- 18,
- 19,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 103,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.groups.list */
- listGroups: {
- name: "ListGroups",
- requestType: ListGroupsRequest,
- requestStream: false,
- responseType: ListGroupsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([14, 98, 98, 46, 103, 114, 111, 117, 112, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([12, 18, 10, 47, 118, 49, 47, 103, 114, 111, 117, 112, 115])],
- },
- },
- },
- /** Permissions required: bb.groups.create */
- createGroup: {
- name: "CreateGroup",
- requestType: CreateGroupRequest,
- requestStream: false,
- responseType: Group,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([5, 103, 114, 111, 117, 112])],
- 800010: [new Uint8Array([16, 98, 98, 46, 103, 114, 111, 117, 112, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 58, 5, 103, 114, 111, 117, 112, 34, 10, 47, 118, 49, 47, 103, 114, 111, 117, 112, 115]),
- ],
- },
- },
- },
- /**
- * UpdateGroup updates the group.
- * Users with "bb.groups.update" permission on the workspace or the group owner can access this method.
- * Permissions required: bb.groups.update
- */
- updateGroup: {
- name: "UpdateGroup",
- requestType: UpdateGroupRequest,
- requestStream: false,
- responseType: Group,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([17, 103, 114, 111, 117, 112, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([16, 98, 98, 46, 103, 114, 111, 117, 112, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 58,
- 5,
- 103,
- 114,
- 111,
- 117,
- 112,
- 50,
- 25,
- 47,
- 118,
- 49,
- 47,
- 123,
- 103,
- 114,
- 111,
- 117,
- 112,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 103,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.groups.delete */
- deleteGroup: {
- name: "DeleteGroup",
- requestType: DeleteGroupRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 103, 114, 111, 117, 112, 115, 46, 100, 101, 108, 101, 116, 101])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 21,
- 42,
- 19,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 103,
- 114,
- 111,
- 117,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/iam_policy.ts b/frontend/src/types/proto/v1/iam_policy.ts
deleted file mode 100644
index ef8ddc8002..0000000000
--- a/frontend/src/types/proto/v1/iam_policy.ts
+++ /dev/null
@@ -1,700 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/iam_policy.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Expr as Expr1 } from "../google/api/expr/v1alpha1/syntax";
-import { Expr } from "../google/type/expr";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetIamPolicyRequest {
- /**
- * The name of the resource to get the IAM policy.
- * Format: projects/{project}
- * Format: workspaces/{workspace}
- */
- resource: string;
-}
-
-export interface SetIamPolicyRequest {
- /**
- * The name of the resource to set the IAM policy.
- * Format: projects/{project}
- * Format: workspaces/{workspace}
- */
- resource: string;
- policy:
- | IamPolicy
- | undefined;
- /** The current etag of the policy. */
- etag: string;
-}
-
-export interface IamPolicy {
- /**
- * Collection of binding.
- * A binding binds one or more project members to a single project role.
- */
- bindings: Binding[];
- /**
- * The current etag of the policy.
- * If an etag is provided and does not match the current etag of the poliy,
- * the call will be blocked and an ABORTED error will be returned.
- */
- etag: string;
-}
-
-export interface Binding {
- /**
- * The role that is assigned to the members.
- * Format: roles/{role}
- */
- role: string;
- /**
- * Specifies the principals requesting access for a Bytebase resource.
- * For users, the member should be: user:{email}
- * For groups, the member should be: group:{email}
- */
- members: string[];
- /**
- * The condition that is associated with this binding, only used in the project IAM policy.
- * If the condition evaluates to true, then this binding applies to the current request.
- * If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Support variables:
- * resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
- * resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
- * resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
- * request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
- * request.row_limit: the maximum export rows, used by the "roles/projectExporter" role. Only support "<=" operation.
- *
- * For example:
- * resource.database == "instances/local-pg/databases/postgres" && resource.schema in ["public","another_schema"]
- * resource.database == "instances/local-pg/databases/bytebase" && resource.schema == "public" && resource.table in ["audit_log"]
- * request.time < timestamp("2025-04-26T11:24:48.655Z") && request.row_limit <= 1000
- */
- condition:
- | Expr
- | undefined;
- /** The parsed expression of the condition. */
- parsedExpr: Expr1 | undefined;
-}
-
-/** The difference delta between two policies. */
-export interface PolicyDelta {
- /** The delta for Bindings between two policies. */
- bindingDeltas: BindingDelta[];
-}
-
-/**
- * One delta entry for Binding. Each individual change (only one member in each
- * entry) to a binding will be a separate entry.
- */
-export interface BindingDelta {
- /** The action that was performed on a Binding. */
- action: BindingDelta_Action;
- /**
- * Role that is assigned to `members`.
- * For example, `roles/projectOwner`.
- */
- role: string;
- /** Follows the same format of Binding.members. */
- member: string;
- /** The condition that is associated with this binding. */
- condition: Expr | undefined;
-}
-
-/** The type of action performed on a Binding in a policy. */
-export enum BindingDelta_Action {
- ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
- ADD = "ADD",
- REMOVE = "REMOVE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function bindingDelta_ActionFromJSON(object: any): BindingDelta_Action {
- switch (object) {
- case 0:
- case "ACTION_UNSPECIFIED":
- return BindingDelta_Action.ACTION_UNSPECIFIED;
- case 1:
- case "ADD":
- return BindingDelta_Action.ADD;
- case 2:
- case "REMOVE":
- return BindingDelta_Action.REMOVE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return BindingDelta_Action.UNRECOGNIZED;
- }
-}
-
-export function bindingDelta_ActionToJSON(object: BindingDelta_Action): string {
- switch (object) {
- case BindingDelta_Action.ACTION_UNSPECIFIED:
- return "ACTION_UNSPECIFIED";
- case BindingDelta_Action.ADD:
- return "ADD";
- case BindingDelta_Action.REMOVE:
- return "REMOVE";
- case BindingDelta_Action.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function bindingDelta_ActionToNumber(object: BindingDelta_Action): number {
- switch (object) {
- case BindingDelta_Action.ACTION_UNSPECIFIED:
- return 0;
- case BindingDelta_Action.ADD:
- return 1;
- case BindingDelta_Action.REMOVE:
- return 2;
- case BindingDelta_Action.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseGetIamPolicyRequest(): GetIamPolicyRequest {
- return { resource: "" };
-}
-
-export const GetIamPolicyRequest: MessageFns<GetIamPolicyRequest> = {
- encode(message: GetIamPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.resource !== "") {
- writer.uint32(10).string(message.resource);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetIamPolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetIamPolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.resource = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetIamPolicyRequest {
- return { resource: isSet(object.resource) ? globalThis.String(object.resource) : "" };
- },
-
- toJSON(message: GetIamPolicyRequest): unknown {
- const obj: any = {};
- if (message.resource !== "") {
- obj.resource = message.resource;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetIamPolicyRequest>): GetIamPolicyRequest {
- return GetIamPolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetIamPolicyRequest>): GetIamPolicyRequest {
- const message = createBaseGetIamPolicyRequest();
- message.resource = object.resource ?? "";
- return message;
- },
-};
-
-function createBaseSetIamPolicyRequest(): SetIamPolicyRequest {
- return { resource: "", policy: undefined, etag: "" };
-}
-
-export const SetIamPolicyRequest: MessageFns<SetIamPolicyRequest> = {
- encode(message: SetIamPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.resource !== "") {
- writer.uint32(10).string(message.resource);
- }
- if (message.policy !== undefined) {
- IamPolicy.encode(message.policy, writer.uint32(18).fork()).join();
- }
- if (message.etag !== "") {
- writer.uint32(26).string(message.etag);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SetIamPolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSetIamPolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.resource = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.policy = IamPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.etag = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SetIamPolicyRequest {
- return {
- resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
- policy: isSet(object.policy) ? IamPolicy.fromJSON(object.policy) : undefined,
- etag: isSet(object.etag) ? globalThis.String(object.etag) : "",
- };
- },
-
- toJSON(message: SetIamPolicyRequest): unknown {
- const obj: any = {};
- if (message.resource !== "") {
- obj.resource = message.resource;
- }
- if (message.policy !== undefined) {
- obj.policy = IamPolicy.toJSON(message.policy);
- }
- if (message.etag !== "") {
- obj.etag = message.etag;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SetIamPolicyRequest>): SetIamPolicyRequest {
- return SetIamPolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SetIamPolicyRequest>): SetIamPolicyRequest {
- const message = createBaseSetIamPolicyRequest();
- message.resource = object.resource ?? "";
- message.policy = (object.policy !== undefined && object.policy !== null)
- ? IamPolicy.fromPartial(object.policy)
- : undefined;
- message.etag = object.etag ?? "";
- return message;
- },
-};
-
-function createBaseIamPolicy(): IamPolicy {
- return { bindings: [], etag: "" };
-}
-
-export const IamPolicy: MessageFns<IamPolicy> = {
- encode(message: IamPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.bindings) {
- Binding.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.etag !== "") {
- writer.uint32(18).string(message.etag);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IamPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIamPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.bindings.push(Binding.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.etag = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IamPolicy {
- return {
- bindings: globalThis.Array.isArray(object?.bindings) ? object.bindings.map((e: any) => Binding.fromJSON(e)) : [],
- etag: isSet(object.etag) ? globalThis.String(object.etag) : "",
- };
- },
-
- toJSON(message: IamPolicy): unknown {
- const obj: any = {};
- if (message.bindings?.length) {
- obj.bindings = message.bindings.map((e) => Binding.toJSON(e));
- }
- if (message.etag !== "") {
- obj.etag = message.etag;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IamPolicy>): IamPolicy {
- return IamPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IamPolicy>): IamPolicy {
- const message = createBaseIamPolicy();
- message.bindings = object.bindings?.map((e) => Binding.fromPartial(e)) || [];
- message.etag = object.etag ?? "";
- return message;
- },
-};
-
-function createBaseBinding(): Binding {
- return { role: "", members: [], condition: undefined, parsedExpr: undefined };
-}
-
-export const Binding: MessageFns<Binding> = {
- encode(message: Binding, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.role !== "") {
- writer.uint32(10).string(message.role);
- }
- for (const v of message.members) {
- writer.uint32(18).string(v!);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(26).fork()).join();
- }
- if (message.parsedExpr !== undefined) {
- Expr1.encode(message.parsedExpr, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Binding {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBinding();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.role = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.members.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.parsedExpr = Expr1.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Binding {
- return {
- role: isSet(object.role) ? globalThis.String(object.role) : "",
- members: globalThis.Array.isArray(object?.members) ? object.members.map((e: any) => globalThis.String(e)) : [],
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- parsedExpr: isSet(object.parsedExpr) ? Expr1.fromJSON(object.parsedExpr) : undefined,
- };
- },
-
- toJSON(message: Binding): unknown {
- const obj: any = {};
- if (message.role !== "") {
- obj.role = message.role;
- }
- if (message.members?.length) {
- obj.members = message.members;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- if (message.parsedExpr !== undefined) {
- obj.parsedExpr = Expr1.toJSON(message.parsedExpr);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Binding>): Binding {
- return Binding.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Binding>): Binding {
- const message = createBaseBinding();
- message.role = object.role ?? "";
- message.members = object.members?.map((e) => e) || [];
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- message.parsedExpr = (object.parsedExpr !== undefined && object.parsedExpr !== null)
- ? Expr1.fromPartial(object.parsedExpr)
- : undefined;
- return message;
- },
-};
-
-function createBasePolicyDelta(): PolicyDelta {
- return { bindingDeltas: [] };
-}
-
-export const PolicyDelta: MessageFns<PolicyDelta> = {
- encode(message: PolicyDelta, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.bindingDeltas) {
- BindingDelta.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PolicyDelta {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePolicyDelta();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.bindingDeltas.push(BindingDelta.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PolicyDelta {
- return {
- bindingDeltas: globalThis.Array.isArray(object?.bindingDeltas)
- ? object.bindingDeltas.map((e: any) => BindingDelta.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: PolicyDelta): unknown {
- const obj: any = {};
- if (message.bindingDeltas?.length) {
- obj.bindingDeltas = message.bindingDeltas.map((e) => BindingDelta.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<PolicyDelta>): PolicyDelta {
- return PolicyDelta.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PolicyDelta>): PolicyDelta {
- const message = createBasePolicyDelta();
- message.bindingDeltas = object.bindingDeltas?.map((e) => BindingDelta.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBindingDelta(): BindingDelta {
- return { action: BindingDelta_Action.ACTION_UNSPECIFIED, role: "", member: "", condition: undefined };
-}
-
-export const BindingDelta: MessageFns<BindingDelta> = {
- encode(message: BindingDelta, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.action !== BindingDelta_Action.ACTION_UNSPECIFIED) {
- writer.uint32(8).int32(bindingDelta_ActionToNumber(message.action));
- }
- if (message.role !== "") {
- writer.uint32(18).string(message.role);
- }
- if (message.member !== "") {
- writer.uint32(26).string(message.member);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BindingDelta {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBindingDelta();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.action = bindingDelta_ActionFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.role = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.member = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BindingDelta {
- return {
- action: isSet(object.action)
- ? bindingDelta_ActionFromJSON(object.action)
- : BindingDelta_Action.ACTION_UNSPECIFIED,
- role: isSet(object.role) ? globalThis.String(object.role) : "",
- member: isSet(object.member) ? globalThis.String(object.member) : "",
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- };
- },
-
- toJSON(message: BindingDelta): unknown {
- const obj: any = {};
- if (message.action !== BindingDelta_Action.ACTION_UNSPECIFIED) {
- obj.action = bindingDelta_ActionToJSON(message.action);
- }
- if (message.role !== "") {
- obj.role = message.role;
- }
- if (message.member !== "") {
- obj.member = message.member;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<BindingDelta>): BindingDelta {
- return BindingDelta.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BindingDelta>): BindingDelta {
- const message = createBaseBindingDelta();
- message.action = object.action ?? BindingDelta_Action.ACTION_UNSPECIFIED;
- message.role = object.role ?? "";
- message.member = object.member ?? "";
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- return message;
- },
-};
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
deleted file mode 100644
index d0b64b5efc..0000000000
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ /dev/null
@@ -1,2621 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/idp_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum IdentityProviderType {
- IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED",
- OAUTH2 = "OAUTH2",
- OIDC = "OIDC",
- LDAP = "LDAP",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function identityProviderTypeFromJSON(object: any): IdentityProviderType {
- switch (object) {
- case 0:
- case "IDENTITY_PROVIDER_TYPE_UNSPECIFIED":
- return IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED;
- case 1:
- case "OAUTH2":
- return IdentityProviderType.OAUTH2;
- case 2:
- case "OIDC":
- return IdentityProviderType.OIDC;
- case 3:
- case "LDAP":
- return IdentityProviderType.LDAP;
- case -1:
- case "UNRECOGNIZED":
- default:
- return IdentityProviderType.UNRECOGNIZED;
- }
-}
-
-export function identityProviderTypeToJSON(object: IdentityProviderType): string {
- switch (object) {
- case IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED:
- return "IDENTITY_PROVIDER_TYPE_UNSPECIFIED";
- case IdentityProviderType.OAUTH2:
- return "OAUTH2";
- case IdentityProviderType.OIDC:
- return "OIDC";
- case IdentityProviderType.LDAP:
- return "LDAP";
- case IdentityProviderType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "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 = "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 = "IN_HEADER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function oAuth2AuthStyleFromJSON(object: any): OAuth2AuthStyle {
- switch (object) {
- case 0:
- case "OAUTH2_AUTH_STYLE_UNSPECIFIED":
- return OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
- case 1:
- case "IN_PARAMS":
- return OAuth2AuthStyle.IN_PARAMS;
- case 2:
- case "IN_HEADER":
- return OAuth2AuthStyle.IN_HEADER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return OAuth2AuthStyle.UNRECOGNIZED;
- }
-}
-
-export function oAuth2AuthStyleToJSON(object: OAuth2AuthStyle): string {
- switch (object) {
- case OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED:
- return "OAUTH2_AUTH_STYLE_UNSPECIFIED";
- case OAuth2AuthStyle.IN_PARAMS:
- return "IN_PARAMS";
- case OAuth2AuthStyle.IN_HEADER:
- return "IN_HEADER";
- case OAuth2AuthStyle.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
-}
-
-export interface ListIdentityProvidersRequest {
- /**
- * Not used.
- * The maximum number of identity providers to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListIdentityProviders` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListIdentityProviders` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListIdentityProvidersResponse {
- /** The identity providers from the specified request. */
- identityProviders: IdentityProvider[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateIdentityProviderRequest {
- /** The identity provider to create. */
- identityProvider:
- | IdentityProvider
- | undefined;
- /**
- * The ID to use for the identity provider, which will become the final component of
- * the identity provider's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- identityProviderId: string;
- /** If set to true, the request will be validated without actually creating the identity provider. */
- validateOnly: boolean;
-}
-
-export interface UpdateIdentityProviderRequest {
- /**
- * The identity provider to update.
- *
- * The identity provider's `name` field is used to identify the identity provider to update.
- * Format: idps/{identity_provider}
- */
- identityProvider:
- | IdentityProvider
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteIdentityProviderRequest {
- /**
- * The name of the identity provider to delete.
- * Format: idps/{identity_provider}
- */
- name: string;
-}
-
-export interface TestIdentityProviderRequest {
- /** The identity provider to test connection including uncreated. */
- identityProvider: IdentityProvider | undefined;
- oauth2Context?: OAuth2IdentityProviderTestRequestContext | undefined;
-}
-
-export interface OAuth2IdentityProviderTestRequestContext {
- /** Authorize code from website. */
- code: string;
-}
-
-export interface TestIdentityProviderResponse {
- /** The map of claims returned by the identity provider. */
- claims: { [key: string]: string };
- /** The matched user info from the claims. */
- userInfo: { [key: string]: string };
-}
-
-export interface TestIdentityProviderResponse_ClaimsEntry {
- key: string;
- value: string;
-}
-
-export interface TestIdentityProviderResponse_UserInfoEntry {
- key: string;
- value: string;
-}
-
-export interface IdentityProvider {
- /**
- * The name of the identity provider.
- * Format: idps/{idp}
- */
- name: string;
- title: string;
- domain: string;
- type: IdentityProviderType;
- config: IdentityProviderConfig | undefined;
-}
-
-export interface IdentityProviderConfig {
- oauth2Config?: OAuth2IdentityProviderConfig | undefined;
- oidcConfig?: OIDCIdentityProviderConfig | undefined;
- ldapConfig?: LDAPIdentityProviderConfig | undefined;
-}
-
-/** OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config. */
-export interface OAuth2IdentityProviderConfig {
- authUrl: string;
- tokenUrl: string;
- userInfoUrl: string;
- clientId: string;
- clientSecret: string;
- scopes: string[];
- fieldMapping: FieldMapping | undefined;
- skipTlsVerify: boolean;
- authStyle: OAuth2AuthStyle;
-}
-
-/** OIDCIdentityProviderConfig is the structure for OIDC identity provider config. */
-export interface OIDCIdentityProviderConfig {
- issuer: string;
- clientId: string;
- clientSecret: string;
- /**
- * The scopes that the OIDC provider supports.
- * Should be fetched from the well-known configuration file of the OIDC provider.
- */
- scopes: string[];
- fieldMapping: FieldMapping | undefined;
- skipTlsVerify: boolean;
- authStyle: OAuth2AuthStyle;
- /**
- * The authorization endpoint of the OIDC provider.
- * Should be fetched from the well-known configuration file of the OIDC provider.
- */
- authEndpoint: string;
-}
-
-/** LDAPIdentityProviderConfig is the structure for LDAP identity provider config. */
-export interface LDAPIdentityProviderConfig {
- /**
- * Host is the hostname or IP address of the LDAP server, e.g.
- * "ldap.example.com".
- */
- host: string;
- /**
- * Port is the port number of the LDAP server, e.g. 389. When not set, the
- * default port of the corresponding security protocol will be used, i.e. 389
- * for StartTLS and 636 for LDAPS.
- */
- port: number;
- /** SkipTLSVerify controls whether to skip TLS certificate verification. */
- skipTlsVerify: boolean;
- /**
- * BindDN is the DN of the user to bind as a service account to perform
- * search requests.
- */
- bindDn: string;
- /** BindPassword is the password of the user to bind as a service account. */
- bindPassword: string;
- /** BaseDN is the base DN to search for users, e.g. "ou=users,dc=example,dc=com". */
- baseDn: string;
- /** UserFilter is the filter to search for users, e.g. "(uid=%s)". */
- userFilter: string;
- /**
- * SecurityProtocol is the security protocol to be used for establishing
- * connections with the LDAP server.
- */
- securityProtocol: LDAPIdentityProviderConfig_SecurityProtocol;
- /**
- * FieldMapping is the mapping of the user attributes returned by the LDAP
- * server.
- */
- fieldMapping: FieldMapping | undefined;
-}
-
-export enum LDAPIdentityProviderConfig_SecurityProtocol {
- SECURITY_PROTOCOL_UNSPECIFIED = "SECURITY_PROTOCOL_UNSPECIFIED",
- /** START_TLS - StartTLS is the security protocol that starts with an unencrypted connection and then upgrades to TLS. */
- START_TLS = "START_TLS",
- /** LDAPS - LDAPS is the security protocol that uses TLS from the beginning. */
- LDAPS = "LDAPS",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function lDAPIdentityProviderConfig_SecurityProtocolFromJSON(
- object: any,
-): LDAPIdentityProviderConfig_SecurityProtocol {
- switch (object) {
- case 0:
- case "SECURITY_PROTOCOL_UNSPECIFIED":
- return LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED;
- case 1:
- case "START_TLS":
- return LDAPIdentityProviderConfig_SecurityProtocol.START_TLS;
- case 2:
- case "LDAPS":
- return LDAPIdentityProviderConfig_SecurityProtocol.LDAPS;
- case -1:
- case "UNRECOGNIZED":
- default:
- return LDAPIdentityProviderConfig_SecurityProtocol.UNRECOGNIZED;
- }
-}
-
-export function lDAPIdentityProviderConfig_SecurityProtocolToJSON(
- object: LDAPIdentityProviderConfig_SecurityProtocol,
-): string {
- switch (object) {
- case LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED:
- return "SECURITY_PROTOCOL_UNSPECIFIED";
- case LDAPIdentityProviderConfig_SecurityProtocol.START_TLS:
- return "START_TLS";
- case LDAPIdentityProviderConfig_SecurityProtocol.LDAPS:
- return "LDAPS";
- case LDAPIdentityProviderConfig_SecurityProtocol.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function lDAPIdentityProviderConfig_SecurityProtocolToNumber(
- object: LDAPIdentityProviderConfig_SecurityProtocol,
-): number {
- switch (object) {
- case LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED:
- return 0;
- case LDAPIdentityProviderConfig_SecurityProtocol.START_TLS:
- return 1;
- case LDAPIdentityProviderConfig_SecurityProtocol.LDAPS:
- return 2;
- case LDAPIdentityProviderConfig_SecurityProtocol.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/**
- * FieldMapping saves the field names from user info API of identity provider.
- * As we save all raw json string of user info response data into `principal.idp_user_info`,
- * we can extract the relevant data based with `FieldMapping`.
- */
-export interface FieldMapping {
- /** Identifier is the field name of the unique identifier in 3rd-party idp user info. Required. */
- identifier: string;
- /** DisplayName is the field name of display name in 3rd-party idp user info. Optional. */
- displayName: string;
- /** Phone is the field name of primary phone in 3rd-party idp user info. Optional. */
- phone: string;
- /**
- * Groups is the field name of groups in 3rd-party idp user info. Optional.
- * Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/
- */
- groups: string;
-}
-
-function createBaseGetIdentityProviderRequest(): GetIdentityProviderRequest {
- return { name: "" };
-}
-
-export const GetIdentityProviderRequest: MessageFns<GetIdentityProviderRequest> = {
- encode(message: GetIdentityProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetIdentityProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetIdentityProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetIdentityProviderRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetIdentityProviderRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetIdentityProviderRequest>): GetIdentityProviderRequest {
- return GetIdentityProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetIdentityProviderRequest>): GetIdentityProviderRequest {
- const message = createBaseGetIdentityProviderRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListIdentityProvidersRequest(): ListIdentityProvidersRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersRequest> = {
- encode(message: ListIdentityProvidersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIdentityProvidersRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIdentityProvidersRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIdentityProvidersRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListIdentityProvidersRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest {
- return ListIdentityProvidersRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest {
- const message = createBaseListIdentityProvidersRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListIdentityProvidersResponse(): ListIdentityProvidersResponse {
- return { identityProviders: [], nextPageToken: "" };
-}
-
-export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResponse> = {
- encode(message: ListIdentityProvidersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.identityProviders) {
- IdentityProvider.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIdentityProvidersResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIdentityProvidersResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.identityProviders.push(IdentityProvider.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIdentityProvidersResponse {
- return {
- identityProviders: globalThis.Array.isArray(object?.identityProviders)
- ? object.identityProviders.map((e: any) => IdentityProvider.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListIdentityProvidersResponse): unknown {
- const obj: any = {};
- if (message.identityProviders?.length) {
- obj.identityProviders = message.identityProviders.map((e) => IdentityProvider.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIdentityProvidersResponse>): ListIdentityProvidersResponse {
- return ListIdentityProvidersResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIdentityProvidersResponse>): ListIdentityProvidersResponse {
- const message = createBaseListIdentityProvidersResponse();
- message.identityProviders = object.identityProviders?.map((e) => IdentityProvider.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateIdentityProviderRequest(): CreateIdentityProviderRequest {
- return { identityProvider: undefined, identityProviderId: "", validateOnly: false };
-}
-
-export const CreateIdentityProviderRequest: MessageFns<CreateIdentityProviderRequest> = {
- encode(message: CreateIdentityProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.identityProvider !== undefined) {
- IdentityProvider.encode(message.identityProvider, writer.uint32(10).fork()).join();
- }
- if (message.identityProviderId !== "") {
- writer.uint32(18).string(message.identityProviderId);
- }
- if (message.validateOnly !== false) {
- writer.uint32(24).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateIdentityProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateIdentityProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.identityProvider = IdentityProvider.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.identityProviderId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateIdentityProviderRequest {
- return {
- identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
- identityProviderId: isSet(object.identityProviderId) ? globalThis.String(object.identityProviderId) : "",
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: CreateIdentityProviderRequest): unknown {
- const obj: any = {};
- if (message.identityProvider !== undefined) {
- obj.identityProvider = IdentityProvider.toJSON(message.identityProvider);
- }
- if (message.identityProviderId !== "") {
- obj.identityProviderId = message.identityProviderId;
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateIdentityProviderRequest>): CreateIdentityProviderRequest {
- return CreateIdentityProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateIdentityProviderRequest>): CreateIdentityProviderRequest {
- const message = createBaseCreateIdentityProviderRequest();
- message.identityProvider = (object.identityProvider !== undefined && object.identityProvider !== null)
- ? IdentityProvider.fromPartial(object.identityProvider)
- : undefined;
- message.identityProviderId = object.identityProviderId ?? "";
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBaseUpdateIdentityProviderRequest(): UpdateIdentityProviderRequest {
- return { identityProvider: undefined, updateMask: undefined };
-}
-
-export const UpdateIdentityProviderRequest: MessageFns<UpdateIdentityProviderRequest> = {
- encode(message: UpdateIdentityProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.identityProvider !== undefined) {
- IdentityProvider.encode(message.identityProvider, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateIdentityProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateIdentityProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.identityProvider = IdentityProvider.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateIdentityProviderRequest {
- return {
- identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateIdentityProviderRequest): unknown {
- const obj: any = {};
- if (message.identityProvider !== undefined) {
- obj.identityProvider = IdentityProvider.toJSON(message.identityProvider);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateIdentityProviderRequest>): UpdateIdentityProviderRequest {
- return UpdateIdentityProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateIdentityProviderRequest>): UpdateIdentityProviderRequest {
- const message = createBaseUpdateIdentityProviderRequest();
- message.identityProvider = (object.identityProvider !== undefined && object.identityProvider !== null)
- ? IdentityProvider.fromPartial(object.identityProvider)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteIdentityProviderRequest(): DeleteIdentityProviderRequest {
- return { name: "" };
-}
-
-export const DeleteIdentityProviderRequest: MessageFns<DeleteIdentityProviderRequest> = {
- encode(message: DeleteIdentityProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteIdentityProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteIdentityProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteIdentityProviderRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteIdentityProviderRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteIdentityProviderRequest>): DeleteIdentityProviderRequest {
- return DeleteIdentityProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteIdentityProviderRequest>): DeleteIdentityProviderRequest {
- const message = createBaseDeleteIdentityProviderRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseTestIdentityProviderRequest(): TestIdentityProviderRequest {
- return { identityProvider: undefined, oauth2Context: undefined };
-}
-
-export const TestIdentityProviderRequest: MessageFns<TestIdentityProviderRequest> = {
- encode(message: TestIdentityProviderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.identityProvider !== undefined) {
- IdentityProvider.encode(message.identityProvider, writer.uint32(10).fork()).join();
- }
- if (message.oauth2Context !== undefined) {
- OAuth2IdentityProviderTestRequestContext.encode(message.oauth2Context, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestIdentityProviderRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestIdentityProviderRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.identityProvider = IdentityProvider.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.oauth2Context = OAuth2IdentityProviderTestRequestContext.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestIdentityProviderRequest {
- return {
- identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
- oauth2Context: isSet(object.oauth2Context)
- ? OAuth2IdentityProviderTestRequestContext.fromJSON(object.oauth2Context)
- : undefined,
- };
- },
-
- toJSON(message: TestIdentityProviderRequest): unknown {
- const obj: any = {};
- if (message.identityProvider !== undefined) {
- obj.identityProvider = IdentityProvider.toJSON(message.identityProvider);
- }
- if (message.oauth2Context !== undefined) {
- obj.oauth2Context = OAuth2IdentityProviderTestRequestContext.toJSON(message.oauth2Context);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestIdentityProviderRequest>): TestIdentityProviderRequest {
- return TestIdentityProviderRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TestIdentityProviderRequest>): TestIdentityProviderRequest {
- const message = createBaseTestIdentityProviderRequest();
- message.identityProvider = (object.identityProvider !== undefined && object.identityProvider !== null)
- ? IdentityProvider.fromPartial(object.identityProvider)
- : undefined;
- message.oauth2Context = (object.oauth2Context !== undefined && object.oauth2Context !== null)
- ? OAuth2IdentityProviderTestRequestContext.fromPartial(object.oauth2Context)
- : undefined;
- return message;
- },
-};
-
-function createBaseOAuth2IdentityProviderTestRequestContext(): OAuth2IdentityProviderTestRequestContext {
- return { code: "" };
-}
-
-export const OAuth2IdentityProviderTestRequestContext: MessageFns<OAuth2IdentityProviderTestRequestContext> = {
- encode(message: OAuth2IdentityProviderTestRequestContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.code !== "") {
- writer.uint32(10).string(message.code);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): OAuth2IdentityProviderTestRequestContext {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOAuth2IdentityProviderTestRequestContext();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.code = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): OAuth2IdentityProviderTestRequestContext {
- return { code: isSet(object.code) ? globalThis.String(object.code) : "" };
- },
-
- toJSON(message: OAuth2IdentityProviderTestRequestContext): unknown {
- const obj: any = {};
- if (message.code !== "") {
- obj.code = message.code;
- }
- return obj;
- },
-
- create(base?: DeepPartial<OAuth2IdentityProviderTestRequestContext>): OAuth2IdentityProviderTestRequestContext {
- return OAuth2IdentityProviderTestRequestContext.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<OAuth2IdentityProviderTestRequestContext>): OAuth2IdentityProviderTestRequestContext {
- const message = createBaseOAuth2IdentityProviderTestRequestContext();
- message.code = object.code ?? "";
- return message;
- },
-};
-
-function createBaseTestIdentityProviderResponse(): TestIdentityProviderResponse {
- return { claims: {}, userInfo: {} };
-}
-
-export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderResponse> = {
- encode(message: TestIdentityProviderResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- Object.entries(message.claims).forEach(([key, value]) => {
- TestIdentityProviderResponse_ClaimsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
- });
- Object.entries(message.userInfo).forEach(([key, value]) => {
- TestIdentityProviderResponse_UserInfoEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
- });
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestIdentityProviderResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestIdentityProviderResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- const entry1 = TestIdentityProviderResponse_ClaimsEntry.decode(reader, reader.uint32());
- if (entry1.value !== undefined) {
- message.claims[entry1.key] = entry1.value;
- }
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- const entry2 = TestIdentityProviderResponse_UserInfoEntry.decode(reader, reader.uint32());
- if (entry2.value !== undefined) {
- message.userInfo[entry2.key] = entry2.value;
- }
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestIdentityProviderResponse {
- return {
- claims: isObject(object.claims)
- ? Object.entries(object.claims).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- userInfo: isObject(object.userInfo)
- ? Object.entries(object.userInfo).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- };
- },
-
- toJSON(message: TestIdentityProviderResponse): unknown {
- const obj: any = {};
- if (message.claims) {
- const entries = Object.entries(message.claims);
- if (entries.length > 0) {
- obj.claims = {};
- entries.forEach(([k, v]) => {
- obj.claims[k] = v;
- });
- }
- }
- if (message.userInfo) {
- const entries = Object.entries(message.userInfo);
- if (entries.length > 0) {
- obj.userInfo = {};
- entries.forEach(([k, v]) => {
- obj.userInfo[k] = v;
- });
- }
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestIdentityProviderResponse>): TestIdentityProviderResponse {
- return TestIdentityProviderResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TestIdentityProviderResponse>): TestIdentityProviderResponse {
- const message = createBaseTestIdentityProviderResponse();
- message.claims = Object.entries(object.claims ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- message.userInfo = Object.entries(object.userInfo ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- return message;
- },
-};
-
-function createBaseTestIdentityProviderResponse_ClaimsEntry(): TestIdentityProviderResponse_ClaimsEntry {
- return { key: "", value: "" };
-}
-
-export const TestIdentityProviderResponse_ClaimsEntry: MessageFns<TestIdentityProviderResponse_ClaimsEntry> = {
- encode(message: TestIdentityProviderResponse_ClaimsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestIdentityProviderResponse_ClaimsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestIdentityProviderResponse_ClaimsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestIdentityProviderResponse_ClaimsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: TestIdentityProviderResponse_ClaimsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestIdentityProviderResponse_ClaimsEntry>): TestIdentityProviderResponse_ClaimsEntry {
- return TestIdentityProviderResponse_ClaimsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TestIdentityProviderResponse_ClaimsEntry>): TestIdentityProviderResponse_ClaimsEntry {
- const message = createBaseTestIdentityProviderResponse_ClaimsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseTestIdentityProviderResponse_UserInfoEntry(): TestIdentityProviderResponse_UserInfoEntry {
- return { key: "", value: "" };
-}
-
-export const TestIdentityProviderResponse_UserInfoEntry: MessageFns<TestIdentityProviderResponse_UserInfoEntry> = {
- encode(message: TestIdentityProviderResponse_UserInfoEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestIdentityProviderResponse_UserInfoEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestIdentityProviderResponse_UserInfoEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestIdentityProviderResponse_UserInfoEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: TestIdentityProviderResponse_UserInfoEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestIdentityProviderResponse_UserInfoEntry>): TestIdentityProviderResponse_UserInfoEntry {
- return TestIdentityProviderResponse_UserInfoEntry.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<TestIdentityProviderResponse_UserInfoEntry>,
- ): TestIdentityProviderResponse_UserInfoEntry {
- const message = createBaseTestIdentityProviderResponse_UserInfoEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseIdentityProvider(): IdentityProvider {
- return {
- name: "",
- title: "",
- domain: "",
- type: IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
- config: undefined,
- };
-}
-
-export const IdentityProvider: MessageFns<IdentityProvider> = {
- encode(message: IdentityProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- if (message.domain !== "") {
- writer.uint32(42).string(message.domain);
- }
- 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()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IdentityProvider {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIdentityProvider();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.domain = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.type = identityProviderTypeFromJSON(reader.int32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.config = IdentityProviderConfig.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IdentityProvider {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
- type: isSet(object.type)
- ? identityProviderTypeFromJSON(object.type)
- : IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
- config: isSet(object.config) ? IdentityProviderConfig.fromJSON(object.config) : undefined,
- };
- },
-
- toJSON(message: IdentityProvider): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.domain !== "") {
- obj.domain = message.domain;
- }
- if (message.type !== IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED) {
- obj.type = identityProviderTypeToJSON(message.type);
- }
- if (message.config !== undefined) {
- obj.config = IdentityProviderConfig.toJSON(message.config);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IdentityProvider>): IdentityProvider {
- return IdentityProvider.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IdentityProvider>): IdentityProvider {
- const message = createBaseIdentityProvider();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.domain = object.domain ?? "";
- message.type = object.type ?? IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED;
- message.config = (object.config !== undefined && object.config !== null)
- ? IdentityProviderConfig.fromPartial(object.config)
- : undefined;
- return message;
- },
-};
-
-function createBaseIdentityProviderConfig(): IdentityProviderConfig {
- return { oauth2Config: undefined, oidcConfig: undefined, ldapConfig: undefined };
-}
-
-export const IdentityProviderConfig: MessageFns<IdentityProviderConfig> = {
- encode(message: IdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.oauth2Config !== undefined) {
- OAuth2IdentityProviderConfig.encode(message.oauth2Config, writer.uint32(10).fork()).join();
- }
- if (message.oidcConfig !== undefined) {
- OIDCIdentityProviderConfig.encode(message.oidcConfig, writer.uint32(18).fork()).join();
- }
- if (message.ldapConfig !== undefined) {
- LDAPIdentityProviderConfig.encode(message.ldapConfig, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIdentityProviderConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.oauth2Config = OAuth2IdentityProviderConfig.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.oidcConfig = OIDCIdentityProviderConfig.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.ldapConfig = LDAPIdentityProviderConfig.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IdentityProviderConfig {
- return {
- oauth2Config: isSet(object.oauth2Config) ? OAuth2IdentityProviderConfig.fromJSON(object.oauth2Config) : undefined,
- oidcConfig: isSet(object.oidcConfig) ? OIDCIdentityProviderConfig.fromJSON(object.oidcConfig) : undefined,
- ldapConfig: isSet(object.ldapConfig) ? LDAPIdentityProviderConfig.fromJSON(object.ldapConfig) : undefined,
- };
- },
-
- toJSON(message: IdentityProviderConfig): unknown {
- const obj: any = {};
- if (message.oauth2Config !== undefined) {
- obj.oauth2Config = OAuth2IdentityProviderConfig.toJSON(message.oauth2Config);
- }
- if (message.oidcConfig !== undefined) {
- obj.oidcConfig = OIDCIdentityProviderConfig.toJSON(message.oidcConfig);
- }
- if (message.ldapConfig !== undefined) {
- obj.ldapConfig = LDAPIdentityProviderConfig.toJSON(message.ldapConfig);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
- return IdentityProviderConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
- const message = createBaseIdentityProviderConfig();
- message.oauth2Config = (object.oauth2Config !== undefined && object.oauth2Config !== null)
- ? OAuth2IdentityProviderConfig.fromPartial(object.oauth2Config)
- : undefined;
- message.oidcConfig = (object.oidcConfig !== undefined && object.oidcConfig !== null)
- ? OIDCIdentityProviderConfig.fromPartial(object.oidcConfig)
- : undefined;
- message.ldapConfig = (object.ldapConfig !== undefined && object.ldapConfig !== null)
- ? LDAPIdentityProviderConfig.fromPartial(object.ldapConfig)
- : undefined;
- return message;
- },
-};
-
-function createBaseOAuth2IdentityProviderConfig(): OAuth2IdentityProviderConfig {
- return {
- authUrl: "",
- tokenUrl: "",
- userInfoUrl: "",
- clientId: "",
- clientSecret: "",
- scopes: [],
- fieldMapping: undefined,
- skipTlsVerify: false,
- authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
- };
-}
-
-export const OAuth2IdentityProviderConfig: MessageFns<OAuth2IdentityProviderConfig> = {
- encode(message: OAuth2IdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.authUrl !== "") {
- writer.uint32(10).string(message.authUrl);
- }
- if (message.tokenUrl !== "") {
- writer.uint32(18).string(message.tokenUrl);
- }
- if (message.userInfoUrl !== "") {
- writer.uint32(26).string(message.userInfoUrl);
- }
- if (message.clientId !== "") {
- writer.uint32(34).string(message.clientId);
- }
- if (message.clientSecret !== "") {
- writer.uint32(42).string(message.clientSecret);
- }
- for (const v of message.scopes) {
- writer.uint32(50).string(v!);
- }
- if (message.fieldMapping !== undefined) {
- FieldMapping.encode(message.fieldMapping, writer.uint32(58).fork()).join();
- }
- if (message.skipTlsVerify !== false) {
- writer.uint32(64).bool(message.skipTlsVerify);
- }
- if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
- writer.uint32(72).int32(oAuth2AuthStyleToNumber(message.authStyle));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): OAuth2IdentityProviderConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOAuth2IdentityProviderConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.authUrl = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tokenUrl = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.userInfoUrl = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.clientId = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.clientSecret = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.scopes.push(reader.string());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.skipTlsVerify = reader.bool();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): OAuth2IdentityProviderConfig {
- return {
- authUrl: isSet(object.authUrl) ? globalThis.String(object.authUrl) : "",
- tokenUrl: isSet(object.tokenUrl) ? globalThis.String(object.tokenUrl) : "",
- userInfoUrl: isSet(object.userInfoUrl) ? globalThis.String(object.userInfoUrl) : "",
- clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
- clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
- scopes: globalThis.Array.isArray(object?.scopes) ? object.scopes.map((e: any) => globalThis.String(e)) : [],
- fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
- skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
- authStyle: isSet(object.authStyle)
- ? oAuth2AuthStyleFromJSON(object.authStyle)
- : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
- };
- },
-
- toJSON(message: OAuth2IdentityProviderConfig): unknown {
- const obj: any = {};
- if (message.authUrl !== "") {
- obj.authUrl = message.authUrl;
- }
- if (message.tokenUrl !== "") {
- obj.tokenUrl = message.tokenUrl;
- }
- if (message.userInfoUrl !== "") {
- obj.userInfoUrl = message.userInfoUrl;
- }
- if (message.clientId !== "") {
- obj.clientId = message.clientId;
- }
- if (message.clientSecret !== "") {
- obj.clientSecret = message.clientSecret;
- }
- if (message.scopes?.length) {
- obj.scopes = message.scopes;
- }
- if (message.fieldMapping !== undefined) {
- obj.fieldMapping = FieldMapping.toJSON(message.fieldMapping);
- }
- if (message.skipTlsVerify !== false) {
- obj.skipTlsVerify = message.skipTlsVerify;
- }
- if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
- obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
- }
- return obj;
- },
-
- create(base?: DeepPartial<OAuth2IdentityProviderConfig>): OAuth2IdentityProviderConfig {
- return OAuth2IdentityProviderConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<OAuth2IdentityProviderConfig>): OAuth2IdentityProviderConfig {
- const message = createBaseOAuth2IdentityProviderConfig();
- message.authUrl = object.authUrl ?? "";
- message.tokenUrl = object.tokenUrl ?? "";
- message.userInfoUrl = object.userInfoUrl ?? "";
- message.clientId = object.clientId ?? "";
- message.clientSecret = object.clientSecret ?? "";
- message.scopes = object.scopes?.map((e) => e) || [];
- message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
- ? FieldMapping.fromPartial(object.fieldMapping)
- : undefined;
- message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseOIDCIdentityProviderConfig(): OIDCIdentityProviderConfig {
- return {
- issuer: "",
- clientId: "",
- clientSecret: "",
- scopes: [],
- fieldMapping: undefined,
- skipTlsVerify: false,
- authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
- authEndpoint: "",
- };
-}
-
-export const OIDCIdentityProviderConfig: MessageFns<OIDCIdentityProviderConfig> = {
- encode(message: OIDCIdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.issuer !== "") {
- writer.uint32(10).string(message.issuer);
- }
- if (message.clientId !== "") {
- writer.uint32(18).string(message.clientId);
- }
- if (message.clientSecret !== "") {
- writer.uint32(26).string(message.clientSecret);
- }
- for (const v of message.scopes) {
- writer.uint32(34).string(v!);
- }
- if (message.fieldMapping !== undefined) {
- FieldMapping.encode(message.fieldMapping, writer.uint32(42).fork()).join();
- }
- if (message.skipTlsVerify !== false) {
- writer.uint32(48).bool(message.skipTlsVerify);
- }
- if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
- writer.uint32(56).int32(oAuth2AuthStyleToNumber(message.authStyle));
- }
- if (message.authEndpoint !== "") {
- writer.uint32(66).string(message.authEndpoint);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): OIDCIdentityProviderConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOIDCIdentityProviderConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.issuer = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.clientId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.clientSecret = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.scopes.push(reader.string());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.skipTlsVerify = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.authEndpoint = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): OIDCIdentityProviderConfig {
- return {
- issuer: isSet(object.issuer) ? globalThis.String(object.issuer) : "",
- clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
- clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
- scopes: globalThis.Array.isArray(object?.scopes) ? object.scopes.map((e: any) => globalThis.String(e)) : [],
- fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
- skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
- authStyle: isSet(object.authStyle)
- ? oAuth2AuthStyleFromJSON(object.authStyle)
- : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
- authEndpoint: isSet(object.authEndpoint) ? globalThis.String(object.authEndpoint) : "",
- };
- },
-
- toJSON(message: OIDCIdentityProviderConfig): unknown {
- const obj: any = {};
- if (message.issuer !== "") {
- obj.issuer = message.issuer;
- }
- if (message.clientId !== "") {
- obj.clientId = message.clientId;
- }
- if (message.clientSecret !== "") {
- obj.clientSecret = message.clientSecret;
- }
- if (message.scopes?.length) {
- obj.scopes = message.scopes;
- }
- if (message.fieldMapping !== undefined) {
- obj.fieldMapping = FieldMapping.toJSON(message.fieldMapping);
- }
- if (message.skipTlsVerify !== false) {
- obj.skipTlsVerify = message.skipTlsVerify;
- }
- if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
- obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
- }
- if (message.authEndpoint !== "") {
- obj.authEndpoint = message.authEndpoint;
- }
- return obj;
- },
-
- create(base?: DeepPartial<OIDCIdentityProviderConfig>): OIDCIdentityProviderConfig {
- return OIDCIdentityProviderConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<OIDCIdentityProviderConfig>): OIDCIdentityProviderConfig {
- const message = createBaseOIDCIdentityProviderConfig();
- message.issuer = object.issuer ?? "";
- message.clientId = object.clientId ?? "";
- message.clientSecret = object.clientSecret ?? "";
- message.scopes = object.scopes?.map((e) => e) || [];
- message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
- ? FieldMapping.fromPartial(object.fieldMapping)
- : undefined;
- message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
- message.authEndpoint = object.authEndpoint ?? "";
- return message;
- },
-};
-
-function createBaseLDAPIdentityProviderConfig(): LDAPIdentityProviderConfig {
- return {
- host: "",
- port: 0,
- skipTlsVerify: false,
- bindDn: "",
- bindPassword: "",
- baseDn: "",
- userFilter: "",
- securityProtocol: LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED,
- fieldMapping: undefined,
- };
-}
-
-export const LDAPIdentityProviderConfig: MessageFns<LDAPIdentityProviderConfig> = {
- encode(message: LDAPIdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.host !== "") {
- writer.uint32(10).string(message.host);
- }
- if (message.port !== 0) {
- writer.uint32(16).int32(message.port);
- }
- if (message.skipTlsVerify !== false) {
- writer.uint32(24).bool(message.skipTlsVerify);
- }
- if (message.bindDn !== "") {
- writer.uint32(34).string(message.bindDn);
- }
- if (message.bindPassword !== "") {
- writer.uint32(42).string(message.bindPassword);
- }
- if (message.baseDn !== "") {
- writer.uint32(50).string(message.baseDn);
- }
- if (message.userFilter !== "") {
- writer.uint32(58).string(message.userFilter);
- }
- if (message.securityProtocol !== LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED) {
- writer.uint32(64).int32(lDAPIdentityProviderConfig_SecurityProtocolToNumber(message.securityProtocol));
- }
- if (message.fieldMapping !== undefined) {
- FieldMapping.encode(message.fieldMapping, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): LDAPIdentityProviderConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseLDAPIdentityProviderConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.host = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.port = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.skipTlsVerify = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.bindDn = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.bindPassword = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.baseDn = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.userFilter = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.securityProtocol = lDAPIdentityProviderConfig_SecurityProtocolFromJSON(reader.int32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): LDAPIdentityProviderConfig {
- return {
- host: isSet(object.host) ? globalThis.String(object.host) : "",
- port: isSet(object.port) ? globalThis.Number(object.port) : 0,
- skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
- bindDn: isSet(object.bindDn) ? globalThis.String(object.bindDn) : "",
- bindPassword: isSet(object.bindPassword) ? globalThis.String(object.bindPassword) : "",
- baseDn: isSet(object.baseDn) ? globalThis.String(object.baseDn) : "",
- userFilter: isSet(object.userFilter) ? globalThis.String(object.userFilter) : "",
- securityProtocol: isSet(object.securityProtocol)
- ? lDAPIdentityProviderConfig_SecurityProtocolFromJSON(object.securityProtocol)
- : LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED,
- fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
- };
- },
-
- toJSON(message: LDAPIdentityProviderConfig): unknown {
- const obj: any = {};
- if (message.host !== "") {
- obj.host = message.host;
- }
- if (message.port !== 0) {
- obj.port = Math.round(message.port);
- }
- if (message.skipTlsVerify !== false) {
- obj.skipTlsVerify = message.skipTlsVerify;
- }
- if (message.bindDn !== "") {
- obj.bindDn = message.bindDn;
- }
- if (message.bindPassword !== "") {
- obj.bindPassword = message.bindPassword;
- }
- if (message.baseDn !== "") {
- obj.baseDn = message.baseDn;
- }
- if (message.userFilter !== "") {
- obj.userFilter = message.userFilter;
- }
- if (message.securityProtocol !== LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED) {
- obj.securityProtocol = lDAPIdentityProviderConfig_SecurityProtocolToJSON(message.securityProtocol);
- }
- if (message.fieldMapping !== undefined) {
- obj.fieldMapping = FieldMapping.toJSON(message.fieldMapping);
- }
- return obj;
- },
-
- create(base?: DeepPartial<LDAPIdentityProviderConfig>): LDAPIdentityProviderConfig {
- return LDAPIdentityProviderConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<LDAPIdentityProviderConfig>): LDAPIdentityProviderConfig {
- const message = createBaseLDAPIdentityProviderConfig();
- message.host = object.host ?? "";
- message.port = object.port ?? 0;
- message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.bindDn = object.bindDn ?? "";
- message.bindPassword = object.bindPassword ?? "";
- message.baseDn = object.baseDn ?? "";
- message.userFilter = object.userFilter ?? "";
- message.securityProtocol = object.securityProtocol ??
- LDAPIdentityProviderConfig_SecurityProtocol.SECURITY_PROTOCOL_UNSPECIFIED;
- message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
- ? FieldMapping.fromPartial(object.fieldMapping)
- : undefined;
- return message;
- },
-};
-
-function createBaseFieldMapping(): FieldMapping {
- return { identifier: "", displayName: "", phone: "", groups: "" };
-}
-
-export const FieldMapping: MessageFns<FieldMapping> = {
- encode(message: FieldMapping, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.identifier !== "") {
- writer.uint32(10).string(message.identifier);
- }
- if (message.displayName !== "") {
- writer.uint32(18).string(message.displayName);
- }
- if (message.phone !== "") {
- writer.uint32(34).string(message.phone);
- }
- if (message.groups !== "") {
- writer.uint32(42).string(message.groups);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): FieldMapping {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldMapping();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.identifier = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.displayName = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.phone = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.groups = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldMapping {
- return {
- identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
- displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : "",
- phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
- groups: isSet(object.groups) ? globalThis.String(object.groups) : "",
- };
- },
-
- toJSON(message: FieldMapping): unknown {
- const obj: any = {};
- if (message.identifier !== "") {
- obj.identifier = message.identifier;
- }
- if (message.displayName !== "") {
- obj.displayName = message.displayName;
- }
- if (message.phone !== "") {
- obj.phone = message.phone;
- }
- if (message.groups !== "") {
- obj.groups = message.groups;
- }
- return obj;
- },
-
- create(base?: DeepPartial<FieldMapping>): FieldMapping {
- return FieldMapping.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldMapping>): FieldMapping {
- const message = createBaseFieldMapping();
- message.identifier = object.identifier ?? "";
- message.displayName = object.displayName ?? "";
- message.phone = object.phone ?? "";
- message.groups = object.groups ?? "";
- return message;
- },
-};
-
-export type IdentityProviderServiceDefinition = typeof IdentityProviderServiceDefinition;
-export const IdentityProviderServiceDefinition = {
- name: "IdentityProviderService",
- fullName: "bytebase.v1.IdentityProviderService",
- methods: {
- /** Permissions required: bb.identityProviders.get */
- getIdentityProvider: {
- name: "GetIdentityProvider",
- requestType: GetIdentityProviderRequest,
- requestStream: false,
- responseType: IdentityProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 24,
- 98,
- 98,
- 46,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 18, 17, 47, 118, 49, 47, 123, 110, 97, 109, 101, 61, 105, 100, 112, 115, 47, 42, 125]),
- ],
- },
- },
- },
- /** Permissions required: None */
- listIdentityProviders: {
- name: "ListIdentityProviders",
- requestType: ListIdentityProvidersRequest,
- requestStream: false,
- responseType: ListIdentityProvidersResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800000: [new Uint8Array([1])],
- 578365826: [new Uint8Array([10, 18, 8, 47, 118, 49, 47, 105, 100, 112, 115])],
- },
- },
- },
- /** Permissions required: bb.identityProviders.create */
- createIdentityProvider: {
- name: "CreateIdentityProvider",
- requestType: CreateIdentityProviderRequest,
- requestStream: false,
- responseType: IdentityProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([
- 27,
- 98,
- 98,
- 46,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 29,
- 58,
- 17,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 34,
- 8,
- 47,
- 118,
- 49,
- 47,
- 105,
- 100,
- 112,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.identityProviders.update */
- updateIdentityProvider: {
- name: "UpdateIdentityProvider",
- requestType: UpdateIdentityProviderRequest,
- requestStream: false,
- responseType: IdentityProvider,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 29,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 27,
- 98,
- 98,
- 46,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 56,
- 58,
- 17,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 50,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 95,
- 112,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 100,
- 112,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.identityProviders.delete */
- deleteIdentityProvider: {
- name: "DeleteIdentityProvider",
- requestType: DeleteIdentityProviderRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 27,
- 98,
- 98,
- 46,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 42, 17, 47, 118, 49, 47, 123, 110, 97, 109, 101, 61, 105, 100, 112, 115, 47, 42, 125]),
- ],
- },
- },
- },
- /** Permissions required: bb.identityProviders.update */
- testIdentityProvider: {
- name: "TestIdentityProvider",
- requestType: TestIdentityProviderRequest,
- requestStream: false,
- responseType: TestIdentityProviderResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 27,
- 98,
- 98,
- 46,
- 105,
- 100,
- 101,
- 110,
- 116,
- 105,
- 116,
- 121,
- 80,
- 114,
- 111,
- 118,
- 105,
- 100,
- 101,
- 114,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 58,
- 1,
- 42,
- 34,
- 15,
- 47,
- 118,
- 49,
- 47,
- 105,
- 100,
- 112,
- 115,
- 47,
- 42,
- 58,
- 116,
- 101,
- 115,
- 116,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/instance_role_service.ts b/frontend/src/types/proto/v1/instance_role_service.ts
deleted file mode 100644
index 42b10852d0..0000000000
--- a/frontend/src/types/proto/v1/instance_role_service.ts
+++ /dev/null
@@ -1,657 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/instance_role_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetInstanceRoleRequest {
- /**
- * The name of the role to retrieve.
- * Format: instances/{instance}/roles/{role name}
- * The role name is the unique name for the role.
- */
- name: string;
-}
-
-export interface ListInstanceRolesRequest {
- /**
- * The parent, which owns this collection of roles.
- * Format: instances/{instance}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of roles to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 roles will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListInstanceRoles` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListInstanceRoles` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Refresh will refresh and return the latest data. */
- refresh: boolean;
-}
-
-export interface ListInstanceRolesResponse {
- /** The roles from the specified request. */
- roles: InstanceRole[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-/** InstanceRole is the API message for instance role. */
-export interface InstanceRole {
- /**
- * The name of the role.
- * Format: instances/{instance}/roles/{role}
- * The role name is the unique name for the role.
- */
- name: string;
- /** The role name. It's unique within the instance. */
- roleName: string;
- /** The role password. */
- password?:
- | string
- | undefined;
- /** The connection count limit for this role. */
- connectionLimit?:
- | number
- | undefined;
- /** The expiration for the role's password. */
- validUntil?:
- | string
- | undefined;
- /**
- * The role attribute.
- * For PostgreSQL, it containt super_user, no_inherit, create_role, create_db, can_login, replication and bypass_rls. Docs: https://www.postgresql.org/docs/current/role-attributes.html
- * For MySQL, it's the global privileges as GRANT statements, which means it only contains "GRANT ... ON *.* TO ...". Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html
- */
- attribute?: string | undefined;
-}
-
-function createBaseGetInstanceRoleRequest(): GetInstanceRoleRequest {
- return { name: "" };
-}
-
-export const GetInstanceRoleRequest: MessageFns<GetInstanceRoleRequest> = {
- encode(message: GetInstanceRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetInstanceRoleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetInstanceRoleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetInstanceRoleRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetInstanceRoleRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetInstanceRoleRequest>): GetInstanceRoleRequest {
- return GetInstanceRoleRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetInstanceRoleRequest>): GetInstanceRoleRequest {
- const message = createBaseGetInstanceRoleRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListInstanceRolesRequest(): ListInstanceRolesRequest {
- return { parent: "", pageSize: 0, pageToken: "", refresh: false };
-}
-
-export const ListInstanceRolesRequest: MessageFns<ListInstanceRolesRequest> = {
- encode(message: ListInstanceRolesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.refresh !== false) {
- writer.uint32(32).bool(message.refresh);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceRolesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceRolesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.refresh = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceRolesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- refresh: isSet(object.refresh) ? globalThis.Boolean(object.refresh) : false,
- };
- },
-
- toJSON(message: ListInstanceRolesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.refresh !== false) {
- obj.refresh = message.refresh;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceRolesRequest>): ListInstanceRolesRequest {
- return ListInstanceRolesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceRolesRequest>): ListInstanceRolesRequest {
- const message = createBaseListInstanceRolesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.refresh = object.refresh ?? false;
- return message;
- },
-};
-
-function createBaseListInstanceRolesResponse(): ListInstanceRolesResponse {
- return { roles: [], nextPageToken: "" };
-}
-
-export const ListInstanceRolesResponse: MessageFns<ListInstanceRolesResponse> = {
- encode(message: ListInstanceRolesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.roles) {
- InstanceRole.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceRolesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceRolesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.roles.push(InstanceRole.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceRolesResponse {
- return {
- roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListInstanceRolesResponse): unknown {
- const obj: any = {};
- if (message.roles?.length) {
- obj.roles = message.roles.map((e) => InstanceRole.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceRolesResponse>): ListInstanceRolesResponse {
- return ListInstanceRolesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceRolesResponse>): ListInstanceRolesResponse {
- const message = createBaseListInstanceRolesResponse();
- message.roles = object.roles?.map((e) => InstanceRole.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseInstanceRole(): InstanceRole {
- return {
- name: "",
- roleName: "",
- password: undefined,
- connectionLimit: undefined,
- validUntil: undefined,
- attribute: undefined,
- };
-}
-
-export const InstanceRole: MessageFns<InstanceRole> = {
- encode(message: InstanceRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.roleName !== "") {
- writer.uint32(18).string(message.roleName);
- }
- if (message.password !== undefined) {
- writer.uint32(26).string(message.password);
- }
- if (message.connectionLimit !== undefined) {
- writer.uint32(32).int32(message.connectionLimit);
- }
- if (message.validUntil !== undefined) {
- writer.uint32(42).string(message.validUntil);
- }
- if (message.attribute !== undefined) {
- writer.uint32(50).string(message.attribute);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): InstanceRole {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInstanceRole();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.roleName = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.connectionLimit = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.validUntil = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.attribute = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): InstanceRole {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- roleName: isSet(object.roleName) ? globalThis.String(object.roleName) : "",
- password: isSet(object.password) ? globalThis.String(object.password) : undefined,
- connectionLimit: isSet(object.connectionLimit) ? globalThis.Number(object.connectionLimit) : undefined,
- validUntil: isSet(object.validUntil) ? globalThis.String(object.validUntil) : undefined,
- attribute: isSet(object.attribute) ? globalThis.String(object.attribute) : undefined,
- };
- },
-
- toJSON(message: InstanceRole): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.roleName !== "") {
- obj.roleName = message.roleName;
- }
- if (message.password !== undefined) {
- obj.password = message.password;
- }
- if (message.connectionLimit !== undefined) {
- obj.connectionLimit = Math.round(message.connectionLimit);
- }
- if (message.validUntil !== undefined) {
- obj.validUntil = message.validUntil;
- }
- if (message.attribute !== undefined) {
- obj.attribute = message.attribute;
- }
- return obj;
- },
-
- create(base?: DeepPartial<InstanceRole>): InstanceRole {
- return InstanceRole.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<InstanceRole>): InstanceRole {
- const message = createBaseInstanceRole();
- message.name = object.name ?? "";
- message.roleName = object.roleName ?? "";
- message.password = object.password ?? undefined;
- message.connectionLimit = object.connectionLimit ?? undefined;
- message.validUntil = object.validUntil ?? undefined;
- message.attribute = object.attribute ?? undefined;
- return message;
- },
-};
-
-export type InstanceRoleServiceDefinition = typeof InstanceRoleServiceDefinition;
-export const InstanceRoleServiceDefinition = {
- name: "InstanceRoleService",
- fullName: "bytebase.v1.InstanceRoleService",
- methods: {
- /** Permissions required: bb.instanceRoles.get */
- getInstanceRole: {
- name: "GetInstanceRole",
- requestType: GetInstanceRoleRequest,
- requestStream: false,
- responseType: InstanceRole,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 82,
- 111,
- 108,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 18,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instanceRoles.get */
- listInstanceRoles: {
- name: "ListInstanceRoles",
- requestType: ListInstanceRolesRequest,
- requestStream: false,
- responseType: ListInstanceRolesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 82,
- 111,
- 108,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 18,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 111,
- 108,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
deleted file mode 100644
index 34aea8d925..0000000000
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ /dev/null
@@ -1,5195 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/instance_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-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 {
- Engine,
- engineFromJSON,
- engineToJSON,
- engineToNumber,
- State,
- stateFromJSON,
- stateToJSON,
- stateToNumber,
-} from "./common";
-import { InstanceRole } from "./instance_role_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum DataSourceType {
- DATA_SOURCE_UNSPECIFIED = "DATA_SOURCE_UNSPECIFIED",
- ADMIN = "ADMIN",
- READ_ONLY = "READ_ONLY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceTypeFromJSON(object: any): DataSourceType {
- switch (object) {
- case 0:
- case "DATA_SOURCE_UNSPECIFIED":
- return DataSourceType.DATA_SOURCE_UNSPECIFIED;
- case 1:
- case "ADMIN":
- return DataSourceType.ADMIN;
- case 2:
- case "READ_ONLY":
- return DataSourceType.READ_ONLY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceTypeToJSON(object: DataSourceType): string {
- switch (object) {
- case DataSourceType.DATA_SOURCE_UNSPECIFIED:
- return "DATA_SOURCE_UNSPECIFIED";
- case DataSourceType.ADMIN:
- return "ADMIN";
- case DataSourceType.READ_ONLY:
- return "READ_ONLY";
- case DataSourceType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * Format: instances/{instance}
- */
- name: string;
-}
-
-export interface ListInstancesRequest {
- /**
- * The maximum number of instances to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 instances will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListInstances` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListInstances` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Show deleted instances if specified. */
- showDeleted: boolean;
- /**
- * Filter the instance.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - name: the instance name, support "==" and ".matches()" operator.
- * - resource_id: the instance id, support "==" and ".matches()" operator.
- * - environment: the environment full name in "environments/{id}" format, support "==" operator.
- * - state: the instance state, check State enum for values, support "==" operator.
- * - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- * - host: the instance host, support "==" and ".matches()" operator.
- * - port: the instance port, support "==" and ".matches()" operator.
- * - project: the project full name in "projects/{id}" format, support "==" operator.
- *
- * For example:
- * name == "sample instance"
- * name.matches("sample")
- * resource_id = "sample-instance"
- * resource_id.matches("sample")
- * state == "DELETED"
- * environment == "environments/test"
- * engine == "MYSQL"
- * engine in ["MYSQL", "POSTGRES"]
- * !(engine in ["MYSQL", "POSTGRES"])
- * host == "127.0.0.1"
- * host.matches("127.0")
- * port == "54321"
- * port.matches("543")
- * project == "projects/sample-project"
- * You can combine filter conditions like:
- * name.matches("sample") && environment == "environments/test"
- * host == "127.0.0.1" && port == "54321"
- */
- filter: string;
-}
-
-export interface ListInstancesResponse {
- /** The instances from the specified request. */
- instances: Instance[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateInstanceRequest {
- /** The instance to create. */
- instance:
- | Instance
- | undefined;
- /**
- * The ID to use for the instance, which will become the final component of
- * the instance's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- instanceId: string;
- /** Validate only also tests the data source connection. */
- validateOnly: boolean;
-}
-
-export interface UpdateInstanceRequest {
- /**
- * The instance to update.
- *
- * The instance's `name` field is used to identify the instance to update.
- * Format: instances/{instance}
- */
- instance:
- | Instance
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteInstanceRequest {
- /**
- * The name of the instance to delete.
- * Format: instances/{instance}
- */
- name: string;
- /** If set to true, any databases and sheets from this project will also be moved to default project, and all open issues will be closed. */
- force: boolean;
-}
-
-export interface UndeleteInstanceRequest {
- /**
- * The name of the deleted instance.
- * Format: instances/{instance}
- */
- name: string;
-}
-
-export interface SyncInstanceRequest {
- /**
- * The name of instance.
- * Format: instances/{instance}
- */
- name: string;
- /**
- * When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
- * the instance metadata (such as the database list) and any newly discovered instances will be synced.
- */
- enableFullSync: boolean;
-}
-
-export interface ListInstanceDatabaseRequest {
- /**
- * The name of the instance.
- * Format: instances/{instance}
- */
- name: string;
- /** The target instance. We need to set this field if the target instance is not created yet. */
- instance?: Instance | undefined;
-}
-
-export interface ListInstanceDatabaseResponse {
- /** All database name list in the instance. */
- databases: string[];
-}
-
-export interface SyncInstanceResponse {
- /** All database name list in the instance. */
- databases: string[];
-}
-
-export interface BatchSyncInstancesRequest {
- /**
- * The request message specifying the instances to sync.
- * A maximum of 1000 instances can be synced in a batch.
- */
- requests: SyncInstanceRequest[];
-}
-
-export interface BatchSyncInstancesResponse {
-}
-
-export interface BatchUpdateInstancesRequest {
- /** The request message specifying the resources to update. */
- requests: UpdateInstanceRequest[];
-}
-
-export interface BatchUpdateInstancesResponse {
- instances: Instance[];
-}
-
-export interface AddDataSourceRequest {
- /**
- * The name of the instance to add a data source to.
- * Format: instances/{instance}
- */
- name: string;
- /**
- * Identified by data source ID.
- * Only READ_ONLY data source can be added.
- */
- dataSource:
- | DataSource
- | undefined;
- /** Validate only also tests the data source connection. */
- validateOnly: boolean;
-}
-
-export interface RemoveDataSourceRequest {
- /**
- * The name of the instance to remove a data source from.
- * Format: instances/{instance}
- */
- name: string;
- /**
- * Identified by data source ID.
- * Only READ_ONLY data source can be removed.
- */
- dataSource: DataSource | undefined;
-}
-
-export interface UpdateDataSourceRequest {
- /**
- * The name of the instance to update a data source.
- * Format: instances/{instance}
- */
- name: string;
- /** Identified by data source ID. */
- dataSource:
- | DataSource
- | undefined;
- /** The list of fields to update. */
- updateMask:
- | string[]
- | undefined;
- /** Validate only also tests the data source connection. */
- validateOnly: boolean;
-}
-
-export interface Instance {
- /**
- * The name of the instance.
- * Format: instances/{instance}
- */
- name: string;
- state: State;
- title: string;
- engine: Engine;
- engineVersion: string;
- externalLink: string;
- dataSources: DataSource[];
- /**
- * The environment resource.
- * Format: environments/prod where prod is the environment resource ID.
- */
- environment: string;
- activation: boolean;
- roles: InstanceRole[];
- /** How often the instance is synced. */
- syncInterval:
- | Duration
- | undefined;
- /**
- * The maximum number of connections.
- * The default is 10 if the value is unset or zero.
- */
- maximumConnections: number;
- /**
- * Enable sync for following databases.
- * Default empty, means sync all schemas & databases.
- */
- syncDatabases: string[];
- /** The last time the instance was synced. */
- lastSyncTime: Timestamp | undefined;
-}
-
-export interface DataSourceExternalSecret {
- secretType: DataSourceExternalSecret_SecretType;
- url: string;
- authType: DataSourceExternalSecret_AuthType;
- appRole?: DataSourceExternalSecret_AppRoleAuthOption | undefined;
- token?:
- | string
- | undefined;
- /** engine name is the name for secret engine. */
- engineName: string;
- /** the secret name in the engine to store the password. */
- secretName: string;
- /** the key name for the password. */
- passwordKeyName: string;
-}
-
-export enum DataSourceExternalSecret_SecretType {
- SAECRET_TYPE_UNSPECIFIED = "SAECRET_TYPE_UNSPECIFIED",
- /** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
- VAULT_KV_V2 = "VAULT_KV_V2",
- /** AWS_SECRETS_MANAGER - ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html */
- AWS_SECRETS_MANAGER = "AWS_SECRETS_MANAGER",
- /** GCP_SECRET_MANAGER - ref: https://cloud.google.com/secret-manager/docs */
- GCP_SECRET_MANAGER = "GCP_SECRET_MANAGER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceExternalSecret_SecretTypeFromJSON(object: any): DataSourceExternalSecret_SecretType {
- switch (object) {
- case 0:
- case "SAECRET_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
- case 1:
- case "VAULT_KV_V2":
- return DataSourceExternalSecret_SecretType.VAULT_KV_V2;
- case 2:
- case "AWS_SECRETS_MANAGER":
- return DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER;
- case 3:
- case "GCP_SECRET_MANAGER":
- return DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceExternalSecret_SecretType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExternalSecret_SecretType): string {
- switch (object) {
- case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
- return "SAECRET_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
- return "VAULT_KV_V2";
- case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
- return "AWS_SECRETS_MANAGER";
- case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
- return "GCP_SECRET_MANAGER";
- case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "AUTH_TYPE_UNSPECIFIED",
- /** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
- TOKEN = "TOKEN",
- /** VAULT_APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
- VAULT_APP_ROLE = "VAULT_APP_ROLE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceExternalSecret_AuthTypeFromJSON(object: any): DataSourceExternalSecret_AuthType {
- switch (object) {
- case 0:
- case "AUTH_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
- case 1:
- case "TOKEN":
- return DataSourceExternalSecret_AuthType.TOKEN;
- case 2:
- case "VAULT_APP_ROLE":
- return DataSourceExternalSecret_AuthType.VAULT_APP_ROLE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceExternalSecret_AuthType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExternalSecret_AuthType): string {
- switch (object) {
- case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
- return "AUTH_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_AuthType.TOKEN:
- return "TOKEN";
- case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
- return "VAULT_APP_ROLE";
- case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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. */
- secretId: string;
- type: DataSourceExternalSecret_AppRoleAuthOption_SecretType;
- /** The path where the approle auth method is mounted. */
- mountPath: string;
-}
-
-export enum DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- SECRET_TYPE_UNSPECIFIED = "SECRET_TYPE_UNSPECIFIED",
- PLAIN = "PLAIN",
- ENVIRONMENT = "ENVIRONMENT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(
- object: any,
-): DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- switch (object) {
- case 0:
- case "SECRET_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
- case 1:
- case "PLAIN":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN;
- case 2:
- case "ENVIRONMENT":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(
- object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
-): string {
- switch (object) {
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
- return "SECRET_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
- return "PLAIN";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
- return "ENVIRONMENT";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- username: string;
- password: string;
- /** Use SSL to connect to the data source. By default, we use system default SSL configuration. */
- useSsl: boolean;
- sslCa: string;
- sslCert: string;
- sslKey: string;
- host: string;
- port: string;
- database: string;
- /**
- * srv, authentication_database and replica_set are used for MongoDB.
- * srv is a boolean flag that indicates whether the host is a DNS SRV record.
- */
- srv: boolean;
- /** authentication_database is the database name to authenticate against, which stores the user credentials. */
- authenticationDatabase: string;
- /** replica_set is used for MongoDB replica set. */
- replicaSet: string;
- /** sid and service_name are used for Oracle. */
- sid: string;
- serviceName: string;
- /**
- * Connection over SSH.
- * The hostname of the SSH server agent.
- * Required.
- */
- sshHost: string;
- /**
- * The port of the SSH server agent. It's 22 typically.
- * Required.
- */
- sshPort: string;
- /**
- * The user to login the server.
- * Required.
- */
- sshUser: string;
- /** The password to login the server. If it's empty string, no password is required. */
- sshPassword: string;
- /** The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK"). */
- sshPrivateKey: string;
- /**
- * PKCS#8 private key in PEM format. If it's empty string, no private key is required.
- * Used for authentication when connecting to the data source.
- */
- authenticationPrivateKey: string;
- externalSecret: DataSourceExternalSecret | undefined;
- authenticationType: DataSource_AuthenticationType;
- azureCredential?: DataSource_AzureCredential | undefined;
- awsCredential?: DataSource_AWSCredential | undefined;
- gcpCredential?: DataSource_GCPCredential | undefined;
- saslConfig:
- | SASLConfig
- | undefined;
- /** additional_addresses is used for MongoDB replica set. */
- additionalAddresses: DataSource_Address[];
- /** direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string. */
- directConnection: boolean;
- /** region is the location of where the DB is, works for AWS RDS. For example, us-east-1. */
- region: string;
- /** warehouse_id is used by Databricks. */
- warehouseId: string;
- /** master_name is the master name used by connecting redis-master via redis sentinel. */
- masterName: string;
- /** master_username and master_password are master credentials used by redis sentinel mode. */
- masterUsername: string;
- masterPassword: string;
- redisType: DataSource_RedisType;
- /** Cluster is the cluster name for the data source. Used by CockroachDB. */
- cluster: string;
- /**
- * Extra connection parameters for the database connection.
- * For PostgreSQL HA, this can be used to set target_session_attrs=read-write
- */
- extraConnectionParameters: { [key: string]: string };
-}
-
-export enum DataSource_AuthenticationType {
- AUTHENTICATION_UNSPECIFIED = "AUTHENTICATION_UNSPECIFIED",
- PASSWORD = "PASSWORD",
- GOOGLE_CLOUD_SQL_IAM = "GOOGLE_CLOUD_SQL_IAM",
- AWS_RDS_IAM = "AWS_RDS_IAM",
- AZURE_IAM = "AZURE_IAM",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSource_AuthenticationTypeFromJSON(object: any): DataSource_AuthenticationType {
- switch (object) {
- case 0:
- case "AUTHENTICATION_UNSPECIFIED":
- return DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- case 1:
- case "PASSWORD":
- return DataSource_AuthenticationType.PASSWORD;
- case 2:
- case "GOOGLE_CLOUD_SQL_IAM":
- return DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM;
- case 3:
- case "AWS_RDS_IAM":
- return DataSource_AuthenticationType.AWS_RDS_IAM;
- case 4:
- case "AZURE_IAM":
- return DataSource_AuthenticationType.AZURE_IAM;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSource_AuthenticationType.UNRECOGNIZED;
- }
-}
-
-export function dataSource_AuthenticationTypeToJSON(object: DataSource_AuthenticationType): string {
- switch (object) {
- case DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED:
- return "AUTHENTICATION_UNSPECIFIED";
- case DataSource_AuthenticationType.PASSWORD:
- return "PASSWORD";
- case DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM:
- return "GOOGLE_CLOUD_SQL_IAM";
- case DataSource_AuthenticationType.AWS_RDS_IAM:
- return "AWS_RDS_IAM";
- case DataSource_AuthenticationType.AZURE_IAM:
- return "AZURE_IAM";
- case DataSource_AuthenticationType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.AZURE_IAM:
- return 4;
- case DataSource_AuthenticationType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum DataSource_RedisType {
- REDIS_TYPE_UNSPECIFIED = "REDIS_TYPE_UNSPECIFIED",
- STANDALONE = "STANDALONE",
- SENTINEL = "SENTINEL",
- CLUSTER = "CLUSTER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSource_RedisTypeFromJSON(object: any): DataSource_RedisType {
- switch (object) {
- case 0:
- case "REDIS_TYPE_UNSPECIFIED":
- return DataSource_RedisType.REDIS_TYPE_UNSPECIFIED;
- case 1:
- case "STANDALONE":
- return DataSource_RedisType.STANDALONE;
- case 2:
- case "SENTINEL":
- return DataSource_RedisType.SENTINEL;
- case 3:
- case "CLUSTER":
- return DataSource_RedisType.CLUSTER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSource_RedisType.UNRECOGNIZED;
- }
-}
-
-export function dataSource_RedisTypeToJSON(object: DataSource_RedisType): string {
- switch (object) {
- case DataSource_RedisType.REDIS_TYPE_UNSPECIFIED:
- return "REDIS_TYPE_UNSPECIFIED";
- case DataSource_RedisType.STANDALONE:
- return "STANDALONE";
- case DataSource_RedisType.SENTINEL:
- return "SENTINEL";
- case DataSource_RedisType.CLUSTER:
- return "CLUSTER";
- case DataSource_RedisType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function dataSource_RedisTypeToNumber(object: DataSource_RedisType): number {
- switch (object) {
- case DataSource_RedisType.REDIS_TYPE_UNSPECIFIED:
- return 0;
- case DataSource_RedisType.STANDALONE:
- return 1;
- case DataSource_RedisType.SENTINEL:
- return 2;
- case DataSource_RedisType.CLUSTER:
- return 3;
- case DataSource_RedisType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface DataSource_AzureCredential {
- tenantId: string;
- clientId: string;
- clientSecret: string;
-}
-
-export interface DataSource_AWSCredential {
- accessKeyId: string;
- secretAccessKey: string;
- sessionToken: string;
-}
-
-export interface DataSource_GCPCredential {
- content: string;
-}
-
-export interface DataSource_Address {
- host: string;
- port: string;
-}
-
-export interface DataSource_ExtraConnectionParametersEntry {
- key: string;
- value: string;
-}
-
-export interface InstanceResource {
- title: string;
- engine: Engine;
- engineVersion: string;
- dataSources: DataSource[];
- activation: boolean;
- /**
- * The name of the instance.
- * Format: instances/{instance}
- */
- name: string;
- /**
- * The environment resource.
- * Format: environments/prod where prod is the environment resource ID.
- */
- environment: string;
-}
-
-export interface SASLConfig {
- krbConfig?: KerberosConfig | undefined;
-}
-
-export interface KerberosConfig {
- primary: string;
- instance: string;
- realm: string;
- keytab: Uint8Array;
- kdcHost: string;
- kdcPort: string;
- kdcTransportProtocol: string;
-}
-
-function createBaseGetInstanceRequest(): GetInstanceRequest {
- return { name: "" };
-}
-
-export const GetInstanceRequest: MessageFns<GetInstanceRequest> = {
- encode(message: GetInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetInstanceRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetInstanceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetInstanceRequest>): GetInstanceRequest {
- return GetInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetInstanceRequest>): GetInstanceRequest {
- const message = createBaseGetInstanceRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListInstancesRequest(): ListInstancesRequest {
- return { pageSize: 0, pageToken: "", showDeleted: false, filter: "" };
-}
-
-export const ListInstancesRequest: MessageFns<ListInstancesRequest> = {
- encode(message: ListInstancesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(24).bool(message.showDeleted);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstancesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstancesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstancesRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListInstancesRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstancesRequest>): ListInstancesRequest {
- return ListInstancesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstancesRequest>): ListInstancesRequest {
- const message = createBaseListInstancesRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListInstancesResponse(): ListInstancesResponse {
- return { instances: [], nextPageToken: "" };
-}
-
-export const ListInstancesResponse: MessageFns<ListInstancesResponse> = {
- encode(message: ListInstancesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.instances) {
- Instance.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstancesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstancesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.instances.push(Instance.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstancesResponse {
- return {
- instances: globalThis.Array.isArray(object?.instances)
- ? object.instances.map((e: any) => Instance.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListInstancesResponse): unknown {
- const obj: any = {};
- if (message.instances?.length) {
- obj.instances = message.instances.map((e) => Instance.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstancesResponse>): ListInstancesResponse {
- return ListInstancesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstancesResponse>): ListInstancesResponse {
- const message = createBaseListInstancesResponse();
- message.instances = object.instances?.map((e) => Instance.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateInstanceRequest(): CreateInstanceRequest {
- return { instance: undefined, instanceId: "", validateOnly: false };
-}
-
-export const CreateInstanceRequest: MessageFns<CreateInstanceRequest> = {
- encode(message: CreateInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.instance !== undefined) {
- Instance.encode(message.instance, writer.uint32(10).fork()).join();
- }
- if (message.instanceId !== "") {
- writer.uint32(18).string(message.instanceId);
- }
- if (message.validateOnly !== false) {
- writer.uint32(24).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.instance = Instance.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.instanceId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateInstanceRequest {
- return {
- instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
- instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: CreateInstanceRequest): unknown {
- const obj: any = {};
- if (message.instance !== undefined) {
- obj.instance = Instance.toJSON(message.instance);
- }
- if (message.instanceId !== "") {
- obj.instanceId = message.instanceId;
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateInstanceRequest>): CreateInstanceRequest {
- return CreateInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateInstanceRequest>): CreateInstanceRequest {
- const message = createBaseCreateInstanceRequest();
- message.instance = (object.instance !== undefined && object.instance !== null)
- ? Instance.fromPartial(object.instance)
- : undefined;
- message.instanceId = object.instanceId ?? "";
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBaseUpdateInstanceRequest(): UpdateInstanceRequest {
- return { instance: undefined, updateMask: undefined };
-}
-
-export const UpdateInstanceRequest: MessageFns<UpdateInstanceRequest> = {
- encode(message: UpdateInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.instance !== undefined) {
- Instance.encode(message.instance, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.instance = Instance.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateInstanceRequest {
- return {
- instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateInstanceRequest): unknown {
- const obj: any = {};
- if (message.instance !== undefined) {
- obj.instance = Instance.toJSON(message.instance);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateInstanceRequest>): UpdateInstanceRequest {
- return UpdateInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateInstanceRequest>): UpdateInstanceRequest {
- const message = createBaseUpdateInstanceRequest();
- message.instance = (object.instance !== undefined && object.instance !== null)
- ? Instance.fromPartial(object.instance)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteInstanceRequest(): DeleteInstanceRequest {
- return { name: "", force: false };
-}
-
-export const DeleteInstanceRequest: MessageFns<DeleteInstanceRequest> = {
- encode(message: DeleteInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.force !== false) {
- writer.uint32(16).bool(message.force);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.force = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteInstanceRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
- };
- },
-
- toJSON(message: DeleteInstanceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.force !== false) {
- obj.force = message.force;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteInstanceRequest>): DeleteInstanceRequest {
- return DeleteInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteInstanceRequest>): DeleteInstanceRequest {
- const message = createBaseDeleteInstanceRequest();
- message.name = object.name ?? "";
- message.force = object.force ?? false;
- return message;
- },
-};
-
-function createBaseUndeleteInstanceRequest(): UndeleteInstanceRequest {
- return { name: "" };
-}
-
-export const UndeleteInstanceRequest: MessageFns<UndeleteInstanceRequest> = {
- encode(message: UndeleteInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UndeleteInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUndeleteInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UndeleteInstanceRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: UndeleteInstanceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UndeleteInstanceRequest>): UndeleteInstanceRequest {
- return UndeleteInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UndeleteInstanceRequest>): UndeleteInstanceRequest {
- const message = createBaseUndeleteInstanceRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseSyncInstanceRequest(): SyncInstanceRequest {
- return { name: "", enableFullSync: false };
-}
-
-export const SyncInstanceRequest: MessageFns<SyncInstanceRequest> = {
- encode(message: SyncInstanceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.enableFullSync !== false) {
- writer.uint32(16).bool(message.enableFullSync);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SyncInstanceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSyncInstanceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.enableFullSync = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SyncInstanceRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- enableFullSync: isSet(object.enableFullSync) ? globalThis.Boolean(object.enableFullSync) : false,
- };
- },
-
- toJSON(message: SyncInstanceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.enableFullSync !== false) {
- obj.enableFullSync = message.enableFullSync;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SyncInstanceRequest>): SyncInstanceRequest {
- return SyncInstanceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SyncInstanceRequest>): SyncInstanceRequest {
- const message = createBaseSyncInstanceRequest();
- message.name = object.name ?? "";
- message.enableFullSync = object.enableFullSync ?? false;
- return message;
- },
-};
-
-function createBaseListInstanceDatabaseRequest(): ListInstanceDatabaseRequest {
- return { name: "", instance: undefined };
-}
-
-export const ListInstanceDatabaseRequest: MessageFns<ListInstanceDatabaseRequest> = {
- encode(message: ListInstanceDatabaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.instance !== undefined) {
- Instance.encode(message.instance, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceDatabaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceDatabaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.instance = Instance.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceDatabaseRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
- };
- },
-
- toJSON(message: ListInstanceDatabaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.instance !== undefined) {
- obj.instance = Instance.toJSON(message.instance);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceDatabaseRequest>): ListInstanceDatabaseRequest {
- return ListInstanceDatabaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceDatabaseRequest>): ListInstanceDatabaseRequest {
- const message = createBaseListInstanceDatabaseRequest();
- message.name = object.name ?? "";
- message.instance = (object.instance !== undefined && object.instance !== null)
- ? Instance.fromPartial(object.instance)
- : undefined;
- return message;
- },
-};
-
-function createBaseListInstanceDatabaseResponse(): ListInstanceDatabaseResponse {
- return { databases: [] };
-}
-
-export const ListInstanceDatabaseResponse: MessageFns<ListInstanceDatabaseResponse> = {
- encode(message: ListInstanceDatabaseResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceDatabaseResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceDatabaseResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceDatabaseResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: ListInstanceDatabaseResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceDatabaseResponse>): ListInstanceDatabaseResponse {
- return ListInstanceDatabaseResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceDatabaseResponse>): ListInstanceDatabaseResponse {
- const message = createBaseListInstanceDatabaseResponse();
- message.databases = object.databases?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseSyncInstanceResponse(): SyncInstanceResponse {
- return { databases: [] };
-}
-
-export const SyncInstanceResponse: MessageFns<SyncInstanceResponse> = {
- encode(message: SyncInstanceResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SyncInstanceResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSyncInstanceResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SyncInstanceResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: SyncInstanceResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SyncInstanceResponse>): SyncInstanceResponse {
- return SyncInstanceResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SyncInstanceResponse>): SyncInstanceResponse {
- const message = createBaseSyncInstanceResponse();
- message.databases = object.databases?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchSyncInstancesRequest(): BatchSyncInstancesRequest {
- return { requests: [] };
-}
-
-export const BatchSyncInstancesRequest: MessageFns<BatchSyncInstancesRequest> = {
- encode(message: BatchSyncInstancesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.requests) {
- SyncInstanceRequest.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSyncInstancesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSyncInstancesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.requests.push(SyncInstanceRequest.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchSyncInstancesRequest {
- return {
- requests: globalThis.Array.isArray(object?.requests)
- ? object.requests.map((e: any) => SyncInstanceRequest.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchSyncInstancesRequest): unknown {
- const obj: any = {};
- if (message.requests?.length) {
- obj.requests = message.requests.map((e) => SyncInstanceRequest.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchSyncInstancesRequest>): BatchSyncInstancesRequest {
- return BatchSyncInstancesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchSyncInstancesRequest>): BatchSyncInstancesRequest {
- const message = createBaseBatchSyncInstancesRequest();
- message.requests = object.requests?.map((e) => SyncInstanceRequest.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchSyncInstancesResponse(): BatchSyncInstancesResponse {
- return {};
-}
-
-export const BatchSyncInstancesResponse: MessageFns<BatchSyncInstancesResponse> = {
- encode(_: BatchSyncInstancesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSyncInstancesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSyncInstancesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchSyncInstancesResponse {
- return {};
- },
-
- toJSON(_: BatchSyncInstancesResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchSyncInstancesResponse>): BatchSyncInstancesResponse {
- return BatchSyncInstancesResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchSyncInstancesResponse>): BatchSyncInstancesResponse {
- const message = createBaseBatchSyncInstancesResponse();
- return message;
- },
-};
-
-function createBaseBatchUpdateInstancesRequest(): BatchUpdateInstancesRequest {
- return { requests: [] };
-}
-
-export const BatchUpdateInstancesRequest: MessageFns<BatchUpdateInstancesRequest> = {
- encode(message: BatchUpdateInstancesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.requests) {
- UpdateInstanceRequest.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateInstancesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateInstancesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.requests.push(UpdateInstanceRequest.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchUpdateInstancesRequest {
- return {
- requests: globalThis.Array.isArray(object?.requests)
- ? object.requests.map((e: any) => UpdateInstanceRequest.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchUpdateInstancesRequest): unknown {
- const obj: any = {};
- if (message.requests?.length) {
- obj.requests = message.requests.map((e) => UpdateInstanceRequest.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateInstancesRequest>): BatchUpdateInstancesRequest {
- return BatchUpdateInstancesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchUpdateInstancesRequest>): BatchUpdateInstancesRequest {
- const message = createBaseBatchUpdateInstancesRequest();
- message.requests = object.requests?.map((e) => UpdateInstanceRequest.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchUpdateInstancesResponse(): BatchUpdateInstancesResponse {
- return { instances: [] };
-}
-
-export const BatchUpdateInstancesResponse: MessageFns<BatchUpdateInstancesResponse> = {
- encode(message: BatchUpdateInstancesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.instances) {
- Instance.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateInstancesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateInstancesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.instances.push(Instance.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchUpdateInstancesResponse {
- return {
- instances: globalThis.Array.isArray(object?.instances)
- ? object.instances.map((e: any) => Instance.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchUpdateInstancesResponse): unknown {
- const obj: any = {};
- if (message.instances?.length) {
- obj.instances = message.instances.map((e) => Instance.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateInstancesResponse>): BatchUpdateInstancesResponse {
- return BatchUpdateInstancesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchUpdateInstancesResponse>): BatchUpdateInstancesResponse {
- const message = createBaseBatchUpdateInstancesResponse();
- message.instances = object.instances?.map((e) => Instance.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseAddDataSourceRequest(): AddDataSourceRequest {
- return { name: "", dataSource: undefined, validateOnly: false };
-}
-
-export const AddDataSourceRequest: MessageFns<AddDataSourceRequest> = {
- encode(message: AddDataSourceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.dataSource !== undefined) {
- DataSource.encode(message.dataSource, writer.uint32(18).fork()).join();
- }
- if (message.validateOnly !== false) {
- writer.uint32(24).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AddDataSourceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAddDataSourceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.dataSource = DataSource.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AddDataSourceRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: AddDataSourceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.dataSource !== undefined) {
- obj.dataSource = DataSource.toJSON(message.dataSource);
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AddDataSourceRequest>): AddDataSourceRequest {
- return AddDataSourceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AddDataSourceRequest>): AddDataSourceRequest {
- const message = createBaseAddDataSourceRequest();
- message.name = object.name ?? "";
- message.dataSource = (object.dataSource !== undefined && object.dataSource !== null)
- ? DataSource.fromPartial(object.dataSource)
- : undefined;
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBaseRemoveDataSourceRequest(): RemoveDataSourceRequest {
- return { name: "", dataSource: undefined };
-}
-
-export const RemoveDataSourceRequest: MessageFns<RemoveDataSourceRequest> = {
- encode(message: RemoveDataSourceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.dataSource !== undefined) {
- DataSource.encode(message.dataSource, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RemoveDataSourceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRemoveDataSourceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.dataSource = DataSource.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RemoveDataSourceRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
- };
- },
-
- toJSON(message: RemoveDataSourceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.dataSource !== undefined) {
- obj.dataSource = DataSource.toJSON(message.dataSource);
- }
- return obj;
- },
-
- create(base?: DeepPartial<RemoveDataSourceRequest>): RemoveDataSourceRequest {
- return RemoveDataSourceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RemoveDataSourceRequest>): RemoveDataSourceRequest {
- const message = createBaseRemoveDataSourceRequest();
- message.name = object.name ?? "";
- message.dataSource = (object.dataSource !== undefined && object.dataSource !== null)
- ? DataSource.fromPartial(object.dataSource)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateDataSourceRequest(): UpdateDataSourceRequest {
- return { name: "", dataSource: undefined, updateMask: undefined, validateOnly: false };
-}
-
-export const UpdateDataSourceRequest: MessageFns<UpdateDataSourceRequest> = {
- encode(message: UpdateDataSourceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.dataSource !== undefined) {
- DataSource.encode(message.dataSource, writer.uint32(18).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(26).fork()).join();
- }
- if (message.validateOnly !== false) {
- writer.uint32(32).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateDataSourceRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateDataSourceRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.dataSource = DataSource.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateDataSourceRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: UpdateDataSourceRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.dataSource !== undefined) {
- obj.dataSource = DataSource.toJSON(message.dataSource);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateDataSourceRequest>): UpdateDataSourceRequest {
- return UpdateDataSourceRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateDataSourceRequest>): UpdateDataSourceRequest {
- const message = createBaseUpdateDataSourceRequest();
- message.name = object.name ?? "";
- message.dataSource = (object.dataSource !== undefined && object.dataSource !== null)
- ? DataSource.fromPartial(object.dataSource)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBaseInstance(): Instance {
- return {
- name: "",
- state: State.STATE_UNSPECIFIED,
- title: "",
- engine: Engine.ENGINE_UNSPECIFIED,
- engineVersion: "",
- externalLink: "",
- dataSources: [],
- environment: "",
- activation: false,
- roles: [],
- syncInterval: undefined,
- maximumConnections: 0,
- syncDatabases: [],
- lastSyncTime: undefined,
- };
-}
-
-export const Instance: MessageFns<Instance> = {
- encode(message: Instance, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- 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 !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(40).int32(engineToNumber(message.engine));
- }
- if (message.engineVersion !== "") {
- writer.uint32(50).string(message.engineVersion);
- }
- if (message.externalLink !== "") {
- writer.uint32(58).string(message.externalLink);
- }
- for (const v of message.dataSources) {
- DataSource.encode(v!, writer.uint32(66).fork()).join();
- }
- if (message.environment !== "") {
- writer.uint32(74).string(message.environment);
- }
- if (message.activation !== false) {
- writer.uint32(80).bool(message.activation);
- }
- for (const v of message.roles) {
- InstanceRole.encode(v!, writer.uint32(98).fork()).join();
- }
- if (message.syncInterval !== undefined) {
- Duration.encode(message.syncInterval, writer.uint32(106).fork()).join();
- }
- if (message.maximumConnections !== 0) {
- writer.uint32(112).int32(message.maximumConnections);
- }
- for (const v of message.syncDatabases) {
- writer.uint32(122).string(v!);
- }
- if (message.lastSyncTime !== undefined) {
- Timestamp.encode(message.lastSyncTime, writer.uint32(130).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Instance {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInstance();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.engineVersion = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.externalLink = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.dataSources.push(DataSource.decode(reader, reader.uint32()));
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.activation = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.roles.push(InstanceRole.decode(reader, reader.uint32()));
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.syncInterval = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 14: {
- if (tag !== 112) {
- break;
- }
-
- message.maximumConnections = reader.int32();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.syncDatabases.push(reader.string());
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.lastSyncTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Instance {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- engineVersion: isSet(object.engineVersion) ? globalThis.String(object.engineVersion) : "",
- externalLink: isSet(object.externalLink) ? globalThis.String(object.externalLink) : "",
- dataSources: globalThis.Array.isArray(object?.dataSources)
- ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
- : [],
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- activation: isSet(object.activation) ? globalThis.Boolean(object.activation) : false,
- roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
- syncInterval: isSet(object.syncInterval) ? Duration.fromJSON(object.syncInterval) : undefined,
- maximumConnections: isSet(object.maximumConnections) ? globalThis.Number(object.maximumConnections) : 0,
- syncDatabases: globalThis.Array.isArray(object?.syncDatabases)
- ? object.syncDatabases.map((e: any) => globalThis.String(e))
- : [],
- lastSyncTime: isSet(object.lastSyncTime) ? fromJsonTimestamp(object.lastSyncTime) : undefined,
- };
- },
-
- toJSON(message: Instance): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.engineVersion !== "") {
- obj.engineVersion = message.engineVersion;
- }
- if (message.externalLink !== "") {
- obj.externalLink = message.externalLink;
- }
- if (message.dataSources?.length) {
- obj.dataSources = message.dataSources.map((e) => DataSource.toJSON(e));
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- if (message.activation !== false) {
- obj.activation = message.activation;
- }
- if (message.roles?.length) {
- obj.roles = message.roles.map((e) => InstanceRole.toJSON(e));
- }
- if (message.syncInterval !== undefined) {
- obj.syncInterval = Duration.toJSON(message.syncInterval);
- }
- if (message.maximumConnections !== 0) {
- obj.maximumConnections = Math.round(message.maximumConnections);
- }
- if (message.syncDatabases?.length) {
- obj.syncDatabases = message.syncDatabases;
- }
- if (message.lastSyncTime !== undefined) {
- obj.lastSyncTime = fromTimestamp(message.lastSyncTime).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<Instance>): Instance {
- return Instance.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Instance>): Instance {
- const message = createBaseInstance();
- message.name = object.name ?? "";
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- message.title = object.title ?? "";
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.engineVersion = object.engineVersion ?? "";
- message.externalLink = object.externalLink ?? "";
- message.dataSources = object.dataSources?.map((e) => DataSource.fromPartial(e)) || [];
- message.environment = object.environment ?? "";
- message.activation = object.activation ?? false;
- message.roles = object.roles?.map((e) => InstanceRole.fromPartial(e)) || [];
- message.syncInterval = (object.syncInterval !== undefined && object.syncInterval !== null)
- ? Duration.fromPartial(object.syncInterval)
- : undefined;
- message.maximumConnections = object.maximumConnections ?? 0;
- message.syncDatabases = object.syncDatabases?.map((e) => e) || [];
- message.lastSyncTime = (object.lastSyncTime !== undefined && object.lastSyncTime !== null)
- ? Timestamp.fromPartial(object.lastSyncTime)
- : undefined;
- return message;
- },
-};
-
-function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
- return {
- secretType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
- url: "",
- authType: DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
- appRole: undefined,
- token: undefined,
- engineName: "",
- secretName: "",
- passwordKeyName: "",
- };
-}
-
-export const DataSourceExternalSecret: MessageFns<DataSourceExternalSecret> = {
- encode(message: DataSourceExternalSecret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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 !== 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()).join();
- }
- if (message.token !== undefined) {
- writer.uint32(42).string(message.token);
- }
- if (message.engineName !== "") {
- writer.uint32(50).string(message.engineName);
- }
- if (message.secretName !== "") {
- writer.uint32(58).string(message.secretName);
- }
- if (message.passwordKeyName !== "") {
- writer.uint32(66).string(message.passwordKeyName);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceExternalSecret();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.secretType = dataSourceExternalSecret_SecretTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.url = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.authType = dataSourceExternalSecret_AuthTypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.appRole = DataSourceExternalSecret_AppRoleAuthOption.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.token = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.engineName = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.secretName = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.passwordKeyName = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSourceExternalSecret {
- return {
- secretType: isSet(object.secretType)
- ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType)
- : DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
- url: isSet(object.url) ? globalThis.String(object.url) : "",
- authType: isSet(object.authType)
- ? dataSourceExternalSecret_AuthTypeFromJSON(object.authType)
- : DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
- appRole: isSet(object.appRole) ? DataSourceExternalSecret_AppRoleAuthOption.fromJSON(object.appRole) : undefined,
- token: isSet(object.token) ? globalThis.String(object.token) : undefined,
- engineName: isSet(object.engineName) ? globalThis.String(object.engineName) : "",
- secretName: isSet(object.secretName) ? globalThis.String(object.secretName) : "",
- passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
- };
- },
-
- toJSON(message: DataSourceExternalSecret): unknown {
- const obj: any = {};
- if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
- obj.secretType = dataSourceExternalSecret_SecretTypeToJSON(message.secretType);
- }
- if (message.url !== "") {
- obj.url = message.url;
- }
- if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
- obj.authType = dataSourceExternalSecret_AuthTypeToJSON(message.authType);
- }
- if (message.appRole !== undefined) {
- obj.appRole = DataSourceExternalSecret_AppRoleAuthOption.toJSON(message.appRole);
- }
- if (message.token !== undefined) {
- obj.token = message.token;
- }
- if (message.engineName !== "") {
- obj.engineName = message.engineName;
- }
- if (message.secretName !== "") {
- obj.secretName = message.secretName;
- }
- if (message.passwordKeyName !== "") {
- obj.passwordKeyName = message.passwordKeyName;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
- return DataSourceExternalSecret.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
- const message = createBaseDataSourceExternalSecret();
- message.secretType = object.secretType ?? DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
- message.url = object.url ?? "";
- message.authType = object.authType ?? DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
- message.appRole = (object.appRole !== undefined && object.appRole !== null)
- ? DataSourceExternalSecret_AppRoleAuthOption.fromPartial(object.appRole)
- : undefined;
- message.token = object.token ?? undefined;
- message.engineName = object.engineName ?? "";
- message.secretName = object.secretName ?? "";
- message.passwordKeyName = object.passwordKeyName ?? "";
- return message;
- },
-};
-
-function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return {
- roleId: "",
- secretId: "",
- type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
- mountPath: "",
- };
-}
-
-export const DataSourceExternalSecret_AppRoleAuthOption: MessageFns<DataSourceExternalSecret_AppRoleAuthOption> = {
- encode(message: DataSourceExternalSecret_AppRoleAuthOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.roleId !== "") {
- writer.uint32(10).string(message.roleId);
- }
- if (message.secretId !== "") {
- writer.uint32(18).string(message.secretId);
- }
- 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);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret_AppRoleAuthOption {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.roleId = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.secretId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.mountPath = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSourceExternalSecret_AppRoleAuthOption {
- return {
- roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
- secretId: isSet(object.secretId) ? globalThis.String(object.secretId) : "",
- type: isSet(object.type)
- ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
- : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
- mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
- };
- },
-
- toJSON(message: DataSourceExternalSecret_AppRoleAuthOption): unknown {
- const obj: any = {};
- if (message.roleId !== "") {
- obj.roleId = message.roleId;
- }
- if (message.secretId !== "") {
- obj.secretId = message.secretId;
- }
- if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
- obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
- }
- if (message.mountPath !== "") {
- obj.mountPath = message.mountPath;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>): DataSourceExternalSecret_AppRoleAuthOption {
- return DataSourceExternalSecret_AppRoleAuthOption.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>,
- ): DataSourceExternalSecret_AppRoleAuthOption {
- const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
- message.roleId = object.roleId ?? "";
- message.secretId = object.secretId ?? "";
- message.type = object.type ?? DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
- message.mountPath = object.mountPath ?? "";
- return message;
- },
-};
-
-function createBaseDataSource(): DataSource {
- return {
- id: "",
- type: DataSourceType.DATA_SOURCE_UNSPECIFIED,
- username: "",
- password: "",
- useSsl: false,
- sslCa: "",
- sslCert: "",
- sslKey: "",
- host: "",
- port: "",
- database: "",
- srv: false,
- authenticationDatabase: "",
- replicaSet: "",
- sid: "",
- serviceName: "",
- sshHost: "",
- sshPort: "",
- sshUser: "",
- sshPassword: "",
- sshPrivateKey: "",
- authenticationPrivateKey: "",
- externalSecret: undefined,
- authenticationType: DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
- azureCredential: undefined,
- awsCredential: undefined,
- gcpCredential: undefined,
- saslConfig: undefined,
- additionalAddresses: [],
- directConnection: false,
- region: "",
- warehouseId: "",
- masterName: "",
- masterUsername: "",
- masterPassword: "",
- redisType: DataSource_RedisType.REDIS_TYPE_UNSPECIFIED,
- cluster: "",
- extraConnectionParameters: {},
- };
-}
-
-export const DataSource: MessageFns<DataSource> = {
- encode(message: DataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
- writer.uint32(16).int32(dataSourceTypeToNumber(message.type));
- }
- if (message.username !== "") {
- writer.uint32(26).string(message.username);
- }
- if (message.password !== "") {
- writer.uint32(34).string(message.password);
- }
- if (message.useSsl !== false) {
- writer.uint32(240).bool(message.useSsl);
- }
- if (message.sslCa !== "") {
- writer.uint32(42).string(message.sslCa);
- }
- if (message.sslCert !== "") {
- writer.uint32(50).string(message.sslCert);
- }
- if (message.sslKey !== "") {
- writer.uint32(58).string(message.sslKey);
- }
- if (message.host !== "") {
- writer.uint32(66).string(message.host);
- }
- if (message.port !== "") {
- writer.uint32(74).string(message.port);
- }
- if (message.database !== "") {
- writer.uint32(82).string(message.database);
- }
- if (message.srv !== false) {
- writer.uint32(88).bool(message.srv);
- }
- if (message.authenticationDatabase !== "") {
- writer.uint32(98).string(message.authenticationDatabase);
- }
- if (message.replicaSet !== "") {
- writer.uint32(202).string(message.replicaSet);
- }
- if (message.sid !== "") {
- writer.uint32(106).string(message.sid);
- }
- if (message.serviceName !== "") {
- writer.uint32(114).string(message.serviceName);
- }
- if (message.sshHost !== "") {
- writer.uint32(122).string(message.sshHost);
- }
- if (message.sshPort !== "") {
- writer.uint32(130).string(message.sshPort);
- }
- if (message.sshUser !== "") {
- writer.uint32(138).string(message.sshUser);
- }
- if (message.sshPassword !== "") {
- writer.uint32(146).string(message.sshPassword);
- }
- if (message.sshPrivateKey !== "") {
- writer.uint32(154).string(message.sshPrivateKey);
- }
- if (message.authenticationPrivateKey !== "") {
- writer.uint32(162).string(message.authenticationPrivateKey);
- }
- if (message.externalSecret !== undefined) {
- DataSourceExternalSecret.encode(message.externalSecret, writer.uint32(170).fork()).join();
- }
- if (message.authenticationType !== DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
- writer.uint32(176).int32(dataSource_AuthenticationTypeToNumber(message.authenticationType));
- }
- if (message.azureCredential !== undefined) {
- DataSource_AzureCredential.encode(message.azureCredential, writer.uint32(186).fork()).join();
- }
- if (message.awsCredential !== undefined) {
- DataSource_AWSCredential.encode(message.awsCredential, writer.uint32(298).fork()).join();
- }
- if (message.gcpCredential !== undefined) {
- DataSource_GCPCredential.encode(message.gcpCredential, writer.uint32(306).fork()).join();
- }
- if (message.saslConfig !== undefined) {
- SASLConfig.encode(message.saslConfig, writer.uint32(194).fork()).join();
- }
- for (const v of message.additionalAddresses) {
- DataSource_Address.encode(v!, writer.uint32(210).fork()).join();
- }
- if (message.directConnection !== false) {
- writer.uint32(216).bool(message.directConnection);
- }
- if (message.region !== "") {
- writer.uint32(226).string(message.region);
- }
- if (message.warehouseId !== "") {
- writer.uint32(234).string(message.warehouseId);
- }
- if (message.masterName !== "") {
- writer.uint32(250).string(message.masterName);
- }
- if (message.masterUsername !== "") {
- writer.uint32(258).string(message.masterUsername);
- }
- if (message.masterPassword !== "") {
- writer.uint32(266).string(message.masterPassword);
- }
- if (message.redisType !== DataSource_RedisType.REDIS_TYPE_UNSPECIFIED) {
- writer.uint32(272).int32(dataSource_RedisTypeToNumber(message.redisType));
- }
- if (message.cluster !== "") {
- writer.uint32(282).string(message.cluster);
- }
- Object.entries(message.extraConnectionParameters).forEach(([key, value]) => {
- DataSource_ExtraConnectionParametersEntry.encode({ key: key as any, value }, writer.uint32(290).fork()).join();
- });
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.type = dataSourceTypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.username = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- case 30: {
- if (tag !== 240) {
- break;
- }
-
- message.useSsl = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.sslCa = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.sslCert = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.sslKey = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.host = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.port = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.srv = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.authenticationDatabase = reader.string();
- continue;
- }
- case 25: {
- if (tag !== 202) {
- break;
- }
-
- message.replicaSet = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.sid = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.serviceName = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.sshHost = reader.string();
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.sshPort = reader.string();
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.sshUser = reader.string();
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.sshPassword = reader.string();
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.sshPrivateKey = reader.string();
- continue;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.authenticationPrivateKey = reader.string();
- continue;
- }
- case 21: {
- if (tag !== 170) {
- break;
- }
-
- message.externalSecret = DataSourceExternalSecret.decode(reader, reader.uint32());
- continue;
- }
- case 22: {
- if (tag !== 176) {
- break;
- }
-
- message.authenticationType = dataSource_AuthenticationTypeFromJSON(reader.int32());
- continue;
- }
- case 23: {
- if (tag !== 186) {
- break;
- }
-
- message.azureCredential = DataSource_AzureCredential.decode(reader, reader.uint32());
- continue;
- }
- case 37: {
- if (tag !== 298) {
- break;
- }
-
- message.awsCredential = DataSource_AWSCredential.decode(reader, reader.uint32());
- continue;
- }
- case 38: {
- if (tag !== 306) {
- break;
- }
-
- message.gcpCredential = DataSource_GCPCredential.decode(reader, reader.uint32());
- continue;
- }
- case 24: {
- if (tag !== 194) {
- break;
- }
-
- message.saslConfig = SASLConfig.decode(reader, reader.uint32());
- continue;
- }
- case 26: {
- if (tag !== 210) {
- break;
- }
-
- message.additionalAddresses.push(DataSource_Address.decode(reader, reader.uint32()));
- continue;
- }
- case 27: {
- if (tag !== 216) {
- break;
- }
-
- message.directConnection = reader.bool();
- continue;
- }
- case 28: {
- if (tag !== 226) {
- break;
- }
-
- message.region = reader.string();
- continue;
- }
- case 29: {
- if (tag !== 234) {
- break;
- }
-
- message.warehouseId = reader.string();
- continue;
- }
- case 31: {
- if (tag !== 250) {
- break;
- }
-
- message.masterName = reader.string();
- continue;
- }
- case 32: {
- if (tag !== 258) {
- break;
- }
-
- message.masterUsername = reader.string();
- continue;
- }
- case 33: {
- if (tag !== 266) {
- break;
- }
-
- message.masterPassword = reader.string();
- continue;
- }
- case 34: {
- if (tag !== 272) {
- break;
- }
-
- message.redisType = dataSource_RedisTypeFromJSON(reader.int32());
- continue;
- }
- case 35: {
- if (tag !== 282) {
- break;
- }
-
- message.cluster = reader.string();
- continue;
- }
- case 36: {
- if (tag !== 290) {
- break;
- }
-
- const entry36 = DataSource_ExtraConnectionParametersEntry.decode(reader, reader.uint32());
- if (entry36.value !== undefined) {
- message.extraConnectionParameters[entry36.key] = entry36.value;
- }
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- type: isSet(object.type) ? dataSourceTypeFromJSON(object.type) : DataSourceType.DATA_SOURCE_UNSPECIFIED,
- username: isSet(object.username) ? globalThis.String(object.username) : "",
- password: isSet(object.password) ? globalThis.String(object.password) : "",
- useSsl: isSet(object.useSsl) ? globalThis.Boolean(object.useSsl) : false,
- sslCa: isSet(object.sslCa) ? globalThis.String(object.sslCa) : "",
- sslCert: isSet(object.sslCert) ? globalThis.String(object.sslCert) : "",
- sslKey: isSet(object.sslKey) ? globalThis.String(object.sslKey) : "",
- host: isSet(object.host) ? globalThis.String(object.host) : "",
- port: isSet(object.port) ? globalThis.String(object.port) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- srv: isSet(object.srv) ? globalThis.Boolean(object.srv) : false,
- authenticationDatabase: isSet(object.authenticationDatabase)
- ? globalThis.String(object.authenticationDatabase)
- : "",
- replicaSet: isSet(object.replicaSet) ? globalThis.String(object.replicaSet) : "",
- sid: isSet(object.sid) ? globalThis.String(object.sid) : "",
- serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
- sshHost: isSet(object.sshHost) ? globalThis.String(object.sshHost) : "",
- sshPort: isSet(object.sshPort) ? globalThis.String(object.sshPort) : "",
- sshUser: isSet(object.sshUser) ? globalThis.String(object.sshUser) : "",
- sshPassword: isSet(object.sshPassword) ? globalThis.String(object.sshPassword) : "",
- sshPrivateKey: isSet(object.sshPrivateKey) ? globalThis.String(object.sshPrivateKey) : "",
- authenticationPrivateKey: isSet(object.authenticationPrivateKey)
- ? globalThis.String(object.authenticationPrivateKey)
- : "",
- externalSecret: isSet(object.externalSecret)
- ? DataSourceExternalSecret.fromJSON(object.externalSecret)
- : undefined,
- authenticationType: isSet(object.authenticationType)
- ? dataSource_AuthenticationTypeFromJSON(object.authenticationType)
- : DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
- azureCredential: isSet(object.azureCredential)
- ? DataSource_AzureCredential.fromJSON(object.azureCredential)
- : undefined,
- awsCredential: isSet(object.awsCredential) ? DataSource_AWSCredential.fromJSON(object.awsCredential) : undefined,
- gcpCredential: isSet(object.gcpCredential) ? DataSource_GCPCredential.fromJSON(object.gcpCredential) : undefined,
- saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
- additionalAddresses: globalThis.Array.isArray(object?.additionalAddresses)
- ? object.additionalAddresses.map((e: any) => DataSource_Address.fromJSON(e))
- : [],
- directConnection: isSet(object.directConnection) ? globalThis.Boolean(object.directConnection) : false,
- region: isSet(object.region) ? globalThis.String(object.region) : "",
- warehouseId: isSet(object.warehouseId) ? globalThis.String(object.warehouseId) : "",
- masterName: isSet(object.masterName) ? globalThis.String(object.masterName) : "",
- masterUsername: isSet(object.masterUsername) ? globalThis.String(object.masterUsername) : "",
- masterPassword: isSet(object.masterPassword) ? globalThis.String(object.masterPassword) : "",
- redisType: isSet(object.redisType)
- ? dataSource_RedisTypeFromJSON(object.redisType)
- : DataSource_RedisType.REDIS_TYPE_UNSPECIFIED,
- cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
- extraConnectionParameters: isObject(object.extraConnectionParameters)
- ? Object.entries(object.extraConnectionParameters).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- };
- },
-
- toJSON(message: DataSource): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
- obj.type = dataSourceTypeToJSON(message.type);
- }
- if (message.username !== "") {
- obj.username = message.username;
- }
- if (message.password !== "") {
- obj.password = message.password;
- }
- if (message.useSsl !== false) {
- obj.useSsl = message.useSsl;
- }
- if (message.sslCa !== "") {
- obj.sslCa = message.sslCa;
- }
- if (message.sslCert !== "") {
- obj.sslCert = message.sslCert;
- }
- if (message.sslKey !== "") {
- obj.sslKey = message.sslKey;
- }
- if (message.host !== "") {
- obj.host = message.host;
- }
- if (message.port !== "") {
- obj.port = message.port;
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.srv !== false) {
- obj.srv = message.srv;
- }
- if (message.authenticationDatabase !== "") {
- obj.authenticationDatabase = message.authenticationDatabase;
- }
- if (message.replicaSet !== "") {
- obj.replicaSet = message.replicaSet;
- }
- if (message.sid !== "") {
- obj.sid = message.sid;
- }
- if (message.serviceName !== "") {
- obj.serviceName = message.serviceName;
- }
- if (message.sshHost !== "") {
- obj.sshHost = message.sshHost;
- }
- if (message.sshPort !== "") {
- obj.sshPort = message.sshPort;
- }
- if (message.sshUser !== "") {
- obj.sshUser = message.sshUser;
- }
- if (message.sshPassword !== "") {
- obj.sshPassword = message.sshPassword;
- }
- if (message.sshPrivateKey !== "") {
- obj.sshPrivateKey = message.sshPrivateKey;
- }
- if (message.authenticationPrivateKey !== "") {
- obj.authenticationPrivateKey = message.authenticationPrivateKey;
- }
- if (message.externalSecret !== undefined) {
- obj.externalSecret = DataSourceExternalSecret.toJSON(message.externalSecret);
- }
- if (message.authenticationType !== DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
- obj.authenticationType = dataSource_AuthenticationTypeToJSON(message.authenticationType);
- }
- if (message.azureCredential !== undefined) {
- obj.azureCredential = DataSource_AzureCredential.toJSON(message.azureCredential);
- }
- if (message.awsCredential !== undefined) {
- obj.awsCredential = DataSource_AWSCredential.toJSON(message.awsCredential);
- }
- if (message.gcpCredential !== undefined) {
- obj.gcpCredential = DataSource_GCPCredential.toJSON(message.gcpCredential);
- }
- if (message.saslConfig !== undefined) {
- obj.saslConfig = SASLConfig.toJSON(message.saslConfig);
- }
- if (message.additionalAddresses?.length) {
- obj.additionalAddresses = message.additionalAddresses.map((e) => DataSource_Address.toJSON(e));
- }
- if (message.directConnection !== false) {
- obj.directConnection = message.directConnection;
- }
- if (message.region !== "") {
- obj.region = message.region;
- }
- if (message.warehouseId !== "") {
- obj.warehouseId = message.warehouseId;
- }
- if (message.masterName !== "") {
- obj.masterName = message.masterName;
- }
- if (message.masterUsername !== "") {
- obj.masterUsername = message.masterUsername;
- }
- if (message.masterPassword !== "") {
- obj.masterPassword = message.masterPassword;
- }
- if (message.redisType !== DataSource_RedisType.REDIS_TYPE_UNSPECIFIED) {
- obj.redisType = dataSource_RedisTypeToJSON(message.redisType);
- }
- if (message.cluster !== "") {
- obj.cluster = message.cluster;
- }
- if (message.extraConnectionParameters) {
- const entries = Object.entries(message.extraConnectionParameters);
- if (entries.length > 0) {
- obj.extraConnectionParameters = {};
- entries.forEach(([k, v]) => {
- obj.extraConnectionParameters[k] = v;
- });
- }
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource>): DataSource {
- return DataSource.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSource>): DataSource {
- const message = createBaseDataSource();
- message.id = object.id ?? "";
- message.type = object.type ?? DataSourceType.DATA_SOURCE_UNSPECIFIED;
- message.username = object.username ?? "";
- message.password = object.password ?? "";
- message.useSsl = object.useSsl ?? false;
- message.sslCa = object.sslCa ?? "";
- message.sslCert = object.sslCert ?? "";
- message.sslKey = object.sslKey ?? "";
- message.host = object.host ?? "";
- message.port = object.port ?? "";
- message.database = object.database ?? "";
- message.srv = object.srv ?? false;
- message.authenticationDatabase = object.authenticationDatabase ?? "";
- message.replicaSet = object.replicaSet ?? "";
- message.sid = object.sid ?? "";
- message.serviceName = object.serviceName ?? "";
- message.sshHost = object.sshHost ?? "";
- message.sshPort = object.sshPort ?? "";
- message.sshUser = object.sshUser ?? "";
- message.sshPassword = object.sshPassword ?? "";
- message.sshPrivateKey = object.sshPrivateKey ?? "";
- message.authenticationPrivateKey = object.authenticationPrivateKey ?? "";
- message.externalSecret = (object.externalSecret !== undefined && object.externalSecret !== null)
- ? DataSourceExternalSecret.fromPartial(object.externalSecret)
- : undefined;
- message.authenticationType = object.authenticationType ?? DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- message.azureCredential = (object.azureCredential !== undefined && object.azureCredential !== null)
- ? DataSource_AzureCredential.fromPartial(object.azureCredential)
- : undefined;
- message.awsCredential = (object.awsCredential !== undefined && object.awsCredential !== null)
- ? DataSource_AWSCredential.fromPartial(object.awsCredential)
- : undefined;
- message.gcpCredential = (object.gcpCredential !== undefined && object.gcpCredential !== null)
- ? DataSource_GCPCredential.fromPartial(object.gcpCredential)
- : undefined;
- message.saslConfig = (object.saslConfig !== undefined && object.saslConfig !== null)
- ? SASLConfig.fromPartial(object.saslConfig)
- : undefined;
- message.additionalAddresses = object.additionalAddresses?.map((e) => DataSource_Address.fromPartial(e)) || [];
- message.directConnection = object.directConnection ?? false;
- message.region = object.region ?? "";
- message.warehouseId = object.warehouseId ?? "";
- message.masterName = object.masterName ?? "";
- message.masterUsername = object.masterUsername ?? "";
- message.masterPassword = object.masterPassword ?? "";
- message.redisType = object.redisType ?? DataSource_RedisType.REDIS_TYPE_UNSPECIFIED;
- message.cluster = object.cluster ?? "";
- message.extraConnectionParameters = Object.entries(object.extraConnectionParameters ?? {}).reduce<
- { [key: string]: string }
- >((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- return message;
- },
-};
-
-function createBaseDataSource_AzureCredential(): DataSource_AzureCredential {
- return { tenantId: "", clientId: "", clientSecret: "" };
-}
-
-export const DataSource_AzureCredential: MessageFns<DataSource_AzureCredential> = {
- encode(message: DataSource_AzureCredential, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.tenantId !== "") {
- writer.uint32(10).string(message.tenantId);
- }
- if (message.clientId !== "") {
- writer.uint32(18).string(message.clientId);
- }
- if (message.clientSecret !== "") {
- writer.uint32(26).string(message.clientSecret);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource_AzureCredential {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource_AzureCredential();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.tenantId = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.clientId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.clientSecret = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource_AzureCredential {
- return {
- tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
- clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
- clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
- };
- },
-
- toJSON(message: DataSource_AzureCredential): unknown {
- const obj: any = {};
- if (message.tenantId !== "") {
- obj.tenantId = message.tenantId;
- }
- if (message.clientId !== "") {
- obj.clientId = message.clientId;
- }
- if (message.clientSecret !== "") {
- obj.clientSecret = message.clientSecret;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource_AzureCredential>): DataSource_AzureCredential {
- return DataSource_AzureCredential.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSource_AzureCredential>): DataSource_AzureCredential {
- const message = createBaseDataSource_AzureCredential();
- message.tenantId = object.tenantId ?? "";
- message.clientId = object.clientId ?? "";
- message.clientSecret = object.clientSecret ?? "";
- return message;
- },
-};
-
-function createBaseDataSource_AWSCredential(): DataSource_AWSCredential {
- return { accessKeyId: "", secretAccessKey: "", sessionToken: "" };
-}
-
-export const DataSource_AWSCredential: MessageFns<DataSource_AWSCredential> = {
- encode(message: DataSource_AWSCredential, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.accessKeyId !== "") {
- writer.uint32(10).string(message.accessKeyId);
- }
- if (message.secretAccessKey !== "") {
- writer.uint32(18).string(message.secretAccessKey);
- }
- if (message.sessionToken !== "") {
- writer.uint32(26).string(message.sessionToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource_AWSCredential {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource_AWSCredential();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.accessKeyId = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.secretAccessKey = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.sessionToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource_AWSCredential {
- return {
- accessKeyId: isSet(object.accessKeyId) ? globalThis.String(object.accessKeyId) : "",
- secretAccessKey: isSet(object.secretAccessKey) ? globalThis.String(object.secretAccessKey) : "",
- sessionToken: isSet(object.sessionToken) ? globalThis.String(object.sessionToken) : "",
- };
- },
-
- toJSON(message: DataSource_AWSCredential): unknown {
- const obj: any = {};
- if (message.accessKeyId !== "") {
- obj.accessKeyId = message.accessKeyId;
- }
- if (message.secretAccessKey !== "") {
- obj.secretAccessKey = message.secretAccessKey;
- }
- if (message.sessionToken !== "") {
- obj.sessionToken = message.sessionToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource_AWSCredential>): DataSource_AWSCredential {
- return DataSource_AWSCredential.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSource_AWSCredential>): DataSource_AWSCredential {
- const message = createBaseDataSource_AWSCredential();
- message.accessKeyId = object.accessKeyId ?? "";
- message.secretAccessKey = object.secretAccessKey ?? "";
- message.sessionToken = object.sessionToken ?? "";
- return message;
- },
-};
-
-function createBaseDataSource_GCPCredential(): DataSource_GCPCredential {
- return { content: "" };
-}
-
-export const DataSource_GCPCredential: MessageFns<DataSource_GCPCredential> = {
- encode(message: DataSource_GCPCredential, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.content !== "") {
- writer.uint32(10).string(message.content);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource_GCPCredential {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource_GCPCredential();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.content = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource_GCPCredential {
- return { content: isSet(object.content) ? globalThis.String(object.content) : "" };
- },
-
- toJSON(message: DataSource_GCPCredential): unknown {
- const obj: any = {};
- if (message.content !== "") {
- obj.content = message.content;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource_GCPCredential>): DataSource_GCPCredential {
- return DataSource_GCPCredential.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSource_GCPCredential>): DataSource_GCPCredential {
- const message = createBaseDataSource_GCPCredential();
- message.content = object.content ?? "";
- return message;
- },
-};
-
-function createBaseDataSource_Address(): DataSource_Address {
- return { host: "", port: "" };
-}
-
-export const DataSource_Address: MessageFns<DataSource_Address> = {
- encode(message: DataSource_Address, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.host !== "") {
- writer.uint32(10).string(message.host);
- }
- if (message.port !== "") {
- writer.uint32(18).string(message.port);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource_Address {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource_Address();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.host = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.port = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource_Address {
- return {
- host: isSet(object.host) ? globalThis.String(object.host) : "",
- port: isSet(object.port) ? globalThis.String(object.port) : "",
- };
- },
-
- toJSON(message: DataSource_Address): unknown {
- const obj: any = {};
- if (message.host !== "") {
- obj.host = message.host;
- }
- if (message.port !== "") {
- obj.port = message.port;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource_Address>): DataSource_Address {
- return DataSource_Address.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSource_Address>): DataSource_Address {
- const message = createBaseDataSource_Address();
- message.host = object.host ?? "";
- message.port = object.port ?? "";
- return message;
- },
-};
-
-function createBaseDataSource_ExtraConnectionParametersEntry(): DataSource_ExtraConnectionParametersEntry {
- return { key: "", value: "" };
-}
-
-export const DataSource_ExtraConnectionParametersEntry: MessageFns<DataSource_ExtraConnectionParametersEntry> = {
- encode(message: DataSource_ExtraConnectionParametersEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSource_ExtraConnectionParametersEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSource_ExtraConnectionParametersEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSource_ExtraConnectionParametersEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: DataSource_ExtraConnectionParametersEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSource_ExtraConnectionParametersEntry>): DataSource_ExtraConnectionParametersEntry {
- return DataSource_ExtraConnectionParametersEntry.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataSource_ExtraConnectionParametersEntry>,
- ): DataSource_ExtraConnectionParametersEntry {
- const message = createBaseDataSource_ExtraConnectionParametersEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseInstanceResource(): InstanceResource {
- return {
- title: "",
- engine: Engine.ENGINE_UNSPECIFIED,
- engineVersion: "",
- dataSources: [],
- activation: false,
- name: "",
- environment: "",
- };
-}
-
-export const InstanceResource: MessageFns<InstanceResource> = {
- encode(message: InstanceResource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.title !== "") {
- writer.uint32(10).string(message.title);
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(16).int32(engineToNumber(message.engine));
- }
- if (message.engineVersion !== "") {
- writer.uint32(26).string(message.engineVersion);
- }
- for (const v of message.dataSources) {
- DataSource.encode(v!, writer.uint32(34).fork()).join();
- }
- if (message.activation !== false) {
- writer.uint32(40).bool(message.activation);
- }
- if (message.name !== "") {
- writer.uint32(50).string(message.name);
- }
- if (message.environment !== "") {
- writer.uint32(58).string(message.environment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): InstanceResource {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInstanceResource();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.engineVersion = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.dataSources.push(DataSource.decode(reader, reader.uint32()));
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.activation = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): InstanceResource {
- return {
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- engineVersion: isSet(object.engineVersion) ? globalThis.String(object.engineVersion) : "",
- dataSources: globalThis.Array.isArray(object?.dataSources)
- ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
- : [],
- activation: isSet(object.activation) ? globalThis.Boolean(object.activation) : false,
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- };
- },
-
- toJSON(message: InstanceResource): unknown {
- const obj: any = {};
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.engineVersion !== "") {
- obj.engineVersion = message.engineVersion;
- }
- if (message.dataSources?.length) {
- obj.dataSources = message.dataSources.map((e) => DataSource.toJSON(e));
- }
- if (message.activation !== false) {
- obj.activation = message.activation;
- }
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<InstanceResource>): InstanceResource {
- return InstanceResource.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<InstanceResource>): InstanceResource {
- const message = createBaseInstanceResource();
- message.title = object.title ?? "";
- 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;
- message.name = object.name ?? "";
- message.environment = object.environment ?? "";
- return message;
- },
-};
-
-function createBaseSASLConfig(): SASLConfig {
- return { krbConfig: undefined };
-}
-
-export const SASLConfig: MessageFns<SASLConfig> = {
- encode(message: SASLConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.krbConfig !== undefined) {
- KerberosConfig.encode(message.krbConfig, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SASLConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSASLConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.krbConfig = KerberosConfig.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SASLConfig {
- return { krbConfig: isSet(object.krbConfig) ? KerberosConfig.fromJSON(object.krbConfig) : undefined };
- },
-
- toJSON(message: SASLConfig): unknown {
- const obj: any = {};
- if (message.krbConfig !== undefined) {
- obj.krbConfig = KerberosConfig.toJSON(message.krbConfig);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SASLConfig>): SASLConfig {
- return SASLConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SASLConfig>): SASLConfig {
- const message = createBaseSASLConfig();
- message.krbConfig = (object.krbConfig !== undefined && object.krbConfig !== null)
- ? KerberosConfig.fromPartial(object.krbConfig)
- : undefined;
- return message;
- },
-};
-
-function createBaseKerberosConfig(): KerberosConfig {
- return {
- primary: "",
- instance: "",
- realm: "",
- keytab: new Uint8Array(0),
- kdcHost: "",
- kdcPort: "",
- kdcTransportProtocol: "",
- };
-}
-
-export const KerberosConfig: MessageFns<KerberosConfig> = {
- encode(message: KerberosConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.primary !== "") {
- writer.uint32(10).string(message.primary);
- }
- if (message.instance !== "") {
- writer.uint32(18).string(message.instance);
- }
- if (message.realm !== "") {
- writer.uint32(26).string(message.realm);
- }
- if (message.keytab.length !== 0) {
- writer.uint32(34).bytes(message.keytab);
- }
- if (message.kdcHost !== "") {
- writer.uint32(42).string(message.kdcHost);
- }
- if (message.kdcPort !== "") {
- writer.uint32(50).string(message.kdcPort);
- }
- if (message.kdcTransportProtocol !== "") {
- writer.uint32(58).string(message.kdcTransportProtocol);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): KerberosConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseKerberosConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.primary = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.instance = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.realm = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.keytab = reader.bytes();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.kdcHost = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.kdcPort = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.kdcTransportProtocol = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): KerberosConfig {
- return {
- primary: isSet(object.primary) ? globalThis.String(object.primary) : "",
- instance: isSet(object.instance) ? globalThis.String(object.instance) : "",
- realm: isSet(object.realm) ? globalThis.String(object.realm) : "",
- keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),
- kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",
- kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",
- kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",
- };
- },
-
- toJSON(message: KerberosConfig): unknown {
- const obj: any = {};
- if (message.primary !== "") {
- obj.primary = message.primary;
- }
- if (message.instance !== "") {
- obj.instance = message.instance;
- }
- if (message.realm !== "") {
- obj.realm = message.realm;
- }
- if (message.keytab.length !== 0) {
- obj.keytab = base64FromBytes(message.keytab);
- }
- if (message.kdcHost !== "") {
- obj.kdcHost = message.kdcHost;
- }
- if (message.kdcPort !== "") {
- obj.kdcPort = message.kdcPort;
- }
- if (message.kdcTransportProtocol !== "") {
- obj.kdcTransportProtocol = message.kdcTransportProtocol;
- }
- return obj;
- },
-
- create(base?: DeepPartial<KerberosConfig>): KerberosConfig {
- return KerberosConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<KerberosConfig>): KerberosConfig {
- const message = createBaseKerberosConfig();
- message.primary = object.primary ?? "";
- message.instance = object.instance ?? "";
- message.realm = object.realm ?? "";
- message.keytab = object.keytab ?? new Uint8Array(0);
- message.kdcHost = object.kdcHost ?? "";
- message.kdcPort = object.kdcPort ?? "";
- message.kdcTransportProtocol = object.kdcTransportProtocol ?? "";
- return message;
- },
-};
-
-export type InstanceServiceDefinition = typeof InstanceServiceDefinition;
-export const InstanceServiceDefinition = {
- name: "InstanceService",
- fullName: "bytebase.v1.InstanceService",
- methods: {
- /** Permissions required: bb.instances.get */
- getInstance: {
- name: "GetInstance",
- requestType: GetInstanceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 24,
- 18,
- 22,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.list */
- listInstances: {
- name: "ListInstances",
- requestType: ListInstancesRequest,
- requestStream: false,
- responseType: ListInstancesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([17, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([15, 18, 13, 47, 118, 49, 47, 105, 110, 115, 116, 97, 110, 99, 101, 115])],
- },
- },
- },
- /** Permissions required: bb.instances.create */
- createInstance: {
- name: "CreateInstance",
- requestType: CreateInstanceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([8, 105, 110, 115, 116, 97, 110, 99, 101])],
- 800010: [
- new Uint8Array([19, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 25,
- 58,
- 8,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 34,
- 13,
- 47,
- 118,
- 49,
- 47,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.update */
- updateInstance: {
- name: "UpdateInstance",
- requestType: UpdateInstanceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 20,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 8,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 50,
- 31,
- 47,
- 118,
- 49,
- 47,
- 123,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.delete */
- deleteInstance: {
- name: "DeleteInstance",
- requestType: DeleteInstanceRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 24,
- 42,
- 22,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.undelete */
- undeleteInstance: {
- name: "UndeleteInstance",
- requestType: UndeleteInstanceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 36,
- 58,
- 1,
- 42,
- 34,
- 31,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.sync */
- syncInstance: {
- name: "SyncInstance",
- requestType: SyncInstanceRequest,
- requestStream: false,
- responseType: SyncInstanceResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([17, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 115, 121, 110, 99])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 58,
- 1,
- 42,
- 34,
- 27,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 115,
- 121,
- 110,
- 99,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.get */
- listInstanceDatabase: {
- name: "ListInstanceDatabase",
- requestType: ListInstanceDatabaseRequest,
- requestStream: false,
- responseType: ListInstanceDatabaseResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 37,
- 58,
- 1,
- 42,
- 34,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.sync */
- batchSyncInstances: {
- name: "BatchSyncInstances",
- requestType: BatchSyncInstancesRequest,
- requestStream: false,
- responseType: BatchSyncInstancesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([17, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 115, 121, 110, 99])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 28,
- 58,
- 1,
- 42,
- 34,
- 23,
- 47,
- 118,
- 49,
- 47,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 83,
- 121,
- 110,
- 99,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.update */
- batchUpdateInstances: {
- name: "BatchUpdateInstances",
- requestType: BatchUpdateInstancesRequest,
- requestStream: false,
- responseType: BatchUpdateInstancesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 30,
- 58,
- 1,
- 42,
- 34,
- 25,
- 47,
- 118,
- 49,
- 47,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 85,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.update */
- addDataSource: {
- name: "AddDataSource",
- requestType: AddDataSourceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 41,
- 58,
- 1,
- 42,
- 34,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 97,
- 100,
- 100,
- 68,
- 97,
- 116,
- 97,
- 83,
- 111,
- 117,
- 114,
- 99,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.update */
- removeDataSource: {
- name: "RemoveDataSource",
- requestType: RemoveDataSourceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 44,
- 58,
- 1,
- 42,
- 34,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 114,
- 101,
- 109,
- 111,
- 118,
- 101,
- 68,
- 97,
- 116,
- 97,
- 83,
- 111,
- 117,
- 114,
- 99,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.instances.update */
- updateDataSource: {
- name: "UpdateDataSource",
- requestType: UpdateDataSourceRequest,
- requestStream: false,
- responseType: Instance,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 44,
- 58,
- 1,
- 42,
- 50,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 68,
- 97,
- 116,
- 97,
- 83,
- 111,
- 117,
- 114,
- 99,
- 101,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.ts
deleted file mode 100644
index b065103a5b..0000000000
--- a/frontend/src/types/proto/v1/issue_service.ts
+++ /dev/null
@@ -1,5095 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/issue_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Duration } from "../google/protobuf/duration";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { Expr } from "../google/type/expr";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum IssueStatus {
- ISSUE_STATUS_UNSPECIFIED = "ISSUE_STATUS_UNSPECIFIED",
- OPEN = "OPEN",
- DONE = "DONE",
- CANCELED = "CANCELED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function issueStatusFromJSON(object: any): IssueStatus {
- switch (object) {
- case 0:
- case "ISSUE_STATUS_UNSPECIFIED":
- return IssueStatus.ISSUE_STATUS_UNSPECIFIED;
- case 1:
- case "OPEN":
- return IssueStatus.OPEN;
- case 2:
- case "DONE":
- return IssueStatus.DONE;
- case 3:
- case "CANCELED":
- return IssueStatus.CANCELED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return IssueStatus.UNRECOGNIZED;
- }
-}
-
-export function issueStatusToJSON(object: IssueStatus): string {
- switch (object) {
- case IssueStatus.ISSUE_STATUS_UNSPECIFIED:
- return "ISSUE_STATUS_UNSPECIFIED";
- case IssueStatus.OPEN:
- return "OPEN";
- case IssueStatus.DONE:
- return "DONE";
- case IssueStatus.CANCELED:
- return "CANCELED";
- case IssueStatus.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * Format: projects/{project}/issues/{issue}
- */
- name: string;
- force: boolean;
-}
-
-export interface CreateIssueRequest {
- /**
- * The parent, which owns this collection of issues.
- * Format: projects/{project}
- */
- parent: string;
- /** The issue to create. */
- issue: Issue | undefined;
-}
-
-export interface ListIssuesRequest {
- /**
- * The parent, which owns this collection of issues.
- * Format: projects/{project}
- */
- parent: string;
- /**
- * The maximum number of issues to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 issues will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListIssues` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListIssues` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /**
- * Filter is used to filter issues returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
- * - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
- * - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
- * - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
- * - task_type: support "==" operator, the value can be "DDL", "DML" or "DATA_EXPORT"
- * - instance: the instance full name in the "instances/{id}" format, support "==" operator.
- * - database: the database full name in the "instances/{id}/databases/{name}" format, support "==" operator.
- * - labels: the issue labels, support "==" and "in" operator.
- * - has_pipeline: the issue has pipeline or not, support "==" operator, the value should be "true" or "false".
- *
- * For example:
- * creator == "users/[email protected]" && status in ["OPEN", "DONE"]
- * status == "CANCELED" && type == "DATABASE_CHANGE"
- * instance == "instances/sample" && labels in ["label1", "label2"]
- * has_pipeline == true && create_time >= "2025-01-02T15:04:05Z07:00"
- */
- filter: string;
- /** Query is the query statement. */
- query: string;
-}
-
-export interface ListIssuesResponse {
- /** The issues from the specified request. */
- issues: Issue[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface SearchIssuesRequest {
- /**
- * The parent, which owns this collection of issues.
- * Format: projects/{project}
- * Use "projects/-" to list all issues from all projects.
- */
- parent: string;
- /**
- * The maximum number of issues to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 issues will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `SearchIssues` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `SearchIssues` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /**
- * Filter is used to filter issues returned in the list.
- * Check the filter field in the ListIssuesRequest message.
- */
- filter: string;
- /** Query is the query statement. */
- query: string;
-}
-
-export interface SearchIssuesResponse {
- /** The issues from the specified request. */
- issues: Issue[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface UpdateIssueRequest {
- /**
- * The issue to update.
- *
- * The issue's `name` field is used to identify the issue to update.
- * Format: projects/{project}/issues/{issue}
- */
- issue:
- | Issue
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface BatchUpdateIssuesStatusRequest {
- /**
- * The parent resource shared by all issues being updated.
- * Format: projects/{project}
- * If the operation spans parents, a dash (-) may be accepted as a wildcard.
- * We only support updating the status of databases for now.
- */
- parent: string;
- /**
- * The list of issues to update.
- * Format: projects/{project}/issues/{issue}
- */
- issues: string[];
- /** The new status. */
- status: IssueStatus;
- reason: string;
-}
-
-export interface BatchUpdateIssuesStatusResponse {
-}
-
-export interface ApproveIssueRequest {
- /**
- * The name of the issue to add an approver.
- * Format: projects/{project}/issues/{issue}
- */
- name: string;
- comment: string;
-}
-
-export interface RejectIssueRequest {
- /**
- * The name of the issue to add an rejection.
- * Format: projects/{project}/issues/{issue}
- */
- name: string;
- comment: string;
-}
-
-export interface RequestIssueRequest {
- /**
- * The name of the issue to request a issue.
- * Format: projects/{project}/issues/{issue}
- */
- name: string;
- comment: string;
-}
-
-export interface Issue {
- /**
- * The name of the issue.
- * Format: projects/{project}/issues/{issue}
- */
- name: string;
- title: string;
- description: string;
- type: Issue_Type;
- status: IssueStatus;
- approvers: Issue_Approver[];
- approvalTemplates: ApprovalTemplate[];
- /**
- * If the value is `false`, it means that the backend is still finding matching approval templates.
- * If `true`, approval_templates & approvers & approval_finding_error are available.
- */
- approvalFindingDone: boolean;
- approvalFindingError: string;
- /** Format: users/[email protected] */
- creator: string;
- createTime: Timestamp | undefined;
- updateTime:
- | Timestamp
- | undefined;
- /**
- * The plan associated with the issue.
- * Can be empty.
- * Format: projects/{project}/plans/{plan}
- */
- plan: string;
- /**
- * The rollout associated with the issue.
- * Can be empty.
- * Format: projects/{project}/rollouts/{rollout}
- */
- rollout: string;
- /** Used if the issue type is GRANT_REQUEST. */
- grantRequest:
- | GrantRequest
- | undefined;
- /**
- * The releasers of the pending stage of the issue rollout, judging
- * from the rollout policy.
- * Format:
- * - roles/workspaceOwner
- * - roles/workspaceDBA
- * - roles/projectOwner
- * - roles/projectReleaser
- * - users/{email}
- */
- releasers: string[];
- riskLevel: Issue_RiskLevel;
- /**
- * The status count of the issue.
- * Keys are the following:
- * - NOT_STARTED
- * - SKIPPED
- * - PENDING
- * - RUNNING
- * - DONE
- * - FAILED
- * - CANCELED
- */
- taskStatusCount: { [key: string]: number };
- labels: string[];
-}
-
-export enum Issue_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- DATABASE_CHANGE = "DATABASE_CHANGE",
- GRANT_REQUEST = "GRANT_REQUEST",
- DATABASE_EXPORT = "DATABASE_EXPORT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function issue_TypeFromJSON(object: any): Issue_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Issue_Type.TYPE_UNSPECIFIED;
- case 1:
- case "DATABASE_CHANGE":
- return Issue_Type.DATABASE_CHANGE;
- case 2:
- case "GRANT_REQUEST":
- return Issue_Type.GRANT_REQUEST;
- case 3:
- case "DATABASE_EXPORT":
- return Issue_Type.DATABASE_EXPORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Issue_Type.UNRECOGNIZED;
- }
-}
-
-export function issue_TypeToJSON(object: Issue_Type): string {
- switch (object) {
- case Issue_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Issue_Type.DATABASE_CHANGE:
- return "DATABASE_CHANGE";
- case Issue_Type.GRANT_REQUEST:
- return "GRANT_REQUEST";
- case Issue_Type.DATABASE_EXPORT:
- return "DATABASE_EXPORT";
- case Issue_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_EXPORT:
- return 3;
- case Issue_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum Issue_RiskLevel {
- RISK_LEVEL_UNSPECIFIED = "RISK_LEVEL_UNSPECIFIED",
- LOW = "LOW",
- MODERATE = "MODERATE",
- HIGH = "HIGH",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function issue_RiskLevelFromJSON(object: any): Issue_RiskLevel {
- switch (object) {
- case 0:
- case "RISK_LEVEL_UNSPECIFIED":
- return Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED;
- case 1:
- case "LOW":
- return Issue_RiskLevel.LOW;
- case 2:
- case "MODERATE":
- return Issue_RiskLevel.MODERATE;
- case 3:
- case "HIGH":
- return Issue_RiskLevel.HIGH;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Issue_RiskLevel.UNRECOGNIZED;
- }
-}
-
-export function issue_RiskLevelToJSON(object: Issue_RiskLevel): string {
- switch (object) {
- case Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED:
- return "RISK_LEVEL_UNSPECIFIED";
- case Issue_RiskLevel.LOW:
- return "LOW";
- case Issue_RiskLevel.MODERATE:
- return "MODERATE";
- case Issue_RiskLevel.HIGH:
- return "HIGH";
- case Issue_RiskLevel.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- /** Format: users/[email protected] */
- principal: string;
-}
-
-export enum Issue_Approver_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- PENDING = "PENDING",
- APPROVED = "APPROVED",
- REJECTED = "REJECTED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function issue_Approver_StatusFromJSON(object: any): Issue_Approver_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return Issue_Approver_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return Issue_Approver_Status.PENDING;
- case 2:
- case "APPROVED":
- return Issue_Approver_Status.APPROVED;
- case 3:
- case "REJECTED":
- return Issue_Approver_Status.REJECTED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Issue_Approver_Status.UNRECOGNIZED;
- }
-}
-
-export function issue_Approver_StatusToJSON(object: Issue_Approver_Status): string {
- switch (object) {
- case Issue_Approver_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case Issue_Approver_Status.PENDING:
- return "PENDING";
- case Issue_Approver_Status.APPROVED:
- return "APPROVED";
- case Issue_Approver_Status.REJECTED:
- return "REJECTED";
- case Issue_Approver_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
-}
-
-export interface GrantRequest {
- /**
- * The requested role.
- * Format: roles/EXPORTER.
- */
- role: string;
- /**
- * The user to be granted.
- * Format: users/{email}.
- */
- user: string;
- /** The condition for the role. Same as the condtion in IAM Binding message. */
- condition: Expr | undefined;
- expiration: Duration | undefined;
-}
-
-export interface ApprovalTemplate {
- flow: ApprovalFlow | undefined;
- title: string;
- description: string;
-}
-
-export interface ApprovalFlow {
- steps: ApprovalStep[];
-}
-
-export interface ApprovalStep {
- type: ApprovalStep_Type;
- nodes: ApprovalNode[];
-}
-
-/**
- * Type of the ApprovalStep
- * ALL means every node must be approved to proceed.
- * ANY means approving any node will proceed.
- */
-export enum ApprovalStep_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- ALL = "ALL",
- ANY = "ANY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function approvalStep_TypeFromJSON(object: any): ApprovalStep_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return ApprovalStep_Type.TYPE_UNSPECIFIED;
- case 1:
- case "ALL":
- return ApprovalStep_Type.ALL;
- case 2:
- case "ANY":
- return ApprovalStep_Type.ANY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ApprovalStep_Type.UNRECOGNIZED;
- }
-}
-
-export function approvalStep_TypeToJSON(object: ApprovalStep_Type): string {
- switch (object) {
- case ApprovalStep_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case ApprovalStep_Type.ALL:
- return "ALL";
- case ApprovalStep_Type.ANY:
- return "ANY";
- case ApprovalStep_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- role: string;
-}
-
-/**
- * Type of the ApprovalNode.
- * type determines who should approve this node.
- * ANY_IN_GROUP means the ApprovalNode can be approved by an user from our predefined user group.
- * See GroupValue below for the predefined user groups.
- */
-export enum ApprovalNode_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- ANY_IN_GROUP = "ANY_IN_GROUP",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function approvalNode_TypeFromJSON(object: any): ApprovalNode_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return ApprovalNode_Type.TYPE_UNSPECIFIED;
- case 1:
- case "ANY_IN_GROUP":
- return ApprovalNode_Type.ANY_IN_GROUP;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ApprovalNode_Type.UNRECOGNIZED;
- }
-}
-
-export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
- switch (object) {
- case ApprovalNode_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case ApprovalNode_Type.ANY_IN_GROUP:
- return "ANY_IN_GROUP";
- case ApprovalNode_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- }
-}
-
-export interface ListIssueCommentsRequest {
- /** Format: projects/{projects}/issues/{issue} */
- parent: string;
- /**
- * The maximum number of issue comments to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 issue comments will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListIssueComments` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListIssueComments` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListIssueCommentsResponse {
- issueComments: IssueComment[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateIssueCommentRequest {
- /**
- * The issue name
- * Format: projects/{project}/issues/{issue}
- */
- parent: string;
- issueComment: IssueComment | undefined;
-}
-
-export interface UpdateIssueCommentRequest {
- /**
- * The issue name
- * Format: projects/{project}/issues/{issue}
- */
- parent: string;
- issueComment:
- | IssueComment
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface IssueComment {
- /** Format: projects/{project}/issues/{issue}/issueComments/{issueComment-uid} */
- name: string;
- comment: string;
- /** TODO: use struct message instead. */
- payload: string;
- createTime: Timestamp | undefined;
- updateTime:
- | Timestamp
- | undefined;
- /** Format: users/{email} */
- creator: string;
- approval?: IssueComment_Approval | undefined;
- issueUpdate?: IssueComment_IssueUpdate | undefined;
- stageEnd?: IssueComment_StageEnd | undefined;
- taskUpdate?: IssueComment_TaskUpdate | undefined;
- taskPriorBackup?: IssueComment_TaskPriorBackup | undefined;
-}
-
-export interface IssueComment_Approval {
- status: IssueComment_Approval_Status;
-}
-
-export enum IssueComment_Approval_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- PENDING = "PENDING",
- APPROVED = "APPROVED",
- REJECTED = "REJECTED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function issueComment_Approval_StatusFromJSON(object: any): IssueComment_Approval_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return IssueComment_Approval_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return IssueComment_Approval_Status.PENDING;
- case 2:
- case "APPROVED":
- return IssueComment_Approval_Status.APPROVED;
- case 3:
- case "REJECTED":
- return IssueComment_Approval_Status.REJECTED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return IssueComment_Approval_Status.UNRECOGNIZED;
- }
-}
-
-export function issueComment_Approval_StatusToJSON(object: IssueComment_Approval_Status): string {
- switch (object) {
- case IssueComment_Approval_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case IssueComment_Approval_Status.PENDING:
- return "PENDING";
- case IssueComment_Approval_Status.APPROVED:
- return "APPROVED";
- case IssueComment_Approval_Status.REJECTED:
- return "REJECTED";
- case IssueComment_Approval_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- fromDescription?: string | undefined;
- toDescription?: string | undefined;
- fromStatus?: IssueStatus | undefined;
- toStatus?: IssueStatus | undefined;
- fromLabels: string[];
- toLabels: string[];
-}
-
-export interface IssueComment_StageEnd {
- stage: string;
-}
-
-export interface IssueComment_TaskUpdate {
- tasks: string[];
- /** Format: projects/{project}/sheets/{sheet} */
- fromSheet?:
- | string
- | undefined;
- /** Format: projects/{project}/sheets/{sheet} */
- toSheet?: string | undefined;
- toStatus?: IssueComment_TaskUpdate_Status | undefined;
-}
-
-export enum IssueComment_TaskUpdate_Status {
- 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 {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return IssueComment_TaskUpdate_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return IssueComment_TaskUpdate_Status.PENDING;
- case 2:
- case "RUNNING":
- return IssueComment_TaskUpdate_Status.RUNNING;
- case 3:
- case "DONE":
- return IssueComment_TaskUpdate_Status.DONE;
- case 4:
- case "FAILED":
- return IssueComment_TaskUpdate_Status.FAILED;
- case 5:
- case "SKIPPED":
- return IssueComment_TaskUpdate_Status.SKIPPED;
- case 6:
- case "CANCELED":
- return IssueComment_TaskUpdate_Status.CANCELED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return IssueComment_TaskUpdate_Status.UNRECOGNIZED;
- }
-}
-
-export function issueComment_TaskUpdate_StatusToJSON(object: IssueComment_TaskUpdate_Status): string {
- switch (object) {
- case IssueComment_TaskUpdate_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case IssueComment_TaskUpdate_Status.PENDING:
- return "PENDING";
- case IssueComment_TaskUpdate_Status.RUNNING:
- return "RUNNING";
- case IssueComment_TaskUpdate_Status.DONE:
- return "DONE";
- case IssueComment_TaskUpdate_Status.FAILED:
- return "FAILED";
- case IssueComment_TaskUpdate_Status.SKIPPED:
- return "SKIPPED";
- case IssueComment_TaskUpdate_Status.CANCELED:
- return "CANCELED";
- case IssueComment_TaskUpdate_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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[];
- originalLine?: number | undefined;
- database: string;
- error: string;
-}
-
-export interface IssueComment_TaskPriorBackup_Table {
- schema: string;
- table: string;
-}
-
-function createBaseGetIssueRequest(): GetIssueRequest {
- return { name: "", force: false };
-}
-
-export const GetIssueRequest: MessageFns<GetIssueRequest> = {
- encode(message: GetIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.force !== false) {
- writer.uint32(16).bool(message.force);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.force = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetIssueRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
- };
- },
-
- toJSON(message: GetIssueRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.force !== false) {
- obj.force = message.force;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetIssueRequest>): GetIssueRequest {
- return GetIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetIssueRequest>): GetIssueRequest {
- const message = createBaseGetIssueRequest();
- message.name = object.name ?? "";
- message.force = object.force ?? false;
- return message;
- },
-};
-
-function createBaseCreateIssueRequest(): CreateIssueRequest {
- return { parent: "", issue: undefined };
-}
-
-export const CreateIssueRequest: MessageFns<CreateIssueRequest> = {
- encode(message: CreateIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.issue !== undefined) {
- Issue.encode(message.issue, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.issue = Issue.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateIssueRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- issue: isSet(object.issue) ? Issue.fromJSON(object.issue) : undefined,
- };
- },
-
- toJSON(message: CreateIssueRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.issue !== undefined) {
- obj.issue = Issue.toJSON(message.issue);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateIssueRequest>): CreateIssueRequest {
- return CreateIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateIssueRequest>): CreateIssueRequest {
- const message = createBaseCreateIssueRequest();
- message.parent = object.parent ?? "";
- message.issue = (object.issue !== undefined && object.issue !== null) ? Issue.fromPartial(object.issue) : undefined;
- return message;
- },
-};
-
-function createBaseListIssuesRequest(): ListIssuesRequest {
- return { parent: "", pageSize: 0, pageToken: "", filter: "", query: "" };
-}
-
-export const ListIssuesRequest: MessageFns<ListIssuesRequest> = {
- encode(message: ListIssuesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- if (message.query !== "") {
- writer.uint32(42).string(message.query);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIssuesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIssuesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.query = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIssuesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- query: isSet(object.query) ? globalThis.String(object.query) : "",
- };
- },
-
- toJSON(message: ListIssuesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.query !== "") {
- obj.query = message.query;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIssuesRequest>): ListIssuesRequest {
- return ListIssuesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIssuesRequest>): ListIssuesRequest {
- const message = createBaseListIssuesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- message.query = object.query ?? "";
- return message;
- },
-};
-
-function createBaseListIssuesResponse(): ListIssuesResponse {
- return { issues: [], nextPageToken: "" };
-}
-
-export const ListIssuesResponse: MessageFns<ListIssuesResponse> = {
- encode(message: ListIssuesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.issues) {
- Issue.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIssuesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIssuesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.issues.push(Issue.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIssuesResponse {
- return {
- issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => Issue.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListIssuesResponse): unknown {
- const obj: any = {};
- if (message.issues?.length) {
- obj.issues = message.issues.map((e) => Issue.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIssuesResponse>): ListIssuesResponse {
- return ListIssuesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIssuesResponse>): ListIssuesResponse {
- const message = createBaseListIssuesResponse();
- message.issues = object.issues?.map((e) => Issue.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchIssuesRequest(): SearchIssuesRequest {
- return { parent: "", pageSize: 0, pageToken: "", filter: "", query: "" };
-}
-
-export const SearchIssuesRequest: MessageFns<SearchIssuesRequest> = {
- encode(message: SearchIssuesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- if (message.query !== "") {
- writer.uint32(42).string(message.query);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchIssuesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchIssuesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.query = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchIssuesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- query: isSet(object.query) ? globalThis.String(object.query) : "",
- };
- },
-
- toJSON(message: SearchIssuesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.query !== "") {
- obj.query = message.query;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchIssuesRequest>): SearchIssuesRequest {
- return SearchIssuesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchIssuesRequest>): SearchIssuesRequest {
- const message = createBaseSearchIssuesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- message.query = object.query ?? "";
- return message;
- },
-};
-
-function createBaseSearchIssuesResponse(): SearchIssuesResponse {
- return { issues: [], nextPageToken: "" };
-}
-
-export const SearchIssuesResponse: MessageFns<SearchIssuesResponse> = {
- encode(message: SearchIssuesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.issues) {
- Issue.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchIssuesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchIssuesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.issues.push(Issue.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchIssuesResponse {
- return {
- issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => Issue.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchIssuesResponse): unknown {
- const obj: any = {};
- if (message.issues?.length) {
- obj.issues = message.issues.map((e) => Issue.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchIssuesResponse>): SearchIssuesResponse {
- return SearchIssuesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchIssuesResponse>): SearchIssuesResponse {
- const message = createBaseSearchIssuesResponse();
- message.issues = object.issues?.map((e) => Issue.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseUpdateIssueRequest(): UpdateIssueRequest {
- return { issue: undefined, updateMask: undefined };
-}
-
-export const UpdateIssueRequest: MessageFns<UpdateIssueRequest> = {
- encode(message: UpdateIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.issue !== undefined) {
- Issue.encode(message.issue, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.issue = Issue.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateIssueRequest {
- return {
- issue: isSet(object.issue) ? Issue.fromJSON(object.issue) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateIssueRequest): unknown {
- const obj: any = {};
- if (message.issue !== undefined) {
- obj.issue = Issue.toJSON(message.issue);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateIssueRequest>): UpdateIssueRequest {
- return UpdateIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateIssueRequest>): UpdateIssueRequest {
- const message = createBaseUpdateIssueRequest();
- message.issue = (object.issue !== undefined && object.issue !== null) ? Issue.fromPartial(object.issue) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseBatchUpdateIssuesStatusRequest(): BatchUpdateIssuesStatusRequest {
- return { parent: "", issues: [], status: IssueStatus.ISSUE_STATUS_UNSPECIFIED, reason: "" };
-}
-
-export const BatchUpdateIssuesStatusRequest: MessageFns<BatchUpdateIssuesStatusRequest> = {
- encode(message: BatchUpdateIssuesStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.issues) {
- writer.uint32(18).string(v!);
- }
- if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
- writer.uint32(24).int32(issueStatusToNumber(message.status));
- }
- if (message.reason !== "") {
- writer.uint32(34).string(message.reason);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateIssuesStatusRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateIssuesStatusRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.issues.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.status = issueStatusFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.reason = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchUpdateIssuesStatusRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => globalThis.String(e)) : [],
- status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
- };
- },
-
- toJSON(message: BatchUpdateIssuesStatusRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.issues?.length) {
- obj.issues = message.issues;
- }
- if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
- obj.status = issueStatusToJSON(message.status);
- }
- if (message.reason !== "") {
- obj.reason = message.reason;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateIssuesStatusRequest>): BatchUpdateIssuesStatusRequest {
- return BatchUpdateIssuesStatusRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchUpdateIssuesStatusRequest>): BatchUpdateIssuesStatusRequest {
- const message = createBaseBatchUpdateIssuesStatusRequest();
- message.parent = object.parent ?? "";
- message.issues = object.issues?.map((e) => e) || [];
- message.status = object.status ?? IssueStatus.ISSUE_STATUS_UNSPECIFIED;
- message.reason = object.reason ?? "";
- return message;
- },
-};
-
-function createBaseBatchUpdateIssuesStatusResponse(): BatchUpdateIssuesStatusResponse {
- return {};
-}
-
-export const BatchUpdateIssuesStatusResponse: MessageFns<BatchUpdateIssuesStatusResponse> = {
- encode(_: BatchUpdateIssuesStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateIssuesStatusResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchUpdateIssuesStatusResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchUpdateIssuesStatusResponse {
- return {};
- },
-
- toJSON(_: BatchUpdateIssuesStatusResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchUpdateIssuesStatusResponse>): BatchUpdateIssuesStatusResponse {
- return BatchUpdateIssuesStatusResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchUpdateIssuesStatusResponse>): BatchUpdateIssuesStatusResponse {
- const message = createBaseBatchUpdateIssuesStatusResponse();
- return message;
- },
-};
-
-function createBaseApproveIssueRequest(): ApproveIssueRequest {
- return { name: "", comment: "" };
-}
-
-export const ApproveIssueRequest: MessageFns<ApproveIssueRequest> = {
- encode(message: ApproveIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.comment !== "") {
- writer.uint32(18).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ApproveIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseApproveIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ApproveIssueRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: ApproveIssueRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ApproveIssueRequest>): ApproveIssueRequest {
- return ApproveIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ApproveIssueRequest>): ApproveIssueRequest {
- const message = createBaseApproveIssueRequest();
- message.name = object.name ?? "";
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseRejectIssueRequest(): RejectIssueRequest {
- return { name: "", comment: "" };
-}
-
-export const RejectIssueRequest: MessageFns<RejectIssueRequest> = {
- encode(message: RejectIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.comment !== "") {
- writer.uint32(18).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RejectIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRejectIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RejectIssueRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: RejectIssueRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RejectIssueRequest>): RejectIssueRequest {
- return RejectIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RejectIssueRequest>): RejectIssueRequest {
- const message = createBaseRejectIssueRequest();
- message.name = object.name ?? "";
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseRequestIssueRequest(): RequestIssueRequest {
- return { name: "", comment: "" };
-}
-
-export const RequestIssueRequest: MessageFns<RequestIssueRequest> = {
- encode(message: RequestIssueRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.comment !== "") {
- writer.uint32(18).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RequestIssueRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRequestIssueRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RequestIssueRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: RequestIssueRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RequestIssueRequest>): RequestIssueRequest {
- return RequestIssueRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RequestIssueRequest>): RequestIssueRequest {
- const message = createBaseRequestIssueRequest();
- message.name = object.name ?? "";
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseIssue(): Issue {
- return {
- name: "",
- title: "",
- description: "",
- type: Issue_Type.TYPE_UNSPECIFIED,
- status: IssueStatus.ISSUE_STATUS_UNSPECIFIED,
- approvers: [],
- approvalTemplates: [],
- approvalFindingDone: false,
- approvalFindingError: "",
- creator: "",
- createTime: undefined,
- updateTime: undefined,
- plan: "",
- rollout: "",
- grantRequest: undefined,
- releasers: [],
- riskLevel: Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED,
- taskStatusCount: {},
- labels: [],
- };
-}
-
-export const Issue: MessageFns<Issue> = {
- encode(message: Issue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(26).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(34).string(message.description);
- }
- if (message.type !== Issue_Type.TYPE_UNSPECIFIED) {
- writer.uint32(40).int32(issue_TypeToNumber(message.type));
- }
- if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
- writer.uint32(48).int32(issueStatusToNumber(message.status));
- }
- for (const v of message.approvers) {
- Issue_Approver.encode(v!, writer.uint32(74).fork()).join();
- }
- for (const v of message.approvalTemplates) {
- ApprovalTemplate.encode(v!, writer.uint32(82).fork()).join();
- }
- if (message.approvalFindingDone !== false) {
- writer.uint32(88).bool(message.approvalFindingDone);
- }
- if (message.approvalFindingError !== "") {
- writer.uint32(98).string(message.approvalFindingError);
- }
- if (message.creator !== "") {
- writer.uint32(114).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(122).fork()).join();
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(130).fork()).join();
- }
- if (message.plan !== "") {
- writer.uint32(138).string(message.plan);
- }
- if (message.rollout !== "") {
- writer.uint32(146).string(message.rollout);
- }
- if (message.grantRequest !== undefined) {
- GrantRequest.encode(message.grantRequest, writer.uint32(154).fork()).join();
- }
- for (const v of message.releasers) {
- writer.uint32(162).string(v!);
- }
- 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()).join();
- });
- for (const v of message.labels) {
- writer.uint32(186).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Issue {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssue();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.type = issue_TypeFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.status = issueStatusFromJSON(reader.int32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.approvers.push(Issue_Approver.decode(reader, reader.uint32()));
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.approvalTemplates.push(ApprovalTemplate.decode(reader, reader.uint32()));
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.approvalFindingDone = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.approvalFindingError = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.plan = reader.string();
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.rollout = reader.string();
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.grantRequest = GrantRequest.decode(reader, reader.uint32());
- continue;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.releasers.push(reader.string());
- continue;
- }
- case 21: {
- if (tag !== 168) {
- break;
- }
-
- message.riskLevel = issue_RiskLevelFromJSON(reader.int32());
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- const entry22 = Issue_TaskStatusCountEntry.decode(reader, reader.uint32());
- if (entry22.value !== undefined) {
- message.taskStatusCount[entry22.key] = entry22.value;
- }
- continue;
- }
- case 23: {
- if (tag !== 186) {
- break;
- }
-
- message.labels.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Issue {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- type: isSet(object.type) ? issue_TypeFromJSON(object.type) : Issue_Type.TYPE_UNSPECIFIED,
- status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
- approvers: globalThis.Array.isArray(object?.approvers)
- ? object.approvers.map((e: any) => Issue_Approver.fromJSON(e))
- : [],
- approvalTemplates: globalThis.Array.isArray(object?.approvalTemplates)
- ? object.approvalTemplates.map((e: any) => ApprovalTemplate.fromJSON(e))
- : [],
- approvalFindingDone: isSet(object.approvalFindingDone) ? globalThis.Boolean(object.approvalFindingDone) : false,
- approvalFindingError: isSet(object.approvalFindingError) ? globalThis.String(object.approvalFindingError) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- plan: isSet(object.plan) ? globalThis.String(object.plan) : "",
- rollout: isSet(object.rollout) ? globalThis.String(object.rollout) : "",
- grantRequest: isSet(object.grantRequest) ? GrantRequest.fromJSON(object.grantRequest) : undefined,
- releasers: globalThis.Array.isArray(object?.releasers)
- ? object.releasers.map((e: any) => globalThis.String(e))
- : [],
- riskLevel: isSet(object.riskLevel)
- ? issue_RiskLevelFromJSON(object.riskLevel)
- : Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED,
- taskStatusCount: isObject(object.taskStatusCount)
- ? Object.entries(object.taskStatusCount).reduce<{ [key: string]: number }>((acc, [key, value]) => {
- acc[key] = Number(value);
- return acc;
- }, {})
- : {},
- labels: globalThis.Array.isArray(object?.labels)
- ? object.labels.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: Issue): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.type !== Issue_Type.TYPE_UNSPECIFIED) {
- obj.type = issue_TypeToJSON(message.type);
- }
- if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
- obj.status = issueStatusToJSON(message.status);
- }
- if (message.approvers?.length) {
- obj.approvers = message.approvers.map((e) => Issue_Approver.toJSON(e));
- }
- if (message.approvalTemplates?.length) {
- obj.approvalTemplates = message.approvalTemplates.map((e) => ApprovalTemplate.toJSON(e));
- }
- if (message.approvalFindingDone !== false) {
- obj.approvalFindingDone = message.approvalFindingDone;
- }
- if (message.approvalFindingError !== "") {
- obj.approvalFindingError = message.approvalFindingError;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.plan !== "") {
- obj.plan = message.plan;
- }
- if (message.rollout !== "") {
- obj.rollout = message.rollout;
- }
- if (message.grantRequest !== undefined) {
- obj.grantRequest = GrantRequest.toJSON(message.grantRequest);
- }
- if (message.releasers?.length) {
- obj.releasers = message.releasers;
- }
- if (message.riskLevel !== Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
- obj.riskLevel = issue_RiskLevelToJSON(message.riskLevel);
- }
- if (message.taskStatusCount) {
- const entries = Object.entries(message.taskStatusCount);
- if (entries.length > 0) {
- obj.taskStatusCount = {};
- entries.forEach(([k, v]) => {
- obj.taskStatusCount[k] = Math.round(v);
- });
- }
- }
- if (message.labels?.length) {
- obj.labels = message.labels;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Issue>): Issue {
- return Issue.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Issue>): Issue {
- const message = createBaseIssue();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.type = object.type ?? Issue_Type.TYPE_UNSPECIFIED;
- message.status = object.status ?? IssueStatus.ISSUE_STATUS_UNSPECIFIED;
- message.approvers = object.approvers?.map((e) => Issue_Approver.fromPartial(e)) || [];
- message.approvalTemplates = object.approvalTemplates?.map((e) => ApprovalTemplate.fromPartial(e)) || [];
- message.approvalFindingDone = object.approvalFindingDone ?? false;
- message.approvalFindingError = object.approvalFindingError ?? "";
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.plan = object.plan ?? "";
- message.rollout = object.rollout ?? "";
- message.grantRequest = (object.grantRequest !== undefined && object.grantRequest !== null)
- ? GrantRequest.fromPartial(object.grantRequest)
- : undefined;
- message.releasers = object.releasers?.map((e) => e) || [];
- 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) {
- acc[key] = globalThis.Number(value);
- }
- return acc;
- },
- {},
- );
- message.labels = object.labels?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseIssue_Approver(): Issue_Approver {
- return { status: Issue_Approver_Status.STATUS_UNSPECIFIED, principal: "" };
-}
-
-export const Issue_Approver: MessageFns<Issue_Approver> = {
- encode(message: Issue_Approver, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Issue_Approver {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssue_Approver();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.status = issue_Approver_StatusFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.principal = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Issue_Approver {
- return {
- status: isSet(object.status)
- ? issue_Approver_StatusFromJSON(object.status)
- : Issue_Approver_Status.STATUS_UNSPECIFIED,
- principal: isSet(object.principal) ? globalThis.String(object.principal) : "",
- };
- },
-
- toJSON(message: Issue_Approver): unknown {
- const obj: any = {};
- if (message.status !== Issue_Approver_Status.STATUS_UNSPECIFIED) {
- obj.status = issue_Approver_StatusToJSON(message.status);
- }
- if (message.principal !== "") {
- obj.principal = message.principal;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Issue_Approver>): Issue_Approver {
- return Issue_Approver.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Issue_Approver>): Issue_Approver {
- const message = createBaseIssue_Approver();
- message.status = object.status ?? Issue_Approver_Status.STATUS_UNSPECIFIED;
- message.principal = object.principal ?? "";
- return message;
- },
-};
-
-function createBaseIssue_TaskStatusCountEntry(): Issue_TaskStatusCountEntry {
- return { key: "", value: 0 };
-}
-
-export const Issue_TaskStatusCountEntry: MessageFns<Issue_TaskStatusCountEntry> = {
- encode(message: Issue_TaskStatusCountEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== 0) {
- writer.uint32(16).int32(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Issue_TaskStatusCountEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssue_TaskStatusCountEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.value = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Issue_TaskStatusCountEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.Number(object.value) : 0,
- };
- },
-
- toJSON(message: Issue_TaskStatusCountEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== 0) {
- obj.value = Math.round(message.value);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Issue_TaskStatusCountEntry>): Issue_TaskStatusCountEntry {
- return Issue_TaskStatusCountEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Issue_TaskStatusCountEntry>): Issue_TaskStatusCountEntry {
- const message = createBaseIssue_TaskStatusCountEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? 0;
- return message;
- },
-};
-
-function createBaseGrantRequest(): GrantRequest {
- return { role: "", user: "", condition: undefined, expiration: undefined };
-}
-
-export const GrantRequest: MessageFns<GrantRequest> = {
- encode(message: GrantRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.role !== "") {
- writer.uint32(10).string(message.role);
- }
- if (message.user !== "") {
- writer.uint32(18).string(message.user);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(26).fork()).join();
- }
- if (message.expiration !== undefined) {
- Duration.encode(message.expiration, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GrantRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGrantRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.role = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.user = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.expiration = Duration.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GrantRequest {
- return {
- role: isSet(object.role) ? globalThis.String(object.role) : "",
- user: isSet(object.user) ? globalThis.String(object.user) : "",
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- expiration: isSet(object.expiration) ? Duration.fromJSON(object.expiration) : undefined,
- };
- },
-
- toJSON(message: GrantRequest): unknown {
- const obj: any = {};
- if (message.role !== "") {
- obj.role = message.role;
- }
- if (message.user !== "") {
- obj.user = message.user;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- if (message.expiration !== undefined) {
- obj.expiration = Duration.toJSON(message.expiration);
- }
- return obj;
- },
-
- create(base?: DeepPartial<GrantRequest>): GrantRequest {
- return GrantRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GrantRequest>): GrantRequest {
- const message = createBaseGrantRequest();
- message.role = object.role ?? "";
- message.user = object.user ?? "";
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- message.expiration = (object.expiration !== undefined && object.expiration !== null)
- ? Duration.fromPartial(object.expiration)
- : undefined;
- return message;
- },
-};
-
-function createBaseApprovalTemplate(): ApprovalTemplate {
- return { flow: undefined, title: "", description: "" };
-}
-
-export const ApprovalTemplate: MessageFns<ApprovalTemplate> = {
- encode(message: ApprovalTemplate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.flow !== undefined) {
- ApprovalFlow.encode(message.flow, writer.uint32(10).fork()).join();
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ApprovalTemplate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseApprovalTemplate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.flow = ApprovalFlow.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ApprovalTemplate {
- return {
- flow: isSet(object.flow) ? ApprovalFlow.fromJSON(object.flow) : undefined,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- };
- },
-
- toJSON(message: ApprovalTemplate): unknown {
- const obj: any = {};
- if (message.flow !== undefined) {
- obj.flow = ApprovalFlow.toJSON(message.flow);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ApprovalTemplate>): ApprovalTemplate {
- return ApprovalTemplate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ApprovalTemplate>): ApprovalTemplate {
- const message = createBaseApprovalTemplate();
- message.flow = (object.flow !== undefined && object.flow !== null)
- ? ApprovalFlow.fromPartial(object.flow)
- : undefined;
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- return message;
- },
-};
-
-function createBaseApprovalFlow(): ApprovalFlow {
- return { steps: [] };
-}
-
-export const ApprovalFlow: MessageFns<ApprovalFlow> = {
- encode(message: ApprovalFlow, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.steps) {
- ApprovalStep.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ApprovalFlow {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseApprovalFlow();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.steps.push(ApprovalStep.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ApprovalFlow {
- return {
- steps: globalThis.Array.isArray(object?.steps) ? object.steps.map((e: any) => ApprovalStep.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ApprovalFlow): unknown {
- const obj: any = {};
- if (message.steps?.length) {
- obj.steps = message.steps.map((e) => ApprovalStep.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ApprovalFlow>): ApprovalFlow {
- return ApprovalFlow.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ApprovalFlow>): ApprovalFlow {
- const message = createBaseApprovalFlow();
- message.steps = object.steps?.map((e) => ApprovalStep.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseApprovalStep(): ApprovalStep {
- return { type: ApprovalStep_Type.TYPE_UNSPECIFIED, nodes: [] };
-}
-
-export const ApprovalStep: MessageFns<ApprovalStep> = {
- encode(message: ApprovalStep, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ApprovalStep {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseApprovalStep();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = approvalStep_TypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nodes.push(ApprovalNode.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ApprovalStep {
- return {
- type: isSet(object.type) ? approvalStep_TypeFromJSON(object.type) : ApprovalStep_Type.TYPE_UNSPECIFIED,
- nodes: globalThis.Array.isArray(object?.nodes) ? object.nodes.map((e: any) => ApprovalNode.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: ApprovalStep): unknown {
- const obj: any = {};
- if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
- obj.type = approvalStep_TypeToJSON(message.type);
- }
- if (message.nodes?.length) {
- obj.nodes = message.nodes.map((e) => ApprovalNode.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<ApprovalStep>): ApprovalStep {
- return ApprovalStep.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ApprovalStep>): ApprovalStep {
- const message = createBaseApprovalStep();
- message.type = object.type ?? ApprovalStep_Type.TYPE_UNSPECIFIED;
- message.nodes = object.nodes?.map((e) => ApprovalNode.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseApprovalNode(): ApprovalNode {
- return { type: ApprovalNode_Type.TYPE_UNSPECIFIED, role: "" };
-}
-
-export const ApprovalNode: MessageFns<ApprovalNode> = {
- encode(message: ApprovalNode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(approvalNode_TypeToNumber(message.type));
- }
- if (message.role !== "") {
- writer.uint32(18).string(message.role);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ApprovalNode {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseApprovalNode();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = approvalNode_TypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.role = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ApprovalNode {
- return {
- type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : ApprovalNode_Type.TYPE_UNSPECIFIED,
- role: isSet(object.role) ? globalThis.String(object.role) : "",
- };
- },
-
- toJSON(message: ApprovalNode): unknown {
- const obj: any = {};
- if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
- obj.type = approvalNode_TypeToJSON(message.type);
- }
- if (message.role !== "") {
- obj.role = message.role;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ApprovalNode>): ApprovalNode {
- return ApprovalNode.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ApprovalNode>): ApprovalNode {
- const message = createBaseApprovalNode();
- message.type = object.type ?? ApprovalNode_Type.TYPE_UNSPECIFIED;
- message.role = object.role ?? "";
- return message;
- },
-};
-
-function createBaseListIssueCommentsRequest(): ListIssueCommentsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListIssueCommentsRequest: MessageFns<ListIssueCommentsRequest> = {
- encode(message: ListIssueCommentsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIssueCommentsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIssueCommentsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIssueCommentsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListIssueCommentsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIssueCommentsRequest>): ListIssueCommentsRequest {
- return ListIssueCommentsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIssueCommentsRequest>): ListIssueCommentsRequest {
- const message = createBaseListIssueCommentsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListIssueCommentsResponse(): ListIssueCommentsResponse {
- return { issueComments: [], nextPageToken: "" };
-}
-
-export const ListIssueCommentsResponse: MessageFns<ListIssueCommentsResponse> = {
- encode(message: ListIssueCommentsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.issueComments) {
- IssueComment.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListIssueCommentsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListIssueCommentsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.issueComments.push(IssueComment.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListIssueCommentsResponse {
- return {
- issueComments: globalThis.Array.isArray(object?.issueComments)
- ? object.issueComments.map((e: any) => IssueComment.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListIssueCommentsResponse): unknown {
- const obj: any = {};
- if (message.issueComments?.length) {
- obj.issueComments = message.issueComments.map((e) => IssueComment.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListIssueCommentsResponse>): ListIssueCommentsResponse {
- return ListIssueCommentsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListIssueCommentsResponse>): ListIssueCommentsResponse {
- const message = createBaseListIssueCommentsResponse();
- message.issueComments = object.issueComments?.map((e) => IssueComment.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateIssueCommentRequest(): CreateIssueCommentRequest {
- return { parent: "", issueComment: undefined };
-}
-
-export const CreateIssueCommentRequest: MessageFns<CreateIssueCommentRequest> = {
- encode(message: CreateIssueCommentRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.issueComment !== undefined) {
- IssueComment.encode(message.issueComment, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateIssueCommentRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateIssueCommentRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.issueComment = IssueComment.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateIssueCommentRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- issueComment: isSet(object.issueComment) ? IssueComment.fromJSON(object.issueComment) : undefined,
- };
- },
-
- toJSON(message: CreateIssueCommentRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.issueComment !== undefined) {
- obj.issueComment = IssueComment.toJSON(message.issueComment);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateIssueCommentRequest>): CreateIssueCommentRequest {
- return CreateIssueCommentRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateIssueCommentRequest>): CreateIssueCommentRequest {
- const message = createBaseCreateIssueCommentRequest();
- message.parent = object.parent ?? "";
- message.issueComment = (object.issueComment !== undefined && object.issueComment !== null)
- ? IssueComment.fromPartial(object.issueComment)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateIssueCommentRequest(): UpdateIssueCommentRequest {
- return { parent: "", issueComment: undefined, updateMask: undefined };
-}
-
-export const UpdateIssueCommentRequest: MessageFns<UpdateIssueCommentRequest> = {
- encode(message: UpdateIssueCommentRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.issueComment !== undefined) {
- IssueComment.encode(message.issueComment, writer.uint32(18).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateIssueCommentRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateIssueCommentRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.issueComment = IssueComment.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateIssueCommentRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- issueComment: isSet(object.issueComment) ? IssueComment.fromJSON(object.issueComment) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateIssueCommentRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.issueComment !== undefined) {
- obj.issueComment = IssueComment.toJSON(message.issueComment);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateIssueCommentRequest>): UpdateIssueCommentRequest {
- return UpdateIssueCommentRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateIssueCommentRequest>): UpdateIssueCommentRequest {
- const message = createBaseUpdateIssueCommentRequest();
- message.parent = object.parent ?? "";
- message.issueComment = (object.issueComment !== undefined && object.issueComment !== null)
- ? IssueComment.fromPartial(object.issueComment)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseIssueComment(): IssueComment {
- return {
- name: "",
- comment: "",
- payload: "",
- createTime: undefined,
- updateTime: undefined,
- creator: "",
- approval: undefined,
- issueUpdate: undefined,
- stageEnd: undefined,
- taskUpdate: undefined,
- taskPriorBackup: undefined,
- };
-}
-
-export const IssueComment: MessageFns<IssueComment> = {
- encode(message: IssueComment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.comment !== "") {
- writer.uint32(18).string(message.comment);
- }
- if (message.payload !== "") {
- writer.uint32(26).string(message.payload);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(34).fork()).join();
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(42).fork()).join();
- }
- if (message.creator !== "") {
- writer.uint32(58).string(message.creator);
- }
- if (message.approval !== undefined) {
- IssueComment_Approval.encode(message.approval, writer.uint32(66).fork()).join();
- }
- if (message.issueUpdate !== undefined) {
- IssueComment_IssueUpdate.encode(message.issueUpdate, writer.uint32(74).fork()).join();
- }
- if (message.stageEnd !== undefined) {
- IssueComment_StageEnd.encode(message.stageEnd, writer.uint32(82).fork()).join();
- }
- if (message.taskUpdate !== undefined) {
- IssueComment_TaskUpdate.encode(message.taskUpdate, writer.uint32(90).fork()).join();
- }
- if (message.taskPriorBackup !== undefined) {
- IssueComment_TaskPriorBackup.encode(message.taskPriorBackup, writer.uint32(98).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.payload = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.approval = IssueComment_Approval.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.issueUpdate = IssueComment_IssueUpdate.decode(reader, reader.uint32());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.stageEnd = IssueComment_StageEnd.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.taskUpdate = IssueComment_TaskUpdate.decode(reader, reader.uint32());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.taskPriorBackup = IssueComment_TaskPriorBackup.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- approval: isSet(object.approval) ? IssueComment_Approval.fromJSON(object.approval) : undefined,
- issueUpdate: isSet(object.issueUpdate) ? IssueComment_IssueUpdate.fromJSON(object.issueUpdate) : undefined,
- stageEnd: isSet(object.stageEnd) ? IssueComment_StageEnd.fromJSON(object.stageEnd) : undefined,
- taskUpdate: isSet(object.taskUpdate) ? IssueComment_TaskUpdate.fromJSON(object.taskUpdate) : undefined,
- taskPriorBackup: isSet(object.taskPriorBackup)
- ? IssueComment_TaskPriorBackup.fromJSON(object.taskPriorBackup)
- : undefined,
- };
- },
-
- toJSON(message: IssueComment): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- if (message.payload !== "") {
- obj.payload = message.payload;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.approval !== undefined) {
- obj.approval = IssueComment_Approval.toJSON(message.approval);
- }
- if (message.issueUpdate !== undefined) {
- obj.issueUpdate = IssueComment_IssueUpdate.toJSON(message.issueUpdate);
- }
- if (message.stageEnd !== undefined) {
- obj.stageEnd = IssueComment_StageEnd.toJSON(message.stageEnd);
- }
- if (message.taskUpdate !== undefined) {
- obj.taskUpdate = IssueComment_TaskUpdate.toJSON(message.taskUpdate);
- }
- if (message.taskPriorBackup !== undefined) {
- obj.taskPriorBackup = IssueComment_TaskPriorBackup.toJSON(message.taskPriorBackup);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment>): IssueComment {
- return IssueComment.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment>): IssueComment {
- const message = createBaseIssueComment();
- message.name = object.name ?? "";
- message.comment = object.comment ?? "";
- message.payload = object.payload ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.creator = object.creator ?? "";
- message.approval = (object.approval !== undefined && object.approval !== null)
- ? IssueComment_Approval.fromPartial(object.approval)
- : undefined;
- message.issueUpdate = (object.issueUpdate !== undefined && object.issueUpdate !== null)
- ? IssueComment_IssueUpdate.fromPartial(object.issueUpdate)
- : undefined;
- message.stageEnd = (object.stageEnd !== undefined && object.stageEnd !== null)
- ? IssueComment_StageEnd.fromPartial(object.stageEnd)
- : undefined;
- message.taskUpdate = (object.taskUpdate !== undefined && object.taskUpdate !== null)
- ? IssueComment_TaskUpdate.fromPartial(object.taskUpdate)
- : undefined;
- message.taskPriorBackup = (object.taskPriorBackup !== undefined && object.taskPriorBackup !== null)
- ? IssueComment_TaskPriorBackup.fromPartial(object.taskPriorBackup)
- : undefined;
- return message;
- },
-};
-
-function createBaseIssueComment_Approval(): IssueComment_Approval {
- return { status: IssueComment_Approval_Status.STATUS_UNSPECIFIED };
-}
-
-export const IssueComment_Approval: MessageFns<IssueComment_Approval> = {
- encode(message: IssueComment_Approval, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.status !== IssueComment_Approval_Status.STATUS_UNSPECIFIED) {
- writer.uint32(8).int32(issueComment_Approval_StatusToNumber(message.status));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_Approval {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_Approval();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.status = issueComment_Approval_StatusFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_Approval {
- return {
- status: isSet(object.status)
- ? issueComment_Approval_StatusFromJSON(object.status)
- : IssueComment_Approval_Status.STATUS_UNSPECIFIED,
- };
- },
-
- toJSON(message: IssueComment_Approval): unknown {
- const obj: any = {};
- if (message.status !== IssueComment_Approval_Status.STATUS_UNSPECIFIED) {
- obj.status = issueComment_Approval_StatusToJSON(message.status);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_Approval>): IssueComment_Approval {
- return IssueComment_Approval.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_Approval>): IssueComment_Approval {
- const message = createBaseIssueComment_Approval();
- message.status = object.status ?? IssueComment_Approval_Status.STATUS_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseIssueComment_IssueUpdate(): IssueComment_IssueUpdate {
- return {
- fromTitle: undefined,
- toTitle: undefined,
- fromDescription: undefined,
- toDescription: undefined,
- fromStatus: undefined,
- toStatus: undefined,
- fromLabels: [],
- toLabels: [],
- };
-}
-
-export const IssueComment_IssueUpdate: MessageFns<IssueComment_IssueUpdate> = {
- encode(message: IssueComment_IssueUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.fromTitle !== undefined) {
- writer.uint32(10).string(message.fromTitle);
- }
- if (message.toTitle !== undefined) {
- writer.uint32(18).string(message.toTitle);
- }
- if (message.fromDescription !== undefined) {
- writer.uint32(26).string(message.fromDescription);
- }
- if (message.toDescription !== undefined) {
- writer.uint32(34).string(message.toDescription);
- }
- if (message.fromStatus !== undefined) {
- writer.uint32(40).int32(issueStatusToNumber(message.fromStatus));
- }
- if (message.toStatus !== undefined) {
- writer.uint32(48).int32(issueStatusToNumber(message.toStatus));
- }
- for (const v of message.fromLabels) {
- writer.uint32(74).string(v!);
- }
- for (const v of message.toLabels) {
- writer.uint32(82).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_IssueUpdate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_IssueUpdate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.fromTitle = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.toTitle = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.fromDescription = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.toDescription = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.fromStatus = issueStatusFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.toStatus = issueStatusFromJSON(reader.int32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.fromLabels.push(reader.string());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.toLabels.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_IssueUpdate {
- return {
- fromTitle: isSet(object.fromTitle) ? globalThis.String(object.fromTitle) : undefined,
- toTitle: isSet(object.toTitle) ? globalThis.String(object.toTitle) : undefined,
- fromDescription: isSet(object.fromDescription) ? globalThis.String(object.fromDescription) : undefined,
- toDescription: isSet(object.toDescription) ? globalThis.String(object.toDescription) : undefined,
- fromStatus: isSet(object.fromStatus) ? issueStatusFromJSON(object.fromStatus) : undefined,
- toStatus: isSet(object.toStatus) ? issueStatusFromJSON(object.toStatus) : undefined,
- fromLabels: globalThis.Array.isArray(object?.fromLabels)
- ? object.fromLabels.map((e: any) => globalThis.String(e))
- : [],
- toLabels: globalThis.Array.isArray(object?.toLabels) ? object.toLabels.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: IssueComment_IssueUpdate): unknown {
- const obj: any = {};
- if (message.fromTitle !== undefined) {
- obj.fromTitle = message.fromTitle;
- }
- if (message.toTitle !== undefined) {
- obj.toTitle = message.toTitle;
- }
- if (message.fromDescription !== undefined) {
- obj.fromDescription = message.fromDescription;
- }
- if (message.toDescription !== undefined) {
- obj.toDescription = message.toDescription;
- }
- if (message.fromStatus !== undefined) {
- obj.fromStatus = issueStatusToJSON(message.fromStatus);
- }
- if (message.toStatus !== undefined) {
- obj.toStatus = issueStatusToJSON(message.toStatus);
- }
- if (message.fromLabels?.length) {
- obj.fromLabels = message.fromLabels;
- }
- if (message.toLabels?.length) {
- obj.toLabels = message.toLabels;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_IssueUpdate>): IssueComment_IssueUpdate {
- return IssueComment_IssueUpdate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_IssueUpdate>): IssueComment_IssueUpdate {
- const message = createBaseIssueComment_IssueUpdate();
- message.fromTitle = object.fromTitle ?? undefined;
- message.toTitle = object.toTitle ?? undefined;
- message.fromDescription = object.fromDescription ?? undefined;
- message.toDescription = object.toDescription ?? undefined;
- message.fromStatus = object.fromStatus ?? undefined;
- message.toStatus = object.toStatus ?? undefined;
- message.fromLabels = object.fromLabels?.map((e) => e) || [];
- message.toLabels = object.toLabels?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseIssueComment_StageEnd(): IssueComment_StageEnd {
- return { stage: "" };
-}
-
-export const IssueComment_StageEnd: MessageFns<IssueComment_StageEnd> = {
- encode(message: IssueComment_StageEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.stage !== "") {
- writer.uint32(10).string(message.stage);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_StageEnd {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_StageEnd();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.stage = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_StageEnd {
- return { stage: isSet(object.stage) ? globalThis.String(object.stage) : "" };
- },
-
- toJSON(message: IssueComment_StageEnd): unknown {
- const obj: any = {};
- if (message.stage !== "") {
- obj.stage = message.stage;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_StageEnd>): IssueComment_StageEnd {
- return IssueComment_StageEnd.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_StageEnd>): IssueComment_StageEnd {
- const message = createBaseIssueComment_StageEnd();
- message.stage = object.stage ?? "";
- return message;
- },
-};
-
-function createBaseIssueComment_TaskUpdate(): IssueComment_TaskUpdate {
- return { tasks: [], fromSheet: undefined, toSheet: undefined, toStatus: undefined };
-}
-
-export const IssueComment_TaskUpdate: MessageFns<IssueComment_TaskUpdate> = {
- encode(message: IssueComment_TaskUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.tasks) {
- writer.uint32(10).string(v!);
- }
- if (message.fromSheet !== undefined) {
- writer.uint32(18).string(message.fromSheet);
- }
- if (message.toSheet !== undefined) {
- writer.uint32(26).string(message.toSheet);
- }
- if (message.toStatus !== undefined) {
- writer.uint32(48).int32(issueComment_TaskUpdate_StatusToNumber(message.toStatus));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_TaskUpdate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_TaskUpdate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.tasks.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.fromSheet = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.toSheet = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.toStatus = issueComment_TaskUpdate_StatusFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_TaskUpdate {
- return {
- tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
- fromSheet: isSet(object.fromSheet) ? globalThis.String(object.fromSheet) : undefined,
- toSheet: isSet(object.toSheet) ? globalThis.String(object.toSheet) : undefined,
- toStatus: isSet(object.toStatus) ? issueComment_TaskUpdate_StatusFromJSON(object.toStatus) : undefined,
- };
- },
-
- toJSON(message: IssueComment_TaskUpdate): unknown {
- const obj: any = {};
- if (message.tasks?.length) {
- obj.tasks = message.tasks;
- }
- if (message.fromSheet !== undefined) {
- obj.fromSheet = message.fromSheet;
- }
- if (message.toSheet !== undefined) {
- obj.toSheet = message.toSheet;
- }
- if (message.toStatus !== undefined) {
- obj.toStatus = issueComment_TaskUpdate_StatusToJSON(message.toStatus);
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_TaskUpdate>): IssueComment_TaskUpdate {
- return IssueComment_TaskUpdate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_TaskUpdate>): IssueComment_TaskUpdate {
- const message = createBaseIssueComment_TaskUpdate();
- message.tasks = object.tasks?.map((e) => e) || [];
- message.fromSheet = object.fromSheet ?? undefined;
- message.toSheet = object.toSheet ?? undefined;
- message.toStatus = object.toStatus ?? undefined;
- return message;
- },
-};
-
-function createBaseIssueComment_TaskPriorBackup(): IssueComment_TaskPriorBackup {
- return { task: "", tables: [], originalLine: undefined, database: "", error: "" };
-}
-
-export const IssueComment_TaskPriorBackup: MessageFns<IssueComment_TaskPriorBackup> = {
- encode(message: IssueComment_TaskPriorBackup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.task !== "") {
- writer.uint32(10).string(message.task);
- }
- for (const v of message.tables) {
- IssueComment_TaskPriorBackup_Table.encode(v!, writer.uint32(18).fork()).join();
- }
- if (message.originalLine !== undefined) {
- writer.uint32(24).int32(message.originalLine);
- }
- if (message.database !== "") {
- writer.uint32(34).string(message.database);
- }
- if (message.error !== "") {
- writer.uint32(42).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_TaskPriorBackup {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_TaskPriorBackup();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.task = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tables.push(IssueComment_TaskPriorBackup_Table.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.originalLine = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_TaskPriorBackup {
- return {
- task: isSet(object.task) ? globalThis.String(object.task) : "",
- tables: globalThis.Array.isArray(object?.tables)
- ? object.tables.map((e: any) => IssueComment_TaskPriorBackup_Table.fromJSON(e))
- : [],
- originalLine: isSet(object.originalLine) ? globalThis.Number(object.originalLine) : undefined,
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- };
- },
-
- toJSON(message: IssueComment_TaskPriorBackup): unknown {
- const obj: any = {};
- if (message.task !== "") {
- obj.task = message.task;
- }
- if (message.tables?.length) {
- obj.tables = message.tables.map((e) => IssueComment_TaskPriorBackup_Table.toJSON(e));
- }
- if (message.originalLine !== undefined) {
- obj.originalLine = Math.round(message.originalLine);
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_TaskPriorBackup>): IssueComment_TaskPriorBackup {
- return IssueComment_TaskPriorBackup.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_TaskPriorBackup>): IssueComment_TaskPriorBackup {
- const message = createBaseIssueComment_TaskPriorBackup();
- message.task = object.task ?? "";
- message.tables = object.tables?.map((e) => IssueComment_TaskPriorBackup_Table.fromPartial(e)) || [];
- message.originalLine = object.originalLine ?? undefined;
- message.database = object.database ?? "";
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseIssueComment_TaskPriorBackup_Table(): IssueComment_TaskPriorBackup_Table {
- return { schema: "", table: "" };
-}
-
-export const IssueComment_TaskPriorBackup_Table: MessageFns<IssueComment_TaskPriorBackup_Table> = {
- encode(message: IssueComment_TaskPriorBackup_Table, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.schema !== "") {
- writer.uint32(10).string(message.schema);
- }
- if (message.table !== "") {
- writer.uint32(18).string(message.table);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): IssueComment_TaskPriorBackup_Table {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseIssueComment_TaskPriorBackup_Table();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): IssueComment_TaskPriorBackup_Table {
- return {
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- };
- },
-
- toJSON(message: IssueComment_TaskPriorBackup_Table): unknown {
- const obj: any = {};
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- return obj;
- },
-
- create(base?: DeepPartial<IssueComment_TaskPriorBackup_Table>): IssueComment_TaskPriorBackup_Table {
- return IssueComment_TaskPriorBackup_Table.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<IssueComment_TaskPriorBackup_Table>): IssueComment_TaskPriorBackup_Table {
- const message = createBaseIssueComment_TaskPriorBackup_Table();
- message.schema = object.schema ?? "";
- message.table = object.table ?? "";
- return message;
- },
-};
-
-export type IssueServiceDefinition = typeof IssueServiceDefinition;
-export const IssueServiceDefinition = {
- name: "IssueService",
- fullName: "bytebase.v1.IssueService",
- methods: {
- /** Permissions required: bb.issues.get */
- getIssue: {
- name: "GetIssue",
- requestType: GetIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([13, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 18,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issues.create */
- createIssue: {
- name: "CreateIssue",
- requestType: CreateIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([12, 112, 97, 114, 101, 110, 116, 44, 105, 115, 115, 117, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 39,
- 58,
- 5,
- 105,
- 115,
- 115,
- 117,
- 101,
- 34,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issues.list */
- listIssues: {
- name: "ListIssues",
- requestType: ListIssuesRequest,
- requestStream: false,
- responseType: ListIssuesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([14, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 18,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /**
- * Search for issues that the caller has the bb.issues.get permission on and also satisfy the specified filter & query.
- * Permissions required: bb.issues.get
- */
- searchIssues: {
- name: "SearchIssues",
- requestType: SearchIssuesRequest,
- requestStream: false,
- responseType: SearchIssuesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([13, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 42,
- 58,
- 1,
- 42,
- 34,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issues.update */
- updateIssue: {
- name: "UpdateIssue",
- requestType: UpdateIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([17, 105, 115, 115, 117, 101, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 45,
- 58,
- 5,
- 105,
- 115,
- 115,
- 117,
- 101,
- 50,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 105,
- 115,
- 115,
- 117,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issueComments.list */
- listIssueComments: {
- name: "ListIssueComments",
- requestType: ListIssueCommentsRequest,
- requestStream: false,
- responseType: ListIssueCommentsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 105,
- 115,
- 115,
- 117,
- 101,
- 67,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 48,
- 18,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 67,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issueComments.create */
- createIssueComment: {
- name: "CreateIssueComment",
- requestType: CreateIssueCommentRequest,
- requestStream: false,
- responseType: IssueComment,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 20,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 44,
- 105,
- 115,
- 115,
- 117,
- 101,
- 95,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 105,
- 115,
- 115,
- 117,
- 101,
- 67,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 57,
- 58,
- 13,
- 105,
- 115,
- 115,
- 117,
- 101,
- 95,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 34,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issueComments.update */
- updateIssueComment: {
- name: "UpdateIssueComment",
- requestType: UpdateIssueCommentRequest,
- requestStream: false,
- responseType: IssueComment,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 32,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 44,
- 105,
- 115,
- 115,
- 117,
- 101,
- 95,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 105,
- 115,
- 115,
- 117,
- 101,
- 67,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 57,
- 58,
- 13,
- 105,
- 115,
- 115,
- 117,
- 101,
- 95,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- 50,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 99,
- 111,
- 109,
- 109,
- 101,
- 110,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.issues.update */
- batchUpdateIssuesStatus: {
- name: "BatchUpdateIssuesStatus",
- requestType: BatchUpdateIssuesStatusRequest,
- requestStream: false,
- responseType: BatchUpdateIssuesStatusResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 115, 115, 117, 101, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 53,
- 58,
- 1,
- 42,
- 34,
- 48,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 85,
- 112,
- 100,
- 97,
- 116,
- 101,
- 83,
- 116,
- 97,
- 116,
- 117,
- 115,
- ]),
- ],
- },
- },
- },
- /**
- * ApproveIssue approves the issue.
- * The access is based on approval flow.
- * Permissions required: None
- */
- approveIssue: {
- name: "ApproveIssue",
- requestType: ApproveIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 1,
- 42,
- 34,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 97,
- 112,
- 112,
- 114,
- 111,
- 118,
- 101,
- ]),
- ],
- },
- },
- },
- /**
- * RejectIssue rejects the issue.
- * The access is based on approval flow.
- * Permissions required: None
- */
- rejectIssue: {
- name: "RejectIssue",
- requestType: RejectIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 42,
- 58,
- 1,
- 42,
- 34,
- 37,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 114,
- 101,
- 106,
- 101,
- 99,
- 116,
- ]),
- ],
- },
- },
- },
- /**
- * RequestIssue requests the issue.
- * The access is based on approval flow.
- * Permissions required: None
- */
- requestIssue: {
- name: "RequestIssue",
- requestType: RequestIssueRequest,
- requestStream: false,
- responseType: Issue,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 1,
- 42,
- 34,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 105,
- 115,
- 115,
- 117,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 114,
- 101,
- 113,
- 117,
- 101,
- 115,
- 116,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/org_policy_service.ts b/frontend/src/types/proto/v1/org_policy_service.ts
deleted file mode 100644
index 9912c44211..0000000000
--- a/frontend/src/types/proto/v1/org_policy_service.ts
+++ /dev/null
@@ -1,3650 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/org_policy_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Duration } from "../google/protobuf/duration";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Expr } from "../google/type/expr";
-import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum PolicyType {
- POLICY_TYPE_UNSPECIFIED = "POLICY_TYPE_UNSPECIFIED",
- ROLLOUT_POLICY = "ROLLOUT_POLICY",
- 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",
- TAG = "TAG",
- DATA_SOURCE_QUERY = "DATA_SOURCE_QUERY",
- DATA_EXPORT = "DATA_EXPORT",
- DATA_QUERY = "DATA_QUERY",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function policyTypeFromJSON(object: any): PolicyType {
- switch (object) {
- case 0:
- case "POLICY_TYPE_UNSPECIFIED":
- return PolicyType.POLICY_TYPE_UNSPECIFIED;
- case 11:
- case "ROLLOUT_POLICY":
- return PolicyType.ROLLOUT_POLICY;
- case 8:
- case "DISABLE_COPY_DATA":
- return PolicyType.DISABLE_COPY_DATA;
- case 9:
- case "MASKING_RULE":
- return PolicyType.MASKING_RULE;
- case 10:
- case "MASKING_EXCEPTION":
- return PolicyType.MASKING_EXCEPTION;
- case 12:
- case "RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW":
- return PolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW;
- case 13:
- case "TAG":
- return PolicyType.TAG;
- case 14:
- case "DATA_SOURCE_QUERY":
- return PolicyType.DATA_SOURCE_QUERY;
- case 15:
- case "DATA_EXPORT":
- return PolicyType.DATA_EXPORT;
- case 16:
- case "DATA_QUERY":
- return PolicyType.DATA_QUERY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PolicyType.UNRECOGNIZED;
- }
-}
-
-export function policyTypeToJSON(object: PolicyType): string {
- switch (object) {
- case PolicyType.POLICY_TYPE_UNSPECIFIED:
- return "POLICY_TYPE_UNSPECIFIED";
- case PolicyType.ROLLOUT_POLICY:
- return "ROLLOUT_POLICY";
- case PolicyType.DISABLE_COPY_DATA:
- return "DISABLE_COPY_DATA";
- case PolicyType.MASKING_RULE:
- return "MASKING_RULE";
- case PolicyType.MASKING_EXCEPTION:
- return "MASKING_EXCEPTION";
- case PolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW:
- return "RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW";
- case PolicyType.TAG:
- return "TAG";
- case PolicyType.DATA_SOURCE_QUERY:
- return "DATA_SOURCE_QUERY";
- case PolicyType.DATA_EXPORT:
- return "DATA_EXPORT";
- case PolicyType.DATA_QUERY:
- return "DATA_QUERY";
- case PolicyType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function policyTypeToNumber(object: PolicyType): number {
- switch (object) {
- case PolicyType.POLICY_TYPE_UNSPECIFIED:
- return 0;
- case PolicyType.ROLLOUT_POLICY:
- return 11;
- 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.TAG:
- return 13;
- case PolicyType.DATA_SOURCE_QUERY:
- return 14;
- case PolicyType.DATA_EXPORT:
- return 15;
- case PolicyType.DATA_QUERY:
- return 16;
- case PolicyType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum PolicyResourceType {
- RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED",
- WORKSPACE = "WORKSPACE",
- ENVIRONMENT = "ENVIRONMENT",
- PROJECT = "PROJECT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function policyResourceTypeFromJSON(object: any): PolicyResourceType {
- switch (object) {
- case 0:
- case "RESOURCE_TYPE_UNSPECIFIED":
- return PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED;
- case 1:
- case "WORKSPACE":
- return PolicyResourceType.WORKSPACE;
- case 2:
- case "ENVIRONMENT":
- return PolicyResourceType.ENVIRONMENT;
- case 3:
- case "PROJECT":
- return PolicyResourceType.PROJECT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PolicyResourceType.UNRECOGNIZED;
- }
-}
-
-export function policyResourceTypeToJSON(object: PolicyResourceType): string {
- switch (object) {
- case PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED:
- return "RESOURCE_TYPE_UNSPECIFIED";
- case PolicyResourceType.WORKSPACE:
- return "WORKSPACE";
- case PolicyResourceType.ENVIRONMENT:
- return "ENVIRONMENT";
- case PolicyResourceType.PROJECT:
- return "PROJECT";
- case PolicyResourceType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum SQLReviewRuleLevel {
- LEVEL_UNSPECIFIED = "LEVEL_UNSPECIFIED",
- ERROR = "ERROR",
- WARNING = "WARNING",
- DISABLED = "DISABLED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function sQLReviewRuleLevelFromJSON(object: any): SQLReviewRuleLevel {
- switch (object) {
- case 0:
- case "LEVEL_UNSPECIFIED":
- return SQLReviewRuleLevel.LEVEL_UNSPECIFIED;
- case 1:
- case "ERROR":
- return SQLReviewRuleLevel.ERROR;
- case 2:
- case "WARNING":
- return SQLReviewRuleLevel.WARNING;
- case 3:
- case "DISABLED":
- return SQLReviewRuleLevel.DISABLED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return SQLReviewRuleLevel.UNRECOGNIZED;
- }
-}
-
-export function sQLReviewRuleLevelToJSON(object: SQLReviewRuleLevel): string {
- switch (object) {
- case SQLReviewRuleLevel.LEVEL_UNSPECIFIED:
- return "LEVEL_UNSPECIFIED";
- case SQLReviewRuleLevel.ERROR:
- return "ERROR";
- case SQLReviewRuleLevel.WARNING:
- return "WARNING";
- case SQLReviewRuleLevel.DISABLED:
- return "DISABLED";
- case SQLReviewRuleLevel.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * Workspace resource name: "".
- * Environment resource name: environments/environment-id.
- * Instance resource name: instances/instance-id.
- * Database resource name: instances/instance-id/databases/database-name.
- */
- parent: string;
- /** The policy to create. */
- policy: Policy | undefined;
- type: PolicyType;
-}
-
-export interface UpdatePolicyRequest {
- /**
- * The policy to update.
- *
- * The policy's `name` field is used to identify the instance to update.
- * Format: {resource name}/policies/{policy type}
- * Workspace resource name: "".
- * Environment resource name: environments/environment-id.
- * Instance resource name: instances/instance-id.
- * Database resource name: instances/instance-id/databases/database-name.
- */
- policy:
- | Policy
- | undefined;
- /** The list of fields to update. */
- updateMask:
- | string[]
- | undefined;
- /**
- * If set to true, and the policy is not found, a new policy will be created.
- * In this situation, `update_mask` is ignored.
- */
- allowMissing: boolean;
-}
-
-export interface DeletePolicyRequest {
- /**
- * The policy's `name` field is used to identify the instance to update.
- * Format: {resource name}/policies/{policy type}
- * Workspace resource name: "".
- * Environment resource name: environments/environment-id.
- * Instance resource name: instances/instance-id.
- * Database resource name: instances/instance-id/databases/database-name.
- */
- name: string;
-}
-
-export interface GetPolicyRequest {
- /**
- * The name of the policy to retrieve.
- * Format: {resource type}/{resource id}/policies/{policy type}
- */
- name: string;
-}
-
-export interface ListPoliciesRequest {
- /**
- * The parent, which owns this collection of policies.
- * Format: {resource type}/{resource id}
- */
- parent: string;
- policyType?:
- | PolicyType
- | undefined;
- /**
- * Not used.
- * The maximum number of policies to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 policies will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListPolicies` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListPolicies` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Show deleted policies if specified. */
- showDeleted: boolean;
-}
-
-export interface ListPoliciesResponse {
- /** The policies from the specified request. */
- policies: Policy[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface Policy {
- /**
- * The name of the policy.
- * Format: {resource name}/policies/{policy type}
- * Workspace resource name: "".
- * Environment resource name: environments/environment-id.
- * Instance resource name: instances/instance-id.
- * Database resource name: instances/instance-id/databases/database-name.
- */
- name: string;
- inheritFromParent: boolean;
- type: PolicyType;
- rolloutPolicy?: RolloutPolicy | undefined;
- disableCopyDataPolicy?: DisableCopyDataPolicy | undefined;
- maskingRulePolicy?: MaskingRulePolicy | undefined;
- maskingExceptionPolicy?: MaskingExceptionPolicy | undefined;
- restrictIssueCreationForSqlReviewPolicy?: RestrictIssueCreationForSQLReviewPolicy | undefined;
- tagPolicy?: TagPolicy | undefined;
- dataSourceQueryPolicy?: DataSourceQueryPolicy | undefined;
- exportDataPolicy?: ExportDataPolicy | undefined;
- queryDataPolicy?: QueryDataPolicy | undefined;
- enforce: boolean;
- /** The resource type for the policy. */
- resourceType: PolicyResourceType;
-}
-
-export interface RolloutPolicy {
- automatic: boolean;
- roles: string[];
- /**
- * roles/LAST_APPROVER
- * roles/CREATOR
- */
- issueRoles: string[];
-}
-
-export interface DisableCopyDataPolicy {
- active: boolean;
-}
-
-export interface ExportDataPolicy {
- disable: boolean;
-}
-
-/** QueryDataPolicy is the policy configuration for querying data. */
-export interface QueryDataPolicy {
- /** The query timeout duration. */
- timeout: Duration | undefined;
-}
-
-/** The SQL review rules. Check the SQL_REVIEW_RULES_DOCUMENTATION.md for details. */
-export interface SQLReviewRule {
- type: string;
- level: SQLReviewRuleLevel;
- /** The payload is a JSON string that varies by rule type. */
- payload: string;
- engine: Engine;
- comment: string;
-}
-
-/** MaskingExceptionPolicy is the allowlist of users who can access sensitive data. */
-export interface MaskingExceptionPolicy {
- maskingExceptions: MaskingExceptionPolicy_MaskingException[];
-}
-
-export interface MaskingExceptionPolicy_MaskingException {
- /** action is the action that the user can access sensitive data. */
- action: MaskingExceptionPolicy_MaskingException_Action;
- /**
- * Member is the principal who bind to this exception policy instance.
- *
- * - `user:{email}`: An email address that represents a specific Bytebase account. For example, `[email protected]`.
- * - `group:{email}`: An email address for group.
- */
- member: string;
- /**
- * The condition that is associated with this exception policy instance.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- * If the condition is empty, means the user can access all databases without expiration.
- *
- * Support variables:
- * resource.instance_id: the instance resource id. Only support "==" operation.
- * resource.database_name: the database name. Only support "==" operation.
- * resource.schema_name: the schema name. Only support "==" operation.
- * resource.table_name: the table name. Only support "==" operation.
- * resource.column_name: the column name. Only support "==" operation.
- * request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`
- * All variables should join with "&&" condition.
- *
- * For example:
- * resource.instance_id == "local" && resource.database_name == "employee" && request.time < timestamp("2025-04-30T11:10:39.000Z")
- * resource.instance_id == "local" && resource.database_name == "employee"
- */
- condition: Expr | undefined;
-}
-
-export enum MaskingExceptionPolicy_MaskingException_Action {
- ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
- QUERY = "QUERY",
- EXPORT = "EXPORT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function maskingExceptionPolicy_MaskingException_ActionFromJSON(
- object: any,
-): MaskingExceptionPolicy_MaskingException_Action {
- switch (object) {
- case 0:
- case "ACTION_UNSPECIFIED":
- return MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED;
- case 1:
- case "QUERY":
- return MaskingExceptionPolicy_MaskingException_Action.QUERY;
- case 2:
- case "EXPORT":
- return MaskingExceptionPolicy_MaskingException_Action.EXPORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED;
- }
-}
-
-export function maskingExceptionPolicy_MaskingException_ActionToJSON(
- object: MaskingExceptionPolicy_MaskingException_Action,
-): string {
- switch (object) {
- case MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED:
- return "ACTION_UNSPECIFIED";
- case MaskingExceptionPolicy_MaskingException_Action.QUERY:
- return "QUERY";
- case MaskingExceptionPolicy_MaskingException_Action.EXPORT:
- return "EXPORT";
- case MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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[];
-}
-
-export interface MaskingRulePolicy_MaskingRule {
- /** A unique identifier for a node in UUID format. */
- id: string;
- /**
- * The condition for the masking rule.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Support variables:
- * environment_id: the environment resource id.
- * project_id: the project resource id.
- * instance_id: the instance resource id.
- * database_name: the database name.
- * table_name: the table name.
- * column_name: the column name.
- * classification_level: the classification level.
- *
- * Each variable support following operations:
- * ==: the value equals the target.
- * !=: the value not equals the target.
- * in: the value matches one of the targets.
- * !(in): the value not matches any of the targets.
- *
- * For example:
- * environment_id == "test" && project_id == "sample-project"
- * instance_id == "sample-instance" && database_name == "employee" && table_name in ["table1", "table2"]
- * environment_id != "test" || !(project_id in ["poject1", "prject2"])
- * instance_id == "sample-instance" && (database_name == "db1" || database_name == "db2")
- */
- condition: Expr | undefined;
- semanticType: string;
-}
-
-export interface RestrictIssueCreationForSQLReviewPolicy {
- disallow: boolean;
-}
-
-export interface TagPolicy {
- /**
- * tags is the key - value map for resources.
- * for example, the environment resource can have the sql review config tag, like "bb.tag.review_config": "reviewConfigs/{review config resource id}"
- */
- tags: { [key: string]: string };
-}
-
-export interface TagPolicy_TagsEntry {
- key: string;
- value: string;
-}
-
-/** DataSourceQueryPolicy is the policy configuration for running statements in the SQL editor. */
-export interface DataSourceQueryPolicy {
- adminDataSourceRestriction: DataSourceQueryPolicy_Restriction;
- /** Disallow running DDL statements in the SQL editor. */
- disallowDdl: boolean;
- /** Disallow running DML statements in the SQL editor. */
- disallowDml: boolean;
-}
-
-export enum DataSourceQueryPolicy_Restriction {
- RESTRICTION_UNSPECIFIED = "RESTRICTION_UNSPECIFIED",
- /** FALLBACK - Allow to query admin data sources when there is no read-only data source. */
- FALLBACK = "FALLBACK",
- /** DISALLOW - Disallow to query admin data sources. */
- DISALLOW = "DISALLOW",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceQueryPolicy_RestrictionFromJSON(object: any): DataSourceQueryPolicy_Restriction {
- switch (object) {
- case 0:
- case "RESTRICTION_UNSPECIFIED":
- return DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED;
- case 1:
- case "FALLBACK":
- return DataSourceQueryPolicy_Restriction.FALLBACK;
- case 2:
- case "DISALLOW":
- return DataSourceQueryPolicy_Restriction.DISALLOW;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceQueryPolicy_Restriction.UNRECOGNIZED;
- }
-}
-
-export function dataSourceQueryPolicy_RestrictionToJSON(object: DataSourceQueryPolicy_Restriction): string {
- switch (object) {
- case DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED:
- return "RESTRICTION_UNSPECIFIED";
- case DataSourceQueryPolicy_Restriction.FALLBACK:
- return "FALLBACK";
- case DataSourceQueryPolicy_Restriction.DISALLOW:
- return "DISALLOW";
- case DataSourceQueryPolicy_Restriction.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function dataSourceQueryPolicy_RestrictionToNumber(object: DataSourceQueryPolicy_Restriction): number {
- switch (object) {
- case DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED:
- return 0;
- case DataSourceQueryPolicy_Restriction.FALLBACK:
- return 1;
- case DataSourceQueryPolicy_Restriction.DISALLOW:
- return 2;
- case DataSourceQueryPolicy_Restriction.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseCreatePolicyRequest(): CreatePolicyRequest {
- return { parent: "", policy: undefined, type: PolicyType.POLICY_TYPE_UNSPECIFIED };
-}
-
-export const CreatePolicyRequest: MessageFns<CreatePolicyRequest> = {
- encode(message: CreatePolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.policy !== undefined) {
- Policy.encode(message.policy, writer.uint32(18).fork()).join();
- }
- if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(policyTypeToNumber(message.type));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreatePolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreatePolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.policy = Policy.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = policyTypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreatePolicyRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- policy: isSet(object.policy) ? Policy.fromJSON(object.policy) : undefined,
- type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: CreatePolicyRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.policy !== undefined) {
- obj.policy = Policy.toJSON(message.policy);
- }
- if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
- obj.type = policyTypeToJSON(message.type);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreatePolicyRequest>): CreatePolicyRequest {
- return CreatePolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreatePolicyRequest>): CreatePolicyRequest {
- const message = createBaseCreatePolicyRequest();
- message.parent = object.parent ?? "";
- message.policy = (object.policy !== undefined && object.policy !== null)
- ? Policy.fromPartial(object.policy)
- : undefined;
- message.type = object.type ?? PolicyType.POLICY_TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseUpdatePolicyRequest(): UpdatePolicyRequest {
- return { policy: undefined, updateMask: undefined, allowMissing: false };
-}
-
-export const UpdatePolicyRequest: MessageFns<UpdatePolicyRequest> = {
- encode(message: UpdatePolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.policy !== undefined) {
- Policy.encode(message.policy, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdatePolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdatePolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.policy = Policy.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdatePolicyRequest {
- return {
- policy: isSet(object.policy) ? Policy.fromJSON(object.policy) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- };
- },
-
- toJSON(message: UpdatePolicyRequest): unknown {
- const obj: any = {};
- if (message.policy !== undefined) {
- obj.policy = Policy.toJSON(message.policy);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdatePolicyRequest>): UpdatePolicyRequest {
- return UpdatePolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdatePolicyRequest>): UpdatePolicyRequest {
- const message = createBaseUpdatePolicyRequest();
- message.policy = (object.policy !== undefined && object.policy !== null)
- ? Policy.fromPartial(object.policy)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.allowMissing = object.allowMissing ?? false;
- return message;
- },
-};
-
-function createBaseDeletePolicyRequest(): DeletePolicyRequest {
- return { name: "" };
-}
-
-export const DeletePolicyRequest: MessageFns<DeletePolicyRequest> = {
- encode(message: DeletePolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeletePolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeletePolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeletePolicyRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeletePolicyRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeletePolicyRequest>): DeletePolicyRequest {
- return DeletePolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeletePolicyRequest>): DeletePolicyRequest {
- const message = createBaseDeletePolicyRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseGetPolicyRequest(): GetPolicyRequest {
- return { name: "" };
-}
-
-export const GetPolicyRequest: MessageFns<GetPolicyRequest> = {
- encode(message: GetPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetPolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetPolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetPolicyRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetPolicyRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetPolicyRequest>): GetPolicyRequest {
- return GetPolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetPolicyRequest>): GetPolicyRequest {
- const message = createBaseGetPolicyRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListPoliciesRequest(): ListPoliciesRequest {
- return { parent: "", policyType: undefined, pageSize: 0, pageToken: "", showDeleted: false };
-}
-
-export const ListPoliciesRequest: MessageFns<ListPoliciesRequest> = {
- encode(message: ListPoliciesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.policyType !== undefined) {
- writer.uint32(16).int32(policyTypeToNumber(message.policyType));
- }
- if (message.pageSize !== 0) {
- writer.uint32(24).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(34).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(40).bool(message.showDeleted);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPoliciesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPoliciesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.policyType = policyTypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPoliciesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- policyType: isSet(object.policyType) ? policyTypeFromJSON(object.policyType) : undefined,
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- };
- },
-
- toJSON(message: ListPoliciesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.policyType !== undefined) {
- obj.policyType = policyTypeToJSON(message.policyType);
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPoliciesRequest>): ListPoliciesRequest {
- return ListPoliciesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPoliciesRequest>): ListPoliciesRequest {
- const message = createBaseListPoliciesRequest();
- message.parent = object.parent ?? "";
- message.policyType = object.policyType ?? undefined;
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- return message;
- },
-};
-
-function createBaseListPoliciesResponse(): ListPoliciesResponse {
- return { policies: [], nextPageToken: "" };
-}
-
-export const ListPoliciesResponse: MessageFns<ListPoliciesResponse> = {
- encode(message: ListPoliciesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.policies) {
- Policy.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPoliciesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPoliciesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.policies.push(Policy.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPoliciesResponse {
- return {
- policies: globalThis.Array.isArray(object?.policies) ? object.policies.map((e: any) => Policy.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListPoliciesResponse): unknown {
- const obj: any = {};
- if (message.policies?.length) {
- obj.policies = message.policies.map((e) => Policy.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPoliciesResponse>): ListPoliciesResponse {
- return ListPoliciesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPoliciesResponse>): ListPoliciesResponse {
- const message = createBaseListPoliciesResponse();
- message.policies = object.policies?.map((e) => Policy.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBasePolicy(): Policy {
- return {
- name: "",
- inheritFromParent: false,
- type: PolicyType.POLICY_TYPE_UNSPECIFIED,
- rolloutPolicy: undefined,
- disableCopyDataPolicy: undefined,
- maskingRulePolicy: undefined,
- maskingExceptionPolicy: undefined,
- restrictIssueCreationForSqlReviewPolicy: undefined,
- tagPolicy: undefined,
- dataSourceQueryPolicy: undefined,
- exportDataPolicy: undefined,
- queryDataPolicy: undefined,
- enforce: false,
- resourceType: PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
- };
-}
-
-export const Policy: MessageFns<Policy> = {
- encode(message: Policy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.inheritFromParent !== false) {
- writer.uint32(32).bool(message.inheritFromParent);
- }
- 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()).join();
- }
- if (message.disableCopyDataPolicy !== undefined) {
- DisableCopyDataPolicy.encode(message.disableCopyDataPolicy, writer.uint32(130).fork()).join();
- }
- if (message.maskingRulePolicy !== undefined) {
- MaskingRulePolicy.encode(message.maskingRulePolicy, writer.uint32(138).fork()).join();
- }
- if (message.maskingExceptionPolicy !== undefined) {
- MaskingExceptionPolicy.encode(message.maskingExceptionPolicy, writer.uint32(146).fork()).join();
- }
- if (message.restrictIssueCreationForSqlReviewPolicy !== undefined) {
- RestrictIssueCreationForSQLReviewPolicy.encode(
- message.restrictIssueCreationForSqlReviewPolicy,
- writer.uint32(162).fork(),
- ).join();
- }
- if (message.tagPolicy !== undefined) {
- TagPolicy.encode(message.tagPolicy, writer.uint32(170).fork()).join();
- }
- if (message.dataSourceQueryPolicy !== undefined) {
- DataSourceQueryPolicy.encode(message.dataSourceQueryPolicy, writer.uint32(178).fork()).join();
- }
- if (message.exportDataPolicy !== undefined) {
- ExportDataPolicy.encode(message.exportDataPolicy, writer.uint32(186).fork()).join();
- }
- if (message.queryDataPolicy !== undefined) {
- QueryDataPolicy.encode(message.queryDataPolicy, writer.uint32(194).fork()).join();
- }
- if (message.enforce !== false) {
- writer.uint32(104).bool(message.enforce);
- }
- if (message.resourceType !== PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED) {
- writer.uint32(112).int32(policyResourceTypeToNumber(message.resourceType));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Policy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.inheritFromParent = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.type = policyTypeFromJSON(reader.int32());
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.rolloutPolicy = RolloutPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.disableCopyDataPolicy = DisableCopyDataPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.maskingRulePolicy = MaskingRulePolicy.decode(reader, reader.uint32());
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.maskingExceptionPolicy = MaskingExceptionPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.restrictIssueCreationForSqlReviewPolicy = RestrictIssueCreationForSQLReviewPolicy.decode(
- reader,
- reader.uint32(),
- );
- continue;
- }
- case 21: {
- if (tag !== 170) {
- break;
- }
-
- message.tagPolicy = TagPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- message.dataSourceQueryPolicy = DataSourceQueryPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 23: {
- if (tag !== 186) {
- break;
- }
-
- message.exportDataPolicy = ExportDataPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 24: {
- if (tag !== 194) {
- break;
- }
-
- message.queryDataPolicy = QueryDataPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 13: {
- if (tag !== 104) {
- break;
- }
-
- message.enforce = reader.bool();
- continue;
- }
- case 14: {
- if (tag !== 112) {
- break;
- }
-
- message.resourceType = policyResourceTypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Policy {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- inheritFromParent: isSet(object.inheritFromParent) ? globalThis.Boolean(object.inheritFromParent) : false,
- type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
- rolloutPolicy: isSet(object.rolloutPolicy) ? RolloutPolicy.fromJSON(object.rolloutPolicy) : undefined,
- disableCopyDataPolicy: isSet(object.disableCopyDataPolicy)
- ? DisableCopyDataPolicy.fromJSON(object.disableCopyDataPolicy)
- : undefined,
- maskingRulePolicy: isSet(object.maskingRulePolicy)
- ? MaskingRulePolicy.fromJSON(object.maskingRulePolicy)
- : undefined,
- maskingExceptionPolicy: isSet(object.maskingExceptionPolicy)
- ? MaskingExceptionPolicy.fromJSON(object.maskingExceptionPolicy)
- : undefined,
- restrictIssueCreationForSqlReviewPolicy: isSet(object.restrictIssueCreationForSqlReviewPolicy)
- ? RestrictIssueCreationForSQLReviewPolicy.fromJSON(object.restrictIssueCreationForSqlReviewPolicy)
- : undefined,
- tagPolicy: isSet(object.tagPolicy) ? TagPolicy.fromJSON(object.tagPolicy) : undefined,
- dataSourceQueryPolicy: isSet(object.dataSourceQueryPolicy)
- ? DataSourceQueryPolicy.fromJSON(object.dataSourceQueryPolicy)
- : undefined,
- exportDataPolicy: isSet(object.exportDataPolicy) ? ExportDataPolicy.fromJSON(object.exportDataPolicy) : undefined,
- queryDataPolicy: isSet(object.queryDataPolicy) ? QueryDataPolicy.fromJSON(object.queryDataPolicy) : undefined,
- enforce: isSet(object.enforce) ? globalThis.Boolean(object.enforce) : false,
- resourceType: isSet(object.resourceType)
- ? policyResourceTypeFromJSON(object.resourceType)
- : PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: Policy): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.inheritFromParent !== false) {
- obj.inheritFromParent = message.inheritFromParent;
- }
- if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
- obj.type = policyTypeToJSON(message.type);
- }
- if (message.rolloutPolicy !== undefined) {
- obj.rolloutPolicy = RolloutPolicy.toJSON(message.rolloutPolicy);
- }
- if (message.disableCopyDataPolicy !== undefined) {
- obj.disableCopyDataPolicy = DisableCopyDataPolicy.toJSON(message.disableCopyDataPolicy);
- }
- if (message.maskingRulePolicy !== undefined) {
- obj.maskingRulePolicy = MaskingRulePolicy.toJSON(message.maskingRulePolicy);
- }
- if (message.maskingExceptionPolicy !== undefined) {
- obj.maskingExceptionPolicy = MaskingExceptionPolicy.toJSON(message.maskingExceptionPolicy);
- }
- if (message.restrictIssueCreationForSqlReviewPolicy !== undefined) {
- obj.restrictIssueCreationForSqlReviewPolicy = RestrictIssueCreationForSQLReviewPolicy.toJSON(
- message.restrictIssueCreationForSqlReviewPolicy,
- );
- }
- if (message.tagPolicy !== undefined) {
- obj.tagPolicy = TagPolicy.toJSON(message.tagPolicy);
- }
- if (message.dataSourceQueryPolicy !== undefined) {
- obj.dataSourceQueryPolicy = DataSourceQueryPolicy.toJSON(message.dataSourceQueryPolicy);
- }
- if (message.exportDataPolicy !== undefined) {
- obj.exportDataPolicy = ExportDataPolicy.toJSON(message.exportDataPolicy);
- }
- if (message.queryDataPolicy !== undefined) {
- obj.queryDataPolicy = QueryDataPolicy.toJSON(message.queryDataPolicy);
- }
- if (message.enforce !== false) {
- obj.enforce = message.enforce;
- }
- if (message.resourceType !== PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED) {
- obj.resourceType = policyResourceTypeToJSON(message.resourceType);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Policy>): Policy {
- return Policy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Policy>): Policy {
- const message = createBasePolicy();
- message.name = object.name ?? "";
- message.inheritFromParent = object.inheritFromParent ?? false;
- message.type = object.type ?? PolicyType.POLICY_TYPE_UNSPECIFIED;
- message.rolloutPolicy = (object.rolloutPolicy !== undefined && object.rolloutPolicy !== null)
- ? RolloutPolicy.fromPartial(object.rolloutPolicy)
- : undefined;
- message.disableCopyDataPolicy =
- (object.disableCopyDataPolicy !== undefined && object.disableCopyDataPolicy !== null)
- ? DisableCopyDataPolicy.fromPartial(object.disableCopyDataPolicy)
- : undefined;
- message.maskingRulePolicy = (object.maskingRulePolicy !== undefined && object.maskingRulePolicy !== null)
- ? MaskingRulePolicy.fromPartial(object.maskingRulePolicy)
- : undefined;
- message.maskingExceptionPolicy =
- (object.maskingExceptionPolicy !== undefined && object.maskingExceptionPolicy !== null)
- ? MaskingExceptionPolicy.fromPartial(object.maskingExceptionPolicy)
- : undefined;
- message.restrictIssueCreationForSqlReviewPolicy =
- (object.restrictIssueCreationForSqlReviewPolicy !== undefined &&
- object.restrictIssueCreationForSqlReviewPolicy !== null)
- ? RestrictIssueCreationForSQLReviewPolicy.fromPartial(object.restrictIssueCreationForSqlReviewPolicy)
- : undefined;
- message.tagPolicy = (object.tagPolicy !== undefined && object.tagPolicy !== null)
- ? TagPolicy.fromPartial(object.tagPolicy)
- : undefined;
- message.dataSourceQueryPolicy =
- (object.dataSourceQueryPolicy !== undefined && object.dataSourceQueryPolicy !== null)
- ? DataSourceQueryPolicy.fromPartial(object.dataSourceQueryPolicy)
- : undefined;
- message.exportDataPolicy = (object.exportDataPolicy !== undefined && object.exportDataPolicy !== null)
- ? ExportDataPolicy.fromPartial(object.exportDataPolicy)
- : undefined;
- message.queryDataPolicy = (object.queryDataPolicy !== undefined && object.queryDataPolicy !== null)
- ? QueryDataPolicy.fromPartial(object.queryDataPolicy)
- : undefined;
- message.enforce = object.enforce ?? false;
- message.resourceType = object.resourceType ?? PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseRolloutPolicy(): RolloutPolicy {
- return { automatic: false, roles: [], issueRoles: [] };
-}
-
-export const RolloutPolicy: MessageFns<RolloutPolicy> = {
- encode(message: RolloutPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.automatic !== false) {
- writer.uint32(8).bool(message.automatic);
- }
- for (const v of message.roles) {
- writer.uint32(18).string(v!);
- }
- for (const v of message.issueRoles) {
- writer.uint32(26).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RolloutPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRolloutPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.automatic = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.roles.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.issueRoles.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RolloutPolicy {
- return {
- automatic: isSet(object.automatic) ? globalThis.Boolean(object.automatic) : false,
- roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => globalThis.String(e)) : [],
- issueRoles: globalThis.Array.isArray(object?.issueRoles)
- ? object.issueRoles.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: RolloutPolicy): unknown {
- const obj: any = {};
- if (message.automatic !== false) {
- obj.automatic = message.automatic;
- }
- if (message.roles?.length) {
- obj.roles = message.roles;
- }
- if (message.issueRoles?.length) {
- obj.issueRoles = message.issueRoles;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RolloutPolicy>): RolloutPolicy {
- return RolloutPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RolloutPolicy>): RolloutPolicy {
- const message = createBaseRolloutPolicy();
- message.automatic = object.automatic ?? false;
- message.roles = object.roles?.map((e) => e) || [];
- message.issueRoles = object.issueRoles?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseDisableCopyDataPolicy(): DisableCopyDataPolicy {
- return { active: false };
-}
-
-export const DisableCopyDataPolicy: MessageFns<DisableCopyDataPolicy> = {
- encode(message: DisableCopyDataPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.active !== false) {
- writer.uint32(8).bool(message.active);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DisableCopyDataPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDisableCopyDataPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.active = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DisableCopyDataPolicy {
- return { active: isSet(object.active) ? globalThis.Boolean(object.active) : false };
- },
-
- toJSON(message: DisableCopyDataPolicy): unknown {
- const obj: any = {};
- if (message.active !== false) {
- obj.active = message.active;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DisableCopyDataPolicy>): DisableCopyDataPolicy {
- return DisableCopyDataPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DisableCopyDataPolicy>): DisableCopyDataPolicy {
- const message = createBaseDisableCopyDataPolicy();
- message.active = object.active ?? false;
- return message;
- },
-};
-
-function createBaseExportDataPolicy(): ExportDataPolicy {
- return { disable: false };
-}
-
-export const ExportDataPolicy: MessageFns<ExportDataPolicy> = {
- encode(message: ExportDataPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.disable !== false) {
- writer.uint32(8).bool(message.disable);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExportDataPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExportDataPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.disable = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExportDataPolicy {
- return { disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false };
- },
-
- toJSON(message: ExportDataPolicy): unknown {
- const obj: any = {};
- if (message.disable !== false) {
- obj.disable = message.disable;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExportDataPolicy>): ExportDataPolicy {
- return ExportDataPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExportDataPolicy>): ExportDataPolicy {
- const message = createBaseExportDataPolicy();
- message.disable = object.disable ?? false;
- return message;
- },
-};
-
-function createBaseQueryDataPolicy(): QueryDataPolicy {
- return { timeout: undefined };
-}
-
-export const QueryDataPolicy: MessageFns<QueryDataPolicy> = {
- encode(message: QueryDataPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.timeout !== undefined) {
- Duration.encode(message.timeout, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryDataPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryDataPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.timeout = Duration.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryDataPolicy {
- return { timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined };
- },
-
- toJSON(message: QueryDataPolicy): unknown {
- const obj: any = {};
- if (message.timeout !== undefined) {
- obj.timeout = Duration.toJSON(message.timeout);
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryDataPolicy>): QueryDataPolicy {
- return QueryDataPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryDataPolicy>): QueryDataPolicy {
- const message = createBaseQueryDataPolicy();
- message.timeout = (object.timeout !== undefined && object.timeout !== null)
- ? Duration.fromPartial(object.timeout)
- : undefined;
- return message;
- },
-};
-
-function createBaseSQLReviewRule(): SQLReviewRule {
- return {
- type: "",
- level: SQLReviewRuleLevel.LEVEL_UNSPECIFIED,
- payload: "",
- engine: Engine.ENGINE_UNSPECIFIED,
- comment: "",
- };
-}
-
-export const SQLReviewRule: MessageFns<SQLReviewRule> = {
- encode(message: SQLReviewRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== "") {
- writer.uint32(10).string(message.type);
- }
- 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 !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(32).int32(engineToNumber(message.engine));
- }
- if (message.comment !== "") {
- writer.uint32(42).string(message.comment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SQLReviewRule {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSQLReviewRule();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.type = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.level = sQLReviewRuleLevelFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.payload = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.comment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SQLReviewRule {
- return {
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- level: isSet(object.level) ? sQLReviewRuleLevelFromJSON(object.level) : SQLReviewRuleLevel.LEVEL_UNSPECIFIED,
- payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
- };
- },
-
- toJSON(message: SQLReviewRule): unknown {
- const obj: any = {};
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.level !== SQLReviewRuleLevel.LEVEL_UNSPECIFIED) {
- obj.level = sQLReviewRuleLevelToJSON(message.level);
- }
- if (message.payload !== "") {
- obj.payload = message.payload;
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.comment !== "") {
- obj.comment = message.comment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SQLReviewRule>): SQLReviewRule {
- return SQLReviewRule.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SQLReviewRule>): SQLReviewRule {
- const message = createBaseSQLReviewRule();
- message.type = object.type ?? "";
- message.level = object.level ?? SQLReviewRuleLevel.LEVEL_UNSPECIFIED;
- message.payload = object.payload ?? "";
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.comment = object.comment ?? "";
- return message;
- },
-};
-
-function createBaseMaskingExceptionPolicy(): MaskingExceptionPolicy {
- return { maskingExceptions: [] };
-}
-
-export const MaskingExceptionPolicy: MessageFns<MaskingExceptionPolicy> = {
- encode(message: MaskingExceptionPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.maskingExceptions) {
- MaskingExceptionPolicy_MaskingException.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MaskingExceptionPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMaskingExceptionPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.maskingExceptions.push(MaskingExceptionPolicy_MaskingException.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MaskingExceptionPolicy {
- return {
- maskingExceptions: globalThis.Array.isArray(object?.maskingExceptions)
- ? object.maskingExceptions.map((e: any) => MaskingExceptionPolicy_MaskingException.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: MaskingExceptionPolicy): unknown {
- const obj: any = {};
- if (message.maskingExceptions?.length) {
- obj.maskingExceptions = message.maskingExceptions.map((e) => MaskingExceptionPolicy_MaskingException.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<MaskingExceptionPolicy>): MaskingExceptionPolicy {
- return MaskingExceptionPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MaskingExceptionPolicy>): MaskingExceptionPolicy {
- const message = createBaseMaskingExceptionPolicy();
- message.maskingExceptions =
- object.maskingExceptions?.map((e) => MaskingExceptionPolicy_MaskingException.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseMaskingExceptionPolicy_MaskingException(): MaskingExceptionPolicy_MaskingException {
- return {
- action: MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
- member: "",
- condition: undefined,
- };
-}
-
-export const MaskingExceptionPolicy_MaskingException: MessageFns<MaskingExceptionPolicy_MaskingException> = {
- encode(message: MaskingExceptionPolicy_MaskingException, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
- writer.uint32(8).int32(maskingExceptionPolicy_MaskingException_ActionToNumber(message.action));
- }
- if (message.member !== "") {
- writer.uint32(26).string(message.member);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MaskingExceptionPolicy_MaskingException {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMaskingExceptionPolicy_MaskingException();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.action = maskingExceptionPolicy_MaskingException_ActionFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.member = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MaskingExceptionPolicy_MaskingException {
- return {
- action: isSet(object.action)
- ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action)
- : MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
- member: isSet(object.member) ? globalThis.String(object.member) : "",
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- };
- },
-
- toJSON(message: MaskingExceptionPolicy_MaskingException): unknown {
- const obj: any = {};
- if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
- obj.action = maskingExceptionPolicy_MaskingException_ActionToJSON(message.action);
- }
- if (message.member !== "") {
- obj.member = message.member;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {
- return MaskingExceptionPolicy_MaskingException.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {
- const message = createBaseMaskingExceptionPolicy_MaskingException();
- message.action = object.action ?? MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED;
- message.member = object.member ?? "";
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- return message;
- },
-};
-
-function createBaseMaskingRulePolicy(): MaskingRulePolicy {
- return { rules: [] };
-}
-
-export const MaskingRulePolicy: MessageFns<MaskingRulePolicy> = {
- encode(message: MaskingRulePolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.rules) {
- MaskingRulePolicy_MaskingRule.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MaskingRulePolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMaskingRulePolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.rules.push(MaskingRulePolicy_MaskingRule.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MaskingRulePolicy {
- return {
- rules: globalThis.Array.isArray(object?.rules)
- ? object.rules.map((e: any) => MaskingRulePolicy_MaskingRule.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: MaskingRulePolicy): unknown {
- const obj: any = {};
- if (message.rules?.length) {
- obj.rules = message.rules.map((e) => MaskingRulePolicy_MaskingRule.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<MaskingRulePolicy>): MaskingRulePolicy {
- return MaskingRulePolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MaskingRulePolicy>): MaskingRulePolicy {
- const message = createBaseMaskingRulePolicy();
- message.rules = object.rules?.map((e) => MaskingRulePolicy_MaskingRule.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseMaskingRulePolicy_MaskingRule(): MaskingRulePolicy_MaskingRule {
- return { id: "", condition: undefined, semanticType: "" };
-}
-
-export const MaskingRulePolicy_MaskingRule: MessageFns<MaskingRulePolicy_MaskingRule> = {
- encode(message: MaskingRulePolicy_MaskingRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(18).fork()).join();
- }
- if (message.semanticType !== "") {
- writer.uint32(26).string(message.semanticType);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): MaskingRulePolicy_MaskingRule {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseMaskingRulePolicy_MaskingRule();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.semanticType = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): MaskingRulePolicy_MaskingRule {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
- };
- },
-
- toJSON(message: MaskingRulePolicy_MaskingRule): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- if (message.semanticType !== "") {
- obj.semanticType = message.semanticType;
- }
- return obj;
- },
-
- create(base?: DeepPartial<MaskingRulePolicy_MaskingRule>): MaskingRulePolicy_MaskingRule {
- return MaskingRulePolicy_MaskingRule.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<MaskingRulePolicy_MaskingRule>): MaskingRulePolicy_MaskingRule {
- const message = createBaseMaskingRulePolicy_MaskingRule();
- message.id = object.id ?? "";
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- message.semanticType = object.semanticType ?? "";
- return message;
- },
-};
-
-function createBaseRestrictIssueCreationForSQLReviewPolicy(): RestrictIssueCreationForSQLReviewPolicy {
- return { disallow: false };
-}
-
-export const RestrictIssueCreationForSQLReviewPolicy: MessageFns<RestrictIssueCreationForSQLReviewPolicy> = {
- encode(message: RestrictIssueCreationForSQLReviewPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.disallow !== false) {
- writer.uint32(8).bool(message.disallow);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RestrictIssueCreationForSQLReviewPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRestrictIssueCreationForSQLReviewPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.disallow = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RestrictIssueCreationForSQLReviewPolicy {
- return { disallow: isSet(object.disallow) ? globalThis.Boolean(object.disallow) : false };
- },
-
- toJSON(message: RestrictIssueCreationForSQLReviewPolicy): unknown {
- const obj: any = {};
- if (message.disallow !== false) {
- obj.disallow = message.disallow;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RestrictIssueCreationForSQLReviewPolicy>): RestrictIssueCreationForSQLReviewPolicy {
- return RestrictIssueCreationForSQLReviewPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RestrictIssueCreationForSQLReviewPolicy>): RestrictIssueCreationForSQLReviewPolicy {
- const message = createBaseRestrictIssueCreationForSQLReviewPolicy();
- message.disallow = object.disallow ?? false;
- return message;
- },
-};
-
-function createBaseTagPolicy(): TagPolicy {
- return { tags: {} };
-}
-
-export const TagPolicy: MessageFns<TagPolicy> = {
- encode(message: TagPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- Object.entries(message.tags).forEach(([key, value]) => {
- TagPolicy_TagsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
- });
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TagPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTagPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- const entry1 = TagPolicy_TagsEntry.decode(reader, reader.uint32());
- if (entry1.value !== undefined) {
- message.tags[entry1.key] = entry1.value;
- }
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TagPolicy {
- return {
- tags: isObject(object.tags)
- ? Object.entries(object.tags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- };
- },
-
- toJSON(message: TagPolicy): unknown {
- const obj: any = {};
- if (message.tags) {
- const entries = Object.entries(message.tags);
- if (entries.length > 0) {
- obj.tags = {};
- entries.forEach(([k, v]) => {
- obj.tags[k] = v;
- });
- }
- }
- return obj;
- },
-
- create(base?: DeepPartial<TagPolicy>): TagPolicy {
- return TagPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TagPolicy>): TagPolicy {
- const message = createBaseTagPolicy();
- message.tags = Object.entries(object.tags ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- return message;
- },
-};
-
-function createBaseTagPolicy_TagsEntry(): TagPolicy_TagsEntry {
- return { key: "", value: "" };
-}
-
-export const TagPolicy_TagsEntry: MessageFns<TagPolicy_TagsEntry> = {
- encode(message: TagPolicy_TagsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TagPolicy_TagsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTagPolicy_TagsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TagPolicy_TagsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: TagPolicy_TagsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TagPolicy_TagsEntry>): TagPolicy_TagsEntry {
- return TagPolicy_TagsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TagPolicy_TagsEntry>): TagPolicy_TagsEntry {
- const message = createBaseTagPolicy_TagsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBaseDataSourceQueryPolicy(): DataSourceQueryPolicy {
- return {
- adminDataSourceRestriction: DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED,
- disallowDdl: false,
- disallowDml: false,
- };
-}
-
-export const DataSourceQueryPolicy: MessageFns<DataSourceQueryPolicy> = {
- encode(message: DataSourceQueryPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.adminDataSourceRestriction !== DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED) {
- writer.uint32(8).int32(dataSourceQueryPolicy_RestrictionToNumber(message.adminDataSourceRestriction));
- }
- if (message.disallowDdl !== false) {
- writer.uint32(16).bool(message.disallowDdl);
- }
- if (message.disallowDml !== false) {
- writer.uint32(24).bool(message.disallowDml);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceQueryPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceQueryPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.adminDataSourceRestriction = dataSourceQueryPolicy_RestrictionFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.disallowDdl = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.disallowDml = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSourceQueryPolicy {
- return {
- adminDataSourceRestriction: isSet(object.adminDataSourceRestriction)
- ? dataSourceQueryPolicy_RestrictionFromJSON(object.adminDataSourceRestriction)
- : DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED,
- disallowDdl: isSet(object.disallowDdl) ? globalThis.Boolean(object.disallowDdl) : false,
- disallowDml: isSet(object.disallowDml) ? globalThis.Boolean(object.disallowDml) : false,
- };
- },
-
- toJSON(message: DataSourceQueryPolicy): unknown {
- const obj: any = {};
- if (message.adminDataSourceRestriction !== DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED) {
- obj.adminDataSourceRestriction = dataSourceQueryPolicy_RestrictionToJSON(message.adminDataSourceRestriction);
- }
- if (message.disallowDdl !== false) {
- obj.disallowDdl = message.disallowDdl;
- }
- if (message.disallowDml !== false) {
- obj.disallowDml = message.disallowDml;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSourceQueryPolicy>): DataSourceQueryPolicy {
- return DataSourceQueryPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSourceQueryPolicy>): DataSourceQueryPolicy {
- const message = createBaseDataSourceQueryPolicy();
- message.adminDataSourceRestriction = object.adminDataSourceRestriction ??
- DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED;
- message.disallowDdl = object.disallowDdl ?? false;
- message.disallowDml = object.disallowDml ?? false;
- return message;
- },
-};
-
-export type OrgPolicyServiceDefinition = typeof OrgPolicyServiceDefinition;
-export const OrgPolicyServiceDefinition = {
- name: "OrgPolicyService",
- fullName: "bytebase.v1.OrgPolicyService",
- methods: {
- /** Permissions required: bb.policies.get */
- getPolicy: {
- name: "GetPolicy",
- requestType: GetPolicyRequest,
- requestStream: false,
- responseType: Policy,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 111, 108, 105, 99, 105, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 185,
- 1,
- 90,
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 38,
- 18,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 101,
- 110,
- 118,
- 105,
- 114,
- 111,
- 110,
- 109,
- 101,
- 110,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 35,
- 18,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 47,
- 18,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 18,
- 21,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.policies.list */
- listPolicies: {
- name: "ListPolicies",
- requestType: ListPoliciesRequest,
- requestStream: false,
- responseType: ListPoliciesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([16, 98, 98, 46, 112, 111, 108, 105, 99, 105, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 176,
- 1,
- 90,
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 38,
- 18,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 101,
- 110,
- 118,
- 105,
- 114,
- 111,
- 110,
- 109,
- 101,
- 110,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 35,
- 18,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 47,
- 18,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 18,
- 12,
- 47,
- 118,
- 49,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.policies.create */
- createPolicy: {
- name: "CreatePolicy",
- requestType: CreatePolicyRequest,
- requestStream: false,
- responseType: Policy,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([13, 112, 97, 114, 101, 110, 116, 44, 112, 111, 108, 105, 99, 121])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 111, 108, 105, 99, 105, 101, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 216,
- 1,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 90,
- 42,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 34,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 46,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 34,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 101,
- 110,
- 118,
- 105,
- 114,
- 111,
- 110,
- 109,
- 101,
- 110,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 43,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 34,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 90,
- 55,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 34,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 34,
- 12,
- 47,
- 118,
- 49,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.policies.update */
- updatePolicy: {
- name: "UpdatePolicy",
- requestType: UpdatePolicyRequest,
- requestStream: false,
- responseType: Policy,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([18, 112, 111, 108, 105, 99, 121, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 111, 108, 105, 99, 105, 101, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 132,
- 2,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 90,
- 49,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 50,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 53,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 50,
- 43,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 101,
- 110,
- 118,
- 105,
- 114,
- 111,
- 110,
- 109,
- 101,
- 110,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 50,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 50,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 62,
- 58,
- 6,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 50,
- 52,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 50,
- 28,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 111,
- 108,
- 105,
- 99,
- 121,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.policies.delete */
- deletePolicy: {
- name: "DeletePolicy",
- requestType: DeletePolicyRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 111, 108, 105, 99, 105, 101, 115, 46, 100, 101, 108, 101, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 185,
- 1,
- 90,
- 34,
- 42,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 38,
- 42,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 101,
- 110,
- 118,
- 105,
- 114,
- 111,
- 110,
- 109,
- 101,
- 110,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 35,
- 42,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 90,
- 47,
- 42,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- 42,
- 21,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
deleted file mode 100644
index a41a0e80bc..0000000000
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ /dev/null
@@ -1,4032 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/plan_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber, Position } from "./common";
-import { ChangedResources } from "./database_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetPlanRequest {
- /**
- * The name of the plan to retrieve.
- * Format: projects/{project}/plans/{plan}
- */
- name: string;
-}
-
-export interface ListPlansRequest {
- /**
- * The parent, which owns this collection of plans.
- * Format: projects/{project}
- * Use "projects/-" to list all plans from all projects.
- */
- parent: string;
- /**
- * The maximum number of plans to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 plans will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListPlans` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListPlans` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListPlansResponse {
- /** The plans from the specified request. */
- plans: Plan[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface SearchPlansRequest {
- /**
- * The parent, which owns this collection of plans.
- * Format: projects/{project}
- * Use "projects/-" to list all plans from all projects.
- */
- parent: string;
- /**
- * The maximum number of plans to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 plans will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `SearchPlans` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `SearchPlans` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /**
- * Filter is used to filter plans returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
- * - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
- * - has_pipeline: the plan has pipeline or not, support "==" operator, the value should be "true" or "false".
- * - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
- *
- * For example:
- * creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
- * has_pipeline == false && has_issue == true
- */
- filter: string;
-}
-
-export interface SearchPlansResponse {
- /** The plans from the specified request. */
- plans: Plan[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreatePlanRequest {
- /**
- * The parent project where this plan will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The plan to create. */
- plan: Plan | undefined;
-}
-
-export interface UpdatePlanRequest {
- /**
- * The plan to update.
- *
- * The plan's `name` field is used to identify the plan to update.
- * Format: projects/{project}/plans/{plan}
- */
- plan:
- | Plan
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface Plan {
- /**
- * The name of the plan.
- * `plan` is a system generated ID.
- * Format: projects/{project}/plans/{plan}
- */
- name: string;
- /**
- * The issue associated with the plan.
- * Can be empty.
- * Format: projects/{project}/issues/{issue}
- */
- issue: string;
- /**
- * The rollout associated with the plan.
- * Can be empty.
- * Format: projects/{project}/rollouts/{rollout}
- */
- rollout: string;
- title: string;
- description: string;
- specs: Plan_Spec[];
- /** Format: users/[email protected] */
- creator: string;
- createTime: Timestamp | undefined;
- updateTime:
- | Timestamp
- | undefined;
- /**
- * The status count of the latest plan check runs.
- * Keys are:
- * - SUCCESS
- * - WARNING
- * - ERROR
- */
- planCheckRunStatusCount: { [key: string]: number };
- deployment: Plan_Deployment | undefined;
-}
-
-export interface Plan_Spec {
- /** A UUID4 string that uniquely identifies the Spec. */
- id: string;
- createDatabaseConfig?: Plan_CreateDatabaseConfig | undefined;
- changeDatabaseConfig?: Plan_ChangeDatabaseConfig | undefined;
- exportDataConfig?: Plan_ExportDataConfig | undefined;
-}
-
-export interface Plan_PlanCheckRunStatusCountEntry {
- key: string;
- value: number;
-}
-
-export interface Plan_CreateDatabaseConfig {
- /**
- * The resource name of the instance on which the database is created.
- * Format: instances/{instance}
- */
- target: string;
- /** The name of the database to create. */
- database: string;
- /**
- * table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.
- * For example, in MongoDB, it only creates the database when we first store data in that database.
- */
- table: string;
- /** character_set is the character set of the database. */
- characterSet: string;
- /** collation is the collation of the database. */
- collation: string;
- /** cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>". */
- cluster: string;
- /** owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>". */
- owner: string;
- /**
- * The environment resource.
- * Format: environments/prod where prod is the environment resource ID.
- */
- environment: string;
-}
-
-export interface Plan_ChangeDatabaseConfig {
- /**
- * The list of targets.
- * Multi-database format: [instances/{instance-id}/databases/{database-name}].
- * Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
- */
- targets: string[];
- /**
- * The resource name of the sheet.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet: string;
- /**
- * The resource name of the release.
- * Format: projects/{project}/releases/{release}
- */
- release: string;
- type: Plan_ChangeDatabaseConfig_Type;
- ghostFlags: { [key: string]: string };
- /** If set, a backup of the modified data will be created automatically before any changes are applied. */
- enablePriorBackup: boolean;
-}
-
-/** Type is the database change type. */
-export enum Plan_ChangeDatabaseConfig_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- /** MIGRATE - Used for DDL changes including CREATE DATABASE. */
- MIGRATE = "MIGRATE",
- /** MIGRATE_SDL - Used for schema changes via state-based schema migration including CREATE DATABASE. */
- MIGRATE_SDL = "MIGRATE_SDL",
- /** MIGRATE_GHOST - Used for DDL changes using gh-ost. */
- MIGRATE_GHOST = "MIGRATE_GHOST",
- /** DATA - Used for DML change. */
- DATA = "DATA",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function plan_ChangeDatabaseConfig_TypeFromJSON(object: any): Plan_ChangeDatabaseConfig_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED;
- case 2:
- case "MIGRATE":
- return Plan_ChangeDatabaseConfig_Type.MIGRATE;
- case 3:
- case "MIGRATE_SDL":
- return Plan_ChangeDatabaseConfig_Type.MIGRATE_SDL;
- case 4:
- case "MIGRATE_GHOST":
- return Plan_ChangeDatabaseConfig_Type.MIGRATE_GHOST;
- case 6:
- case "DATA":
- return Plan_ChangeDatabaseConfig_Type.DATA;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Plan_ChangeDatabaseConfig_Type.UNRECOGNIZED;
- }
-}
-
-export function plan_ChangeDatabaseConfig_TypeToJSON(object: Plan_ChangeDatabaseConfig_Type): string {
- switch (object) {
- case Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Plan_ChangeDatabaseConfig_Type.MIGRATE:
- return "MIGRATE";
- case Plan_ChangeDatabaseConfig_Type.MIGRATE_SDL:
- return "MIGRATE_SDL";
- case Plan_ChangeDatabaseConfig_Type.MIGRATE_GHOST:
- return "MIGRATE_GHOST";
- case Plan_ChangeDatabaseConfig_Type.DATA:
- return "DATA";
- case Plan_ChangeDatabaseConfig_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function plan_ChangeDatabaseConfig_TypeToNumber(object: Plan_ChangeDatabaseConfig_Type): number {
- switch (object) {
- case Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED:
- return 0;
- 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_GhostFlagsEntry {
- key: string;
- value: string;
-}
-
-export interface Plan_ExportDataConfig {
- /**
- * The list of targets.
- * Multi-database format: [instances/{instance-id}/databases/{database-name}].
- * Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
- */
- targets: string[];
- /**
- * The resource name of the sheet.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet: string;
- /** The format of the exported file. */
- format: ExportFormat;
- /**
- * The zip password provide by users.
- * Leave it empty if no needs to encrypt the zip file.
- */
- password?: string | undefined;
-}
-
-export interface Plan_Deployment {
- /** The environments deploy order. */
- environments: string[];
- /** The database group mapping. */
- databaseGroupMappings: Plan_Deployment_DatabaseGroupMapping[];
-}
-
-export interface Plan_Deployment_DatabaseGroupMapping {
- /** Format: projects/{project}/databaseGroups/{databaseGroup}. */
- databaseGroup: string;
- /** Format: instances/{instance-id}/databases/{database-name}. */
- databases: string[];
-}
-
-export interface ListPlanCheckRunsRequest {
- /**
- * The parent, which owns this collection of plan check runs.
- * Format: projects/{project}/plans/{plan}
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of plan check runs to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 plan check runs will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListPlanCheckRuns` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListPlanCheckRuns` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** If set to true, only the latest plan check run will be returned. */
- latestOnly: boolean;
- /**
- * Filter is used to filter plan check runs returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- * - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
- *
- * For example:
- * status in ["DONE", "FAILED"]
- * status == "RUNNING"
- * result_status in ["SUCCESS", "ERROR"]
- * result_status == "WARNING"
- */
- filter: string;
-}
-
-export interface ListPlanCheckRunsResponse {
- /** The plan check runs from the specified request. */
- planCheckRuns: PlanCheckRun[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface RunPlanChecksRequest {
- /**
- * The plan to run plan checks.
- * Format: projects/{project}/plans/{plan}
- */
- name: string;
- /**
- * The UUID of the specific spec to run plan checks for.
- * This should match the spec.id field in Plan.Spec.
- * If not set, all specs in the plan will be used.
- */
- specId?: string | undefined;
-}
-
-export interface RunPlanChecksResponse {
-}
-
-export interface BatchCancelPlanCheckRunsRequest {
- /**
- * The name of the parent of the planChecks.
- * Format: projects/{project}/plans/{plan}
- */
- parent: string;
- /**
- * TODO(d): update this API.
- * The planCheckRuns to cancel.
- * Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- */
- planCheckRuns: string[];
-}
-
-export interface BatchCancelPlanCheckRunsResponse {
-}
-
-export interface PlanCheckRun {
- /** Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} */
- name: string;
- type: PlanCheckRun_Type;
- status: PlanCheckRun_Status;
- /** Format: instances/{instance}/databases/{database} */
- target: string;
- /** Format: project/{project}/sheets/{sheet} */
- sheet: string;
- results: PlanCheckRun_Result[];
- /** error is set if the Status is FAILED. */
- error: string;
- createTime: Timestamp | undefined;
-}
-
-export enum PlanCheckRun_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- DATABASE_STATEMENT_FAKE_ADVISE = "DATABASE_STATEMENT_FAKE_ADVISE",
- DATABASE_STATEMENT_ADVISE = "DATABASE_STATEMENT_ADVISE",
- 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 {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return PlanCheckRun_Type.TYPE_UNSPECIFIED;
- case 1:
- case "DATABASE_STATEMENT_FAKE_ADVISE":
- return PlanCheckRun_Type.DATABASE_STATEMENT_FAKE_ADVISE;
- case 3:
- case "DATABASE_STATEMENT_ADVISE":
- return PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE;
- case 5:
- case "DATABASE_STATEMENT_SUMMARY_REPORT":
- return PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT;
- case 6:
- case "DATABASE_CONNECT":
- return PlanCheckRun_Type.DATABASE_CONNECT;
- case 7:
- case "DATABASE_GHOST_SYNC":
- return PlanCheckRun_Type.DATABASE_GHOST_SYNC;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PlanCheckRun_Type.UNRECOGNIZED;
- }
-}
-
-export function planCheckRun_TypeToJSON(object: PlanCheckRun_Type): string {
- switch (object) {
- case PlanCheckRun_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case PlanCheckRun_Type.DATABASE_STATEMENT_FAKE_ADVISE:
- return "DATABASE_STATEMENT_FAKE_ADVISE";
- case PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE:
- return "DATABASE_STATEMENT_ADVISE";
- case PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT:
- return "DATABASE_STATEMENT_SUMMARY_REPORT";
- case PlanCheckRun_Type.DATABASE_CONNECT:
- return "DATABASE_CONNECT";
- case PlanCheckRun_Type.DATABASE_GHOST_SYNC:
- return "DATABASE_GHOST_SYNC";
- case PlanCheckRun_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_ADVISE:
- return 3;
- 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 = "STATUS_UNSPECIFIED",
- RUNNING = "RUNNING",
- DONE = "DONE",
- FAILED = "FAILED",
- CANCELED = "CANCELED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function planCheckRun_StatusFromJSON(object: any): PlanCheckRun_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return PlanCheckRun_Status.STATUS_UNSPECIFIED;
- case 1:
- case "RUNNING":
- return PlanCheckRun_Status.RUNNING;
- case 2:
- case "DONE":
- return PlanCheckRun_Status.DONE;
- case 3:
- case "FAILED":
- return PlanCheckRun_Status.FAILED;
- case 4:
- case "CANCELED":
- return PlanCheckRun_Status.CANCELED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PlanCheckRun_Status.UNRECOGNIZED;
- }
-}
-
-export function planCheckRun_StatusToJSON(object: PlanCheckRun_Status): string {
- switch (object) {
- case PlanCheckRun_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case PlanCheckRun_Status.RUNNING:
- return "RUNNING";
- case PlanCheckRun_Status.DONE:
- return "DONE";
- case PlanCheckRun_Status.FAILED:
- return "FAILED";
- case PlanCheckRun_Status.CANCELED:
- return "CANCELED";
- case PlanCheckRun_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- content: string;
- code: number;
- sqlSummaryReport?: PlanCheckRun_Result_SqlSummaryReport | undefined;
- sqlReviewReport?: PlanCheckRun_Result_SqlReviewReport | undefined;
-}
-
-export enum PlanCheckRun_Result_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- ERROR = "ERROR",
- WARNING = "WARNING",
- SUCCESS = "SUCCESS",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function planCheckRun_Result_StatusFromJSON(object: any): PlanCheckRun_Result_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return PlanCheckRun_Result_Status.STATUS_UNSPECIFIED;
- case 1:
- case "ERROR":
- return PlanCheckRun_Result_Status.ERROR;
- case 2:
- case "WARNING":
- return PlanCheckRun_Result_Status.WARNING;
- case 3:
- case "SUCCESS":
- return PlanCheckRun_Result_Status.SUCCESS;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PlanCheckRun_Result_Status.UNRECOGNIZED;
- }
-}
-
-export function planCheckRun_Result_StatusToJSON(object: PlanCheckRun_Result_Status): string {
- switch (object) {
- case PlanCheckRun_Result_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case PlanCheckRun_Result_Status.ERROR:
- return "ERROR";
- case PlanCheckRun_Result_Status.WARNING:
- return "WARNING";
- case PlanCheckRun_Result_Status.SUCCESS:
- return "SUCCESS";
- case PlanCheckRun_Result_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 {
- /** statement_types are the types of statements that are found in the sql. */
- statementTypes: string[];
- affectedRows: number;
- changedResources: ChangedResources | undefined;
-}
-
-export interface PlanCheckRun_Result_SqlReviewReport {
- line: number;
- column: number;
- /**
- * 1-based Position of the SQL statement.
- * To supersede `line` and `column` above.
- */
- startPosition: Position | undefined;
- endPosition: Position | undefined;
-}
-
-function createBaseGetPlanRequest(): GetPlanRequest {
- return { name: "" };
-}
-
-export const GetPlanRequest: MessageFns<GetPlanRequest> = {
- encode(message: GetPlanRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetPlanRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetPlanRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetPlanRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetPlanRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetPlanRequest>): GetPlanRequest {
- return GetPlanRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetPlanRequest>): GetPlanRequest {
- const message = createBaseGetPlanRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListPlansRequest(): ListPlansRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListPlansRequest: MessageFns<ListPlansRequest> = {
- encode(message: ListPlansRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPlansRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPlansRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPlansRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListPlansRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPlansRequest>): ListPlansRequest {
- return ListPlansRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPlansRequest>): ListPlansRequest {
- const message = createBaseListPlansRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListPlansResponse(): ListPlansResponse {
- return { plans: [], nextPageToken: "" };
-}
-
-export const ListPlansResponse: MessageFns<ListPlansResponse> = {
- encode(message: ListPlansResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.plans) {
- Plan.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPlansResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPlansResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.plans.push(Plan.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPlansResponse {
- return {
- plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => Plan.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListPlansResponse): unknown {
- const obj: any = {};
- if (message.plans?.length) {
- obj.plans = message.plans.map((e) => Plan.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPlansResponse>): ListPlansResponse {
- return ListPlansResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPlansResponse>): ListPlansResponse {
- const message = createBaseListPlansResponse();
- message.plans = object.plans?.map((e) => Plan.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchPlansRequest(): SearchPlansRequest {
- return { parent: "", pageSize: 0, pageToken: "", filter: "" };
-}
-
-export const SearchPlansRequest: MessageFns<SearchPlansRequest> = {
- encode(message: SearchPlansRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchPlansRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchPlansRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchPlansRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: SearchPlansRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchPlansRequest>): SearchPlansRequest {
- return SearchPlansRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchPlansRequest>): SearchPlansRequest {
- const message = createBaseSearchPlansRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseSearchPlansResponse(): SearchPlansResponse {
- return { plans: [], nextPageToken: "" };
-}
-
-export const SearchPlansResponse: MessageFns<SearchPlansResponse> = {
- encode(message: SearchPlansResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.plans) {
- Plan.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchPlansResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchPlansResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.plans.push(Plan.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchPlansResponse {
- return {
- plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => Plan.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchPlansResponse): unknown {
- const obj: any = {};
- if (message.plans?.length) {
- obj.plans = message.plans.map((e) => Plan.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchPlansResponse>): SearchPlansResponse {
- return SearchPlansResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchPlansResponse>): SearchPlansResponse {
- const message = createBaseSearchPlansResponse();
- message.plans = object.plans?.map((e) => Plan.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreatePlanRequest(): CreatePlanRequest {
- return { parent: "", plan: undefined };
-}
-
-export const CreatePlanRequest: MessageFns<CreatePlanRequest> = {
- encode(message: CreatePlanRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.plan !== undefined) {
- Plan.encode(message.plan, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreatePlanRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreatePlanRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.plan = Plan.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreatePlanRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
- };
- },
-
- toJSON(message: CreatePlanRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.plan !== undefined) {
- obj.plan = Plan.toJSON(message.plan);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreatePlanRequest>): CreatePlanRequest {
- return CreatePlanRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreatePlanRequest>): CreatePlanRequest {
- const message = createBaseCreatePlanRequest();
- message.parent = object.parent ?? "";
- message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined;
- return message;
- },
-};
-
-function createBaseUpdatePlanRequest(): UpdatePlanRequest {
- return { plan: undefined, updateMask: undefined };
-}
-
-export const UpdatePlanRequest: MessageFns<UpdatePlanRequest> = {
- encode(message: UpdatePlanRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.plan !== undefined) {
- Plan.encode(message.plan, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdatePlanRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdatePlanRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.plan = Plan.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdatePlanRequest {
- return {
- plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdatePlanRequest): unknown {
- const obj: any = {};
- if (message.plan !== undefined) {
- obj.plan = Plan.toJSON(message.plan);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdatePlanRequest>): UpdatePlanRequest {
- return UpdatePlanRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdatePlanRequest>): UpdatePlanRequest {
- const message = createBaseUpdatePlanRequest();
- message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBasePlan(): Plan {
- return {
- name: "",
- issue: "",
- rollout: "",
- title: "",
- description: "",
- specs: [],
- creator: "",
- createTime: undefined,
- updateTime: undefined,
- planCheckRunStatusCount: {},
- deployment: undefined,
- };
-}
-
-export const Plan: MessageFns<Plan> = {
- encode(message: Plan, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.issue !== "") {
- writer.uint32(26).string(message.issue);
- }
- if (message.rollout !== "") {
- writer.uint32(122).string(message.rollout);
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(42).string(message.description);
- }
- for (const v of message.specs) {
- Plan_Spec.encode(v!, writer.uint32(114).fork()).join();
- }
- if (message.creator !== "") {
- writer.uint32(66).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(74).fork()).join();
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(82).fork()).join();
- }
- Object.entries(message.planCheckRunStatusCount).forEach(([key, value]) => {
- Plan_PlanCheckRunStatusCountEntry.encode({ key: key as any, value }, writer.uint32(90).fork()).join();
- });
- if (message.deployment !== undefined) {
- Plan_Deployment.encode(message.deployment, writer.uint32(106).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.issue = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.rollout = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.specs.push(Plan_Spec.decode(reader, reader.uint32()));
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- const entry11 = Plan_PlanCheckRunStatusCountEntry.decode(reader, reader.uint32());
- if (entry11.value !== undefined) {
- message.planCheckRunStatusCount[entry11.key] = entry11.value;
- }
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.deployment = Plan_Deployment.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
- rollout: isSet(object.rollout) ? globalThis.String(object.rollout) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- specs: globalThis.Array.isArray(object?.specs) ? object.specs.map((e: any) => Plan_Spec.fromJSON(e)) : [],
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- planCheckRunStatusCount: isObject(object.planCheckRunStatusCount)
- ? Object.entries(object.planCheckRunStatusCount).reduce<{ [key: string]: number }>((acc, [key, value]) => {
- acc[key] = Number(value);
- return acc;
- }, {})
- : {},
- deployment: isSet(object.deployment) ? Plan_Deployment.fromJSON(object.deployment) : undefined,
- };
- },
-
- toJSON(message: Plan): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.issue !== "") {
- obj.issue = message.issue;
- }
- if (message.rollout !== "") {
- obj.rollout = message.rollout;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.specs?.length) {
- obj.specs = message.specs.map((e) => Plan_Spec.toJSON(e));
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.planCheckRunStatusCount) {
- const entries = Object.entries(message.planCheckRunStatusCount);
- if (entries.length > 0) {
- obj.planCheckRunStatusCount = {};
- entries.forEach(([k, v]) => {
- obj.planCheckRunStatusCount[k] = Math.round(v);
- });
- }
- }
- if (message.deployment !== undefined) {
- obj.deployment = Plan_Deployment.toJSON(message.deployment);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan>): Plan {
- return Plan.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan>): Plan {
- const message = createBasePlan();
- message.name = object.name ?? "";
- message.issue = object.issue ?? "";
- message.rollout = object.rollout ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.specs = object.specs?.map((e) => Plan_Spec.fromPartial(e)) || [];
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.planCheckRunStatusCount = Object.entries(object.planCheckRunStatusCount ?? {}).reduce<
- { [key: string]: number }
- >((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.Number(value);
- }
- return acc;
- }, {});
- message.deployment = (object.deployment !== undefined && object.deployment !== null)
- ? Plan_Deployment.fromPartial(object.deployment)
- : undefined;
- return message;
- },
-};
-
-function createBasePlan_Spec(): Plan_Spec {
- return { id: "", createDatabaseConfig: undefined, changeDatabaseConfig: undefined, exportDataConfig: undefined };
-}
-
-export const Plan_Spec: MessageFns<Plan_Spec> = {
- encode(message: Plan_Spec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(42).string(message.id);
- }
- if (message.createDatabaseConfig !== undefined) {
- Plan_CreateDatabaseConfig.encode(message.createDatabaseConfig, writer.uint32(10).fork()).join();
- }
- if (message.changeDatabaseConfig !== undefined) {
- Plan_ChangeDatabaseConfig.encode(message.changeDatabaseConfig, writer.uint32(18).fork()).join();
- }
- if (message.exportDataConfig !== undefined) {
- Plan_ExportDataConfig.encode(message.exportDataConfig, writer.uint32(58).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_Spec {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_Spec();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.createDatabaseConfig = Plan_CreateDatabaseConfig.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.changeDatabaseConfig = Plan_ChangeDatabaseConfig.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.exportDataConfig = Plan_ExportDataConfig.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_Spec {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- createDatabaseConfig: isSet(object.createDatabaseConfig)
- ? Plan_CreateDatabaseConfig.fromJSON(object.createDatabaseConfig)
- : undefined,
- changeDatabaseConfig: isSet(object.changeDatabaseConfig)
- ? Plan_ChangeDatabaseConfig.fromJSON(object.changeDatabaseConfig)
- : undefined,
- exportDataConfig: isSet(object.exportDataConfig)
- ? Plan_ExportDataConfig.fromJSON(object.exportDataConfig)
- : undefined,
- };
- },
-
- toJSON(message: Plan_Spec): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.createDatabaseConfig !== undefined) {
- obj.createDatabaseConfig = Plan_CreateDatabaseConfig.toJSON(message.createDatabaseConfig);
- }
- if (message.changeDatabaseConfig !== undefined) {
- obj.changeDatabaseConfig = Plan_ChangeDatabaseConfig.toJSON(message.changeDatabaseConfig);
- }
- if (message.exportDataConfig !== undefined) {
- obj.exportDataConfig = Plan_ExportDataConfig.toJSON(message.exportDataConfig);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_Spec>): Plan_Spec {
- return Plan_Spec.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_Spec>): Plan_Spec {
- const message = createBasePlan_Spec();
- message.id = object.id ?? "";
- message.createDatabaseConfig = (object.createDatabaseConfig !== undefined && object.createDatabaseConfig !== null)
- ? Plan_CreateDatabaseConfig.fromPartial(object.createDatabaseConfig)
- : undefined;
- message.changeDatabaseConfig = (object.changeDatabaseConfig !== undefined && object.changeDatabaseConfig !== null)
- ? Plan_ChangeDatabaseConfig.fromPartial(object.changeDatabaseConfig)
- : undefined;
- message.exportDataConfig = (object.exportDataConfig !== undefined && object.exportDataConfig !== null)
- ? Plan_ExportDataConfig.fromPartial(object.exportDataConfig)
- : undefined;
- return message;
- },
-};
-
-function createBasePlan_PlanCheckRunStatusCountEntry(): Plan_PlanCheckRunStatusCountEntry {
- return { key: "", value: 0 };
-}
-
-export const Plan_PlanCheckRunStatusCountEntry: MessageFns<Plan_PlanCheckRunStatusCountEntry> = {
- encode(message: Plan_PlanCheckRunStatusCountEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== 0) {
- writer.uint32(16).int32(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_PlanCheckRunStatusCountEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_PlanCheckRunStatusCountEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.value = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_PlanCheckRunStatusCountEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.Number(object.value) : 0,
- };
- },
-
- toJSON(message: Plan_PlanCheckRunStatusCountEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== 0) {
- obj.value = Math.round(message.value);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_PlanCheckRunStatusCountEntry>): Plan_PlanCheckRunStatusCountEntry {
- return Plan_PlanCheckRunStatusCountEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_PlanCheckRunStatusCountEntry>): Plan_PlanCheckRunStatusCountEntry {
- const message = createBasePlan_PlanCheckRunStatusCountEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? 0;
- return message;
- },
-};
-
-function createBasePlan_CreateDatabaseConfig(): Plan_CreateDatabaseConfig {
- return {
- target: "",
- database: "",
- table: "",
- characterSet: "",
- collation: "",
- cluster: "",
- owner: "",
- environment: "",
- };
-}
-
-export const Plan_CreateDatabaseConfig: MessageFns<Plan_CreateDatabaseConfig> = {
- encode(message: Plan_CreateDatabaseConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.target !== "") {
- writer.uint32(10).string(message.target);
- }
- if (message.database !== "") {
- writer.uint32(18).string(message.database);
- }
- if (message.table !== "") {
- writer.uint32(26).string(message.table);
- }
- if (message.characterSet !== "") {
- writer.uint32(34).string(message.characterSet);
- }
- if (message.collation !== "") {
- writer.uint32(42).string(message.collation);
- }
- if (message.cluster !== "") {
- writer.uint32(50).string(message.cluster);
- }
- if (message.owner !== "") {
- writer.uint32(58).string(message.owner);
- }
- if (message.environment !== "") {
- writer.uint32(74).string(message.environment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_CreateDatabaseConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_CreateDatabaseConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.characterSet = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.collation = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.cluster = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.owner = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_CreateDatabaseConfig {
- return {
- target: isSet(object.target) ? globalThis.String(object.target) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
- collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
- cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
- owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- };
- },
-
- toJSON(message: Plan_CreateDatabaseConfig): unknown {
- const obj: any = {};
- if (message.target !== "") {
- obj.target = message.target;
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- if (message.characterSet !== "") {
- obj.characterSet = message.characterSet;
- }
- if (message.collation !== "") {
- obj.collation = message.collation;
- }
- if (message.cluster !== "") {
- obj.cluster = message.cluster;
- }
- if (message.owner !== "") {
- obj.owner = message.owner;
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_CreateDatabaseConfig>): Plan_CreateDatabaseConfig {
- return Plan_CreateDatabaseConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_CreateDatabaseConfig>): Plan_CreateDatabaseConfig {
- const message = createBasePlan_CreateDatabaseConfig();
- message.target = object.target ?? "";
- message.database = object.database ?? "";
- message.table = object.table ?? "";
- message.characterSet = object.characterSet ?? "";
- message.collation = object.collation ?? "";
- message.cluster = object.cluster ?? "";
- message.owner = object.owner ?? "";
- message.environment = object.environment ?? "";
- return message;
- },
-};
-
-function createBasePlan_ChangeDatabaseConfig(): Plan_ChangeDatabaseConfig {
- return {
- targets: [],
- sheet: "",
- release: "",
- type: Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
- ghostFlags: {},
- enablePriorBackup: false,
- };
-}
-
-export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> = {
- encode(message: Plan_ChangeDatabaseConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.targets) {
- writer.uint32(82).string(v!);
- }
- if (message.sheet !== "") {
- writer.uint32(18).string(message.sheet);
- }
- if (message.release !== "") {
- writer.uint32(74).string(message.release);
- }
- if (message.type !== Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(plan_ChangeDatabaseConfig_TypeToNumber(message.type));
- }
- Object.entries(message.ghostFlags).forEach(([key, value]) => {
- Plan_ChangeDatabaseConfig_GhostFlagsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).join();
- });
- if (message.enablePriorBackup !== false) {
- writer.uint32(64).bool(message.enablePriorBackup);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_ChangeDatabaseConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_ChangeDatabaseConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.targets.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.release = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = plan_ChangeDatabaseConfig_TypeFromJSON(reader.int32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- const entry7 = Plan_ChangeDatabaseConfig_GhostFlagsEntry.decode(reader, reader.uint32());
- if (entry7.value !== undefined) {
- message.ghostFlags[entry7.key] = entry7.value;
- }
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.enablePriorBackup = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_ChangeDatabaseConfig {
- return {
- targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- release: isSet(object.release) ? globalThis.String(object.release) : "",
- type: isSet(object.type)
- ? plan_ChangeDatabaseConfig_TypeFromJSON(object.type)
- : Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
- ghostFlags: isObject(object.ghostFlags)
- ? Object.entries(object.ghostFlags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- enablePriorBackup: isSet(object.enablePriorBackup) ? globalThis.Boolean(object.enablePriorBackup) : false,
- };
- },
-
- toJSON(message: Plan_ChangeDatabaseConfig): unknown {
- const obj: any = {};
- if (message.targets?.length) {
- obj.targets = message.targets;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.release !== "") {
- obj.release = message.release;
- }
- if (message.type !== Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
- obj.type = plan_ChangeDatabaseConfig_TypeToJSON(message.type);
- }
- if (message.ghostFlags) {
- const entries = Object.entries(message.ghostFlags);
- if (entries.length > 0) {
- obj.ghostFlags = {};
- entries.forEach(([k, v]) => {
- obj.ghostFlags[k] = v;
- });
- }
- }
- if (message.enablePriorBackup !== false) {
- obj.enablePriorBackup = message.enablePriorBackup;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_ChangeDatabaseConfig>): Plan_ChangeDatabaseConfig {
- return Plan_ChangeDatabaseConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_ChangeDatabaseConfig>): Plan_ChangeDatabaseConfig {
- const message = createBasePlan_ChangeDatabaseConfig();
- message.targets = object.targets?.map((e) => e) || [];
- message.sheet = object.sheet ?? "";
- message.release = object.release ?? "";
- message.type = object.type ?? Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED;
- message.ghostFlags = Object.entries(object.ghostFlags ?? {}).reduce<{ [key: string]: string }>(
- (acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- },
- {},
- );
- message.enablePriorBackup = object.enablePriorBackup ?? false;
- return message;
- },
-};
-
-function createBasePlan_ChangeDatabaseConfig_GhostFlagsEntry(): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
- return { key: "", value: "" };
-}
-
-export const Plan_ChangeDatabaseConfig_GhostFlagsEntry: MessageFns<Plan_ChangeDatabaseConfig_GhostFlagsEntry> = {
- encode(message: Plan_ChangeDatabaseConfig_GhostFlagsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_ChangeDatabaseConfig_GhostFlagsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: Plan_ChangeDatabaseConfig_GhostFlagsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_ChangeDatabaseConfig_GhostFlagsEntry>): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
- return Plan_ChangeDatabaseConfig_GhostFlagsEntry.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<Plan_ChangeDatabaseConfig_GhostFlagsEntry>,
- ): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
- const message = createBasePlan_ChangeDatabaseConfig_GhostFlagsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-function createBasePlan_ExportDataConfig(): Plan_ExportDataConfig {
- return { targets: [], sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };
-}
-
-export const Plan_ExportDataConfig: MessageFns<Plan_ExportDataConfig> = {
- encode(message: Plan_ExportDataConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.targets) {
- writer.uint32(42).string(v!);
- }
- if (message.sheet !== "") {
- writer.uint32(18).string(message.sheet);
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- writer.uint32(24).int32(exportFormatToNumber(message.format));
- }
- if (message.password !== undefined) {
- writer.uint32(34).string(message.password);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_ExportDataConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_ExportDataConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.targets.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.format = exportFormatFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_ExportDataConfig {
- return {
- targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
- password: isSet(object.password) ? globalThis.String(object.password) : undefined,
- };
- },
-
- toJSON(message: Plan_ExportDataConfig): unknown {
- const obj: any = {};
- if (message.targets?.length) {
- obj.targets = message.targets;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- obj.format = exportFormatToJSON(message.format);
- }
- if (message.password !== undefined) {
- obj.password = message.password;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_ExportDataConfig>): Plan_ExportDataConfig {
- return Plan_ExportDataConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_ExportDataConfig>): Plan_ExportDataConfig {
- const message = createBasePlan_ExportDataConfig();
- message.targets = object.targets?.map((e) => e) || [];
- message.sheet = object.sheet ?? "";
- message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
- message.password = object.password ?? undefined;
- return message;
- },
-};
-
-function createBasePlan_Deployment(): Plan_Deployment {
- return { environments: [], databaseGroupMappings: [] };
-}
-
-export const Plan_Deployment: MessageFns<Plan_Deployment> = {
- encode(message: Plan_Deployment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.environments) {
- writer.uint32(10).string(v!);
- }
- for (const v of message.databaseGroupMappings) {
- Plan_Deployment_DatabaseGroupMapping.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_Deployment {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_Deployment();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.environments.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.databaseGroupMappings.push(Plan_Deployment_DatabaseGroupMapping.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_Deployment {
- return {
- environments: globalThis.Array.isArray(object?.environments)
- ? object.environments.map((e: any) => globalThis.String(e))
- : [],
- databaseGroupMappings: globalThis.Array.isArray(object?.databaseGroupMappings)
- ? object.databaseGroupMappings.map((e: any) => Plan_Deployment_DatabaseGroupMapping.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: Plan_Deployment): unknown {
- const obj: any = {};
- if (message.environments?.length) {
- obj.environments = message.environments;
- }
- if (message.databaseGroupMappings?.length) {
- obj.databaseGroupMappings = message.databaseGroupMappings.map((e) =>
- Plan_Deployment_DatabaseGroupMapping.toJSON(e)
- );
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_Deployment>): Plan_Deployment {
- return Plan_Deployment.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_Deployment>): Plan_Deployment {
- const message = createBasePlan_Deployment();
- message.environments = object.environments?.map((e) => e) || [];
- message.databaseGroupMappings =
- object.databaseGroupMappings?.map((e) => Plan_Deployment_DatabaseGroupMapping.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBasePlan_Deployment_DatabaseGroupMapping(): Plan_Deployment_DatabaseGroupMapping {
- return { databaseGroup: "", databases: [] };
-}
-
-export const Plan_Deployment_DatabaseGroupMapping: MessageFns<Plan_Deployment_DatabaseGroupMapping> = {
- encode(message: Plan_Deployment_DatabaseGroupMapping, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.databaseGroup !== "") {
- writer.uint32(10).string(message.databaseGroup);
- }
- for (const v of message.databases) {
- writer.uint32(18).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Plan_Deployment_DatabaseGroupMapping {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlan_Deployment_DatabaseGroupMapping();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databaseGroup = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.databases.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Plan_Deployment_DatabaseGroupMapping {
- return {
- databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: Plan_Deployment_DatabaseGroupMapping): unknown {
- const obj: any = {};
- if (message.databaseGroup !== "") {
- obj.databaseGroup = message.databaseGroup;
- }
- if (message.databases?.length) {
- obj.databases = message.databases;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Plan_Deployment_DatabaseGroupMapping>): Plan_Deployment_DatabaseGroupMapping {
- return Plan_Deployment_DatabaseGroupMapping.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Plan_Deployment_DatabaseGroupMapping>): Plan_Deployment_DatabaseGroupMapping {
- const message = createBasePlan_Deployment_DatabaseGroupMapping();
- message.databaseGroup = object.databaseGroup ?? "";
- message.databases = object.databases?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseListPlanCheckRunsRequest(): ListPlanCheckRunsRequest {
- return { parent: "", pageSize: 0, pageToken: "", latestOnly: false, filter: "" };
-}
-
-export const ListPlanCheckRunsRequest: MessageFns<ListPlanCheckRunsRequest> = {
- encode(message: ListPlanCheckRunsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.latestOnly !== false) {
- writer.uint32(32).bool(message.latestOnly);
- }
- if (message.filter !== "") {
- writer.uint32(42).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPlanCheckRunsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPlanCheckRunsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.latestOnly = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPlanCheckRunsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- latestOnly: isSet(object.latestOnly) ? globalThis.Boolean(object.latestOnly) : false,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListPlanCheckRunsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.latestOnly !== false) {
- obj.latestOnly = message.latestOnly;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPlanCheckRunsRequest>): ListPlanCheckRunsRequest {
- return ListPlanCheckRunsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPlanCheckRunsRequest>): ListPlanCheckRunsRequest {
- const message = createBaseListPlanCheckRunsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.latestOnly = object.latestOnly ?? false;
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListPlanCheckRunsResponse(): ListPlanCheckRunsResponse {
- return { planCheckRuns: [], nextPageToken: "" };
-}
-
-export const ListPlanCheckRunsResponse: MessageFns<ListPlanCheckRunsResponse> = {
- encode(message: ListPlanCheckRunsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.planCheckRuns) {
- PlanCheckRun.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListPlanCheckRunsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListPlanCheckRunsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.planCheckRuns.push(PlanCheckRun.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListPlanCheckRunsResponse {
- return {
- planCheckRuns: globalThis.Array.isArray(object?.planCheckRuns)
- ? object.planCheckRuns.map((e: any) => PlanCheckRun.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListPlanCheckRunsResponse): unknown {
- const obj: any = {};
- if (message.planCheckRuns?.length) {
- obj.planCheckRuns = message.planCheckRuns.map((e) => PlanCheckRun.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListPlanCheckRunsResponse>): ListPlanCheckRunsResponse {
- return ListPlanCheckRunsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListPlanCheckRunsResponse>): ListPlanCheckRunsResponse {
- const message = createBaseListPlanCheckRunsResponse();
- message.planCheckRuns = object.planCheckRuns?.map((e) => PlanCheckRun.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseRunPlanChecksRequest(): RunPlanChecksRequest {
- return { name: "", specId: undefined };
-}
-
-export const RunPlanChecksRequest: MessageFns<RunPlanChecksRequest> = {
- encode(message: RunPlanChecksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.specId !== undefined) {
- writer.uint32(18).string(message.specId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RunPlanChecksRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRunPlanChecksRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.specId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RunPlanChecksRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- specId: isSet(object.specId) ? globalThis.String(object.specId) : undefined,
- };
- },
-
- toJSON(message: RunPlanChecksRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.specId !== undefined) {
- obj.specId = message.specId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<RunPlanChecksRequest>): RunPlanChecksRequest {
- return RunPlanChecksRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RunPlanChecksRequest>): RunPlanChecksRequest {
- const message = createBaseRunPlanChecksRequest();
- message.name = object.name ?? "";
- message.specId = object.specId ?? undefined;
- return message;
- },
-};
-
-function createBaseRunPlanChecksResponse(): RunPlanChecksResponse {
- return {};
-}
-
-export const RunPlanChecksResponse: MessageFns<RunPlanChecksResponse> = {
- encode(_: RunPlanChecksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RunPlanChecksResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRunPlanChecksResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): RunPlanChecksResponse {
- return {};
- },
-
- toJSON(_: RunPlanChecksResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<RunPlanChecksResponse>): RunPlanChecksResponse {
- return RunPlanChecksResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<RunPlanChecksResponse>): RunPlanChecksResponse {
- const message = createBaseRunPlanChecksResponse();
- return message;
- },
-};
-
-function createBaseBatchCancelPlanCheckRunsRequest(): BatchCancelPlanCheckRunsRequest {
- return { parent: "", planCheckRuns: [] };
-}
-
-export const BatchCancelPlanCheckRunsRequest: MessageFns<BatchCancelPlanCheckRunsRequest> = {
- encode(message: BatchCancelPlanCheckRunsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.planCheckRuns) {
- writer.uint32(18).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelPlanCheckRunsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCancelPlanCheckRunsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.planCheckRuns.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCancelPlanCheckRunsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- planCheckRuns: globalThis.Array.isArray(object?.planCheckRuns)
- ? object.planCheckRuns.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: BatchCancelPlanCheckRunsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.planCheckRuns?.length) {
- obj.planCheckRuns = message.planCheckRuns;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCancelPlanCheckRunsRequest>): BatchCancelPlanCheckRunsRequest {
- return BatchCancelPlanCheckRunsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCancelPlanCheckRunsRequest>): BatchCancelPlanCheckRunsRequest {
- const message = createBaseBatchCancelPlanCheckRunsRequest();
- message.parent = object.parent ?? "";
- message.planCheckRuns = object.planCheckRuns?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchCancelPlanCheckRunsResponse(): BatchCancelPlanCheckRunsResponse {
- return {};
-}
-
-export const BatchCancelPlanCheckRunsResponse: MessageFns<BatchCancelPlanCheckRunsResponse> = {
- encode(_: BatchCancelPlanCheckRunsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelPlanCheckRunsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCancelPlanCheckRunsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchCancelPlanCheckRunsResponse {
- return {};
- },
-
- toJSON(_: BatchCancelPlanCheckRunsResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchCancelPlanCheckRunsResponse>): BatchCancelPlanCheckRunsResponse {
- return BatchCancelPlanCheckRunsResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchCancelPlanCheckRunsResponse>): BatchCancelPlanCheckRunsResponse {
- const message = createBaseBatchCancelPlanCheckRunsResponse();
- return message;
- },
-};
-
-function createBasePlanCheckRun(): PlanCheckRun {
- return {
- name: "",
- type: PlanCheckRun_Type.TYPE_UNSPECIFIED,
- status: PlanCheckRun_Status.STATUS_UNSPECIFIED,
- target: "",
- sheet: "",
- results: [],
- error: "",
- createTime: undefined,
- };
-}
-
-export const PlanCheckRun: MessageFns<PlanCheckRun> = {
- encode(message: PlanCheckRun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.type !== PlanCheckRun_Type.TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(planCheckRun_TypeToNumber(message.type));
- }
- if (message.status !== PlanCheckRun_Status.STATUS_UNSPECIFIED) {
- writer.uint32(32).int32(planCheckRun_StatusToNumber(message.status));
- }
- if (message.target !== "") {
- writer.uint32(42).string(message.target);
- }
- if (message.sheet !== "") {
- writer.uint32(50).string(message.sheet);
- }
- for (const v of message.results) {
- PlanCheckRun_Result.encode(v!, writer.uint32(58).fork()).join();
- }
- if (message.error !== "") {
- writer.uint32(66).string(message.error);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanCheckRun {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanCheckRun();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = planCheckRun_TypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.status = planCheckRun_StatusFromJSON(reader.int32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.results.push(PlanCheckRun_Result.decode(reader, reader.uint32()));
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanCheckRun {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type) ? planCheckRun_TypeFromJSON(object.type) : PlanCheckRun_Type.TYPE_UNSPECIFIED,
- status: isSet(object.status)
- ? planCheckRun_StatusFromJSON(object.status)
- : PlanCheckRun_Status.STATUS_UNSPECIFIED,
- target: isSet(object.target) ? globalThis.String(object.target) : "",
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- results: globalThis.Array.isArray(object?.results)
- ? object.results.map((e: any) => PlanCheckRun_Result.fromJSON(e))
- : [],
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- };
- },
-
- toJSON(message: PlanCheckRun): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.type !== PlanCheckRun_Type.TYPE_UNSPECIFIED) {
- obj.type = planCheckRun_TypeToJSON(message.type);
- }
- if (message.status !== PlanCheckRun_Status.STATUS_UNSPECIFIED) {
- obj.status = planCheckRun_StatusToJSON(message.status);
- }
- if (message.target !== "") {
- obj.target = message.target;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.results?.length) {
- obj.results = message.results.map((e) => PlanCheckRun_Result.toJSON(e));
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanCheckRun>): PlanCheckRun {
- return PlanCheckRun.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanCheckRun>): PlanCheckRun {
- const message = createBasePlanCheckRun();
- message.name = object.name ?? "";
- 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)) || [];
- message.error = object.error ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- return message;
- },
-};
-
-function createBasePlanCheckRun_Result(): PlanCheckRun_Result {
- return {
- status: PlanCheckRun_Result_Status.STATUS_UNSPECIFIED,
- title: "",
- content: "",
- code: 0,
- sqlSummaryReport: undefined,
- sqlReviewReport: undefined,
- };
-}
-
-export const PlanCheckRun_Result: MessageFns<PlanCheckRun_Result> = {
- encode(message: PlanCheckRun_Result, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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);
- }
- if (message.content !== "") {
- writer.uint32(26).string(message.content);
- }
- if (message.code !== 0) {
- writer.uint32(32).int32(message.code);
- }
- if (message.sqlSummaryReport !== undefined) {
- PlanCheckRun_Result_SqlSummaryReport.encode(message.sqlSummaryReport, writer.uint32(42).fork()).join();
- }
- if (message.sqlReviewReport !== undefined) {
- PlanCheckRun_Result_SqlReviewReport.encode(message.sqlReviewReport, writer.uint32(50).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanCheckRun_Result {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanCheckRun_Result();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.status = planCheckRun_Result_StatusFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.content = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.code = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.sqlSummaryReport = PlanCheckRun_Result_SqlSummaryReport.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.sqlReviewReport = PlanCheckRun_Result_SqlReviewReport.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanCheckRun_Result {
- return {
- status: isSet(object.status)
- ? planCheckRun_Result_StatusFromJSON(object.status)
- : PlanCheckRun_Result_Status.STATUS_UNSPECIFIED,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- content: isSet(object.content) ? globalThis.String(object.content) : "",
- code: isSet(object.code) ? globalThis.Number(object.code) : 0,
- sqlSummaryReport: isSet(object.sqlSummaryReport)
- ? PlanCheckRun_Result_SqlSummaryReport.fromJSON(object.sqlSummaryReport)
- : undefined,
- sqlReviewReport: isSet(object.sqlReviewReport)
- ? PlanCheckRun_Result_SqlReviewReport.fromJSON(object.sqlReviewReport)
- : undefined,
- };
- },
-
- toJSON(message: PlanCheckRun_Result): unknown {
- const obj: any = {};
- if (message.status !== PlanCheckRun_Result_Status.STATUS_UNSPECIFIED) {
- obj.status = planCheckRun_Result_StatusToJSON(message.status);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.content !== "") {
- obj.content = message.content;
- }
- if (message.code !== 0) {
- obj.code = Math.round(message.code);
- }
- if (message.sqlSummaryReport !== undefined) {
- obj.sqlSummaryReport = PlanCheckRun_Result_SqlSummaryReport.toJSON(message.sqlSummaryReport);
- }
- if (message.sqlReviewReport !== undefined) {
- obj.sqlReviewReport = PlanCheckRun_Result_SqlReviewReport.toJSON(message.sqlReviewReport);
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanCheckRun_Result>): PlanCheckRun_Result {
- return PlanCheckRun_Result.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanCheckRun_Result>): PlanCheckRun_Result {
- const message = createBasePlanCheckRun_Result();
- message.status = object.status ?? PlanCheckRun_Result_Status.STATUS_UNSPECIFIED;
- message.title = object.title ?? "";
- message.content = object.content ?? "";
- message.code = object.code ?? 0;
- message.sqlSummaryReport = (object.sqlSummaryReport !== undefined && object.sqlSummaryReport !== null)
- ? PlanCheckRun_Result_SqlSummaryReport.fromPartial(object.sqlSummaryReport)
- : undefined;
- message.sqlReviewReport = (object.sqlReviewReport !== undefined && object.sqlReviewReport !== null)
- ? PlanCheckRun_Result_SqlReviewReport.fromPartial(object.sqlReviewReport)
- : undefined;
- return message;
- },
-};
-
-function createBasePlanCheckRun_Result_SqlSummaryReport(): PlanCheckRun_Result_SqlSummaryReport {
- return { statementTypes: [], affectedRows: 0, changedResources: undefined };
-}
-
-export const PlanCheckRun_Result_SqlSummaryReport: MessageFns<PlanCheckRun_Result_SqlSummaryReport> = {
- encode(message: PlanCheckRun_Result_SqlSummaryReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.statementTypes) {
- writer.uint32(18).string(v!);
- }
- if (message.affectedRows !== 0) {
- writer.uint32(24).int32(message.affectedRows);
- }
- if (message.changedResources !== undefined) {
- ChangedResources.encode(message.changedResources, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanCheckRun_Result_SqlSummaryReport {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanCheckRun_Result_SqlSummaryReport();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.statementTypes.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.affectedRows = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.changedResources = ChangedResources.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanCheckRun_Result_SqlSummaryReport {
- return {
- statementTypes: globalThis.Array.isArray(object?.statementTypes)
- ? object.statementTypes.map((e: any) => globalThis.String(e))
- : [],
- affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
- changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
- };
- },
-
- toJSON(message: PlanCheckRun_Result_SqlSummaryReport): unknown {
- const obj: any = {};
- if (message.statementTypes?.length) {
- obj.statementTypes = message.statementTypes;
- }
- if (message.affectedRows !== 0) {
- obj.affectedRows = Math.round(message.affectedRows);
- }
- if (message.changedResources !== undefined) {
- obj.changedResources = ChangedResources.toJSON(message.changedResources);
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanCheckRun_Result_SqlSummaryReport>): PlanCheckRun_Result_SqlSummaryReport {
- return PlanCheckRun_Result_SqlSummaryReport.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanCheckRun_Result_SqlSummaryReport>): PlanCheckRun_Result_SqlSummaryReport {
- const message = createBasePlanCheckRun_Result_SqlSummaryReport();
- message.statementTypes = object.statementTypes?.map((e) => e) || [];
- message.affectedRows = object.affectedRows ?? 0;
- message.changedResources = (object.changedResources !== undefined && object.changedResources !== null)
- ? ChangedResources.fromPartial(object.changedResources)
- : undefined;
- return message;
- },
-};
-
-function createBasePlanCheckRun_Result_SqlReviewReport(): PlanCheckRun_Result_SqlReviewReport {
- return { line: 0, column: 0, startPosition: undefined, endPosition: undefined };
-}
-
-export const PlanCheckRun_Result_SqlReviewReport: MessageFns<PlanCheckRun_Result_SqlReviewReport> = {
- encode(message: PlanCheckRun_Result_SqlReviewReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.line !== 0) {
- writer.uint32(8).int32(message.line);
- }
- if (message.column !== 0) {
- writer.uint32(16).int32(message.column);
- }
- if (message.startPosition !== undefined) {
- Position.encode(message.startPosition, writer.uint32(42).fork()).join();
- }
- if (message.endPosition !== undefined) {
- Position.encode(message.endPosition, writer.uint32(50).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanCheckRun_Result_SqlReviewReport {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanCheckRun_Result_SqlReviewReport();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.line = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.column = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.startPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.endPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanCheckRun_Result_SqlReviewReport {
- return {
- line: isSet(object.line) ? globalThis.Number(object.line) : 0,
- column: isSet(object.column) ? globalThis.Number(object.column) : 0,
- startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
- endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
- };
- },
-
- toJSON(message: PlanCheckRun_Result_SqlReviewReport): unknown {
- const obj: any = {};
- if (message.line !== 0) {
- obj.line = Math.round(message.line);
- }
- if (message.column !== 0) {
- obj.column = Math.round(message.column);
- }
- if (message.startPosition !== undefined) {
- obj.startPosition = Position.toJSON(message.startPosition);
- }
- if (message.endPosition !== undefined) {
- obj.endPosition = Position.toJSON(message.endPosition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanCheckRun_Result_SqlReviewReport>): PlanCheckRun_Result_SqlReviewReport {
- return PlanCheckRun_Result_SqlReviewReport.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanCheckRun_Result_SqlReviewReport>): PlanCheckRun_Result_SqlReviewReport {
- const message = createBasePlanCheckRun_Result_SqlReviewReport();
- message.line = object.line ?? 0;
- message.column = object.column ?? 0;
- message.startPosition = (object.startPosition !== undefined && object.startPosition !== null)
- ? Position.fromPartial(object.startPosition)
- : undefined;
- message.endPosition = (object.endPosition !== undefined && object.endPosition !== null)
- ? Position.fromPartial(object.endPosition)
- : undefined;
- return message;
- },
-};
-
-export type PlanServiceDefinition = typeof PlanServiceDefinition;
-export const PlanServiceDefinition = {
- name: "PlanService",
- fullName: "bytebase.v1.PlanService",
- methods: {
- /** Permissions required: bb.plans.get */
- getPlan: {
- name: "GetPlan",
- requestType: GetPlanRequest,
- requestStream: false,
- responseType: Plan,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([12, 98, 98, 46, 112, 108, 97, 110, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 31,
- 18,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.plans.list */
- listPlans: {
- name: "ListPlans",
- requestType: ListPlansRequest,
- requestStream: false,
- responseType: ListPlansResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([13, 98, 98, 46, 112, 108, 97, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 31,
- 18,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /**
- * Search for plans that the caller has the bb.plans.get permission on and also satisfy the specified filter & query.
- * Permissions required: bb.plans.get
- */
- searchPlans: {
- name: "SearchPlans",
- requestType: SearchPlansRequest,
- requestStream: false,
- responseType: SearchPlansResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([12, 98, 98, 46, 112, 108, 97, 110, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 41,
- 58,
- 1,
- 42,
- 34,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.plans.create */
- createPlan: {
- name: "CreatePlan",
- requestType: CreatePlanRequest,
- requestStream: false,
- responseType: Plan,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([11, 112, 97, 114, 101, 110, 116, 44, 112, 108, 97, 110])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 108, 97, 110, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 37,
- 58,
- 4,
- 112,
- 108,
- 97,
- 110,
- 34,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /**
- * UpdatePlan updates the plan.
- * The plan creator and the user with bb.plans.update permission on the project can update the plan.
- * Permissions required: bb.plans.update
- */
- updatePlan: {
- name: "UpdatePlan",
- requestType: UpdatePlanRequest,
- requestStream: false,
- responseType: Plan,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([16, 112, 108, 97, 110, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 108, 97, 110, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 42,
- 58,
- 4,
- 112,
- 108,
- 97,
- 110,
- 50,
- 34,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 108,
- 97,
- 110,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.planCheckRuns.list */
- listPlanCheckRuns: {
- name: "ListPlanCheckRuns",
- requestType: ListPlanCheckRunsRequest,
- requestStream: false,
- responseType: ListPlanCheckRunsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 112,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 82,
- 117,
- 110,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 47,
- 18,
- 45,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 82,
- 117,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.planCheckRuns.run */
- runPlanChecks: {
- name: "RunPlanChecks",
- requestType: RunPlanChecksRequest,
- requestStream: false,
- responseType: RunPlanChecksResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 112,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 82,
- 117,
- 110,
- 115,
- 46,
- 114,
- 117,
- 110,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 48,
- 58,
- 1,
- 42,
- 34,
- 43,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 47,
- 42,
- 125,
- 58,
- 114,
- 117,
- 110,
- 80,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.planCheckRuns.run */
- batchCancelPlanCheckRuns: {
- name: "BatchCancelPlanCheckRuns",
- requestType: BatchCancelPlanCheckRunsRequest,
- requestStream: false,
- responseType: BatchCancelPlanCheckRunsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 112,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 82,
- 117,
- 110,
- 115,
- 46,
- 114,
- 117,
- 110,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 62,
- 58,
- 1,
- 42,
- 34,
- 57,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 112,
- 108,
- 97,
- 110,
- 115,
- 47,
- 42,
- 125,
- 47,
- 112,
- 108,
- 97,
- 110,
- 67,
- 104,
- 101,
- 99,
- 107,
- 82,
- 117,
- 110,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 67,
- 97,
- 110,
- 99,
- 101,
- 108,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
deleted file mode 100644
index 55940ef050..0000000000
--- a/frontend/src/types/proto/v1/project_service.ts
+++ /dev/null
@@ -1,3615 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/project_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
-import { GetIamPolicyRequest, IamPolicy, SetIamPolicyRequest } from "./iam_policy";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface GetProjectRequest {
- /**
- * The name of the project to retrieve.
- * Format: projects/{project}
- */
- name: string;
-}
-
-export interface ListProjectsRequest {
- /**
- * The maximum number of projects to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 projects will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListProjects` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListProjects` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Show deleted projects if specified. */
- showDeleted: boolean;
- /**
- * Filter the project.
- * Check filter for SearchProjectsRequest for details.
- */
- filter: string;
-}
-
-export interface ListProjectsResponse {
- /** The projects from the specified request. */
- projects: Project[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface SearchProjectsRequest {
- /** Show deleted projects if specified. */
- showDeleted: boolean;
- /**
- * Filter the project.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - name: the project name, support "==" and ".matches()" operator.
- * - resource_id: the project id, support "==" and ".matches()" operator.
- * - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
- * - state: check the State enum for the values, support "==" operator.
- *
- * For example:
- * name = "project name"
- * name.matches("project name")
- * resource_id = "project id"
- * resource_id.matches("project id")
- * exclude_default == true
- * state == "DELETED"
- * You can combine filter conditions like:
- * name = "project name" && resource_id.matches("project id")
- * name.matches("project name") || resource_id = "project id"
- */
- filter: string;
- /**
- * The maximum number of projects to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 projects will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `SearchProjects` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `SearchProjects` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface SearchProjectsResponse {
- /** The projects from the specified request. */
- projects: Project[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateProjectRequest {
- /** The project to create. */
- project:
- | Project
- | undefined;
- /**
- * The ID to use for the project, which will become the final component of
- * the project's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- projectId: string;
-}
-
-export interface UpdateProjectRequest {
- /**
- * The project to update.
- *
- * The project's `name` field is used to identify the project to update.
- * Format: projects/{project}
- */
- project:
- | Project
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteProjectRequest {
- /**
- * The name of the project to delete.
- * Format: projects/{project}
- */
- name: string;
- /**
- * If set to true, any databases from this project will be moved to default project.
- * Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
- * Open issues will remain open but associated with the deleted project.
- * If set to false, the operation will fail if the project has databases or open issues.
- */
- force: boolean;
-}
-
-export interface UndeleteProjectRequest {
- /**
- * The name of the deleted project.
- * Format: projects/{project}
- */
- name: string;
-}
-
-export interface BatchDeleteProjectsRequest {
- /**
- * The names of the projects to delete.
- * Format: projects/{project}
- */
- names: string[];
- /**
- * If set to true, any databases from this project will be moved to default project.
- * Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
- * Open issues will remain open but associated with the deleted project.
- * If set to false, the operation will fail if the project has databases or open issues.
- */
- force: boolean;
-}
-
-export interface BatchGetIamPolicyRequest {
- /** The scope of the batch get. Typically it's "projects/-". */
- scope: string;
- names: string[];
-}
-
-export interface BatchGetIamPolicyResponse {
- policyResults: BatchGetIamPolicyResponse_PolicyResult[];
-}
-
-export interface BatchGetIamPolicyResponse_PolicyResult {
- project: string;
- policy: IamPolicy | undefined;
-}
-
-export interface Label {
- value: string;
- color: string;
- group: string;
-}
-
-export interface Project {
- /**
- * The name of the project.
- * Format: projects/{project}
- */
- name: string;
- state: State;
- /** The title or name of a project. It's not unique within the workspace. */
- title: string;
- webhooks: Webhook[];
- dataClassificationConfigId: string;
- issueLabels: Label[];
- /** Force issue labels to be used when creating an issue. */
- forceIssueLabels: boolean;
- /** Allow modifying statement after issue is created. */
- allowModifyStatement: boolean;
- /** Enable auto resolve issue. */
- autoResolveIssue: boolean;
- /** Enforce issue title created by user instead of generated by Bytebase. */
- enforceIssueTitle: boolean;
- /** Whether to automatically enable backup. */
- autoEnableBackup: boolean;
- /** Whether to skip backup errors and continue the data migration. */
- skipBackupErrors: boolean;
- /**
- * Whether to enable the database tenant mode for PostgreSQL.
- * If enabled, the issue will be created with the prepend "set role <db_owner>" statement.
- */
- postgresDatabaseTenantMode: boolean;
- /** Whether to allow the issue creator to self-approve the issue. */
- allowSelfApproval: boolean;
- /** Execution retry policy for the task run. */
- executionRetryPolicy:
- | Project_ExecutionRetryPolicy
- | undefined;
- /**
- * The maximum databases of rows to sample during CI data validation.
- * Without specification, sampling is disabled, resulting in a full validation.
- */
- ciSamplingSize: number;
- /** The maximum number of parallel tasks to run during the rollout. */
- parallelTasksPerRollout: number;
-}
-
-export interface Project_ExecutionRetryPolicy {
- /** The maximum number of retries for the lock timeout issue. */
- maximumRetries: number;
-}
-
-export interface AddWebhookRequest {
- /**
- * The name of the project to add the webhook to.
- * Format: projects/{project}
- */
- project: string;
- /** The webhook to add. */
- webhook: Webhook | undefined;
-}
-
-export interface UpdateWebhookRequest {
- /** The webhook to modify. */
- webhook:
- | Webhook
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface RemoveWebhookRequest {
- /** The webhook to remove. Identified by its url. */
- webhook: Webhook | undefined;
-}
-
-export interface TestWebhookRequest {
- /**
- * The name of the project which owns the webhook to test.
- * Format: projects/{project}
- */
- project: string;
- /** The webhook to test. Identified by its url. */
- webhook: Webhook | undefined;
-}
-
-export interface TestWebhookResponse {
- /** The result of the test, empty if the test is successful. */
- error: string;
-}
-
-export interface Webhook {
- /**
- * name is the name of the webhook, generated by the server.
- * format: projects/{project}/webhooks/{webhook}
- */
- name: string;
- /** type is the type of the webhook. */
- type: Webhook_Type;
- /** title is the title of the webhook. */
- title: string;
- /** url is the url of the webhook, should be unique within the project. */
- url: string;
- /**
- * if direct_message is set, the notification is sent directly
- * to the persons and url will be ignored.
- * IM integration setting should be set for this function to work.
- */
- directMessage: boolean;
- /**
- * notification_types is the list of activities types that the webhook is interested in.
- * Bytebase will only send notifications to the webhook if the activity type is in the list.
- * It should not be empty, and should be a subset of the following:
- * - TYPE_ISSUE_CREATED
- * - TYPE_ISSUE_STATUS_UPDATE
- * - TYPE_ISSUE_PIPELINE_STAGE_UPDATE
- * - TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE
- * - TYPE_ISSUE_FIELD_UPDATE
- * - TYPE_ISSUE_COMMENT_CREATE
- */
- notificationTypes: Activity_Type[];
-}
-
-export enum Webhook_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- SLACK = "SLACK",
- DISCORD = "DISCORD",
- TEAMS = "TEAMS",
- DINGTALK = "DINGTALK",
- FEISHU = "FEISHU",
- WECOM = "WECOM",
- LARK = "LARK",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function webhook_TypeFromJSON(object: any): Webhook_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Webhook_Type.TYPE_UNSPECIFIED;
- case 1:
- case "SLACK":
- return Webhook_Type.SLACK;
- case 2:
- case "DISCORD":
- return Webhook_Type.DISCORD;
- case 3:
- case "TEAMS":
- return Webhook_Type.TEAMS;
- case 4:
- case "DINGTALK":
- return Webhook_Type.DINGTALK;
- case 5:
- case "FEISHU":
- return Webhook_Type.FEISHU;
- case 6:
- case "WECOM":
- return Webhook_Type.WECOM;
- case 8:
- case "LARK":
- return Webhook_Type.LARK;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Webhook_Type.UNRECOGNIZED;
- }
-}
-
-export function webhook_TypeToJSON(object: Webhook_Type): string {
- switch (object) {
- case Webhook_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Webhook_Type.SLACK:
- return "SLACK";
- case Webhook_Type.DISCORD:
- return "DISCORD";
- case Webhook_Type.TEAMS:
- return "TEAMS";
- case Webhook_Type.DINGTALK:
- return "DINGTALK";
- case Webhook_Type.FEISHU:
- return "FEISHU";
- case Webhook_Type.WECOM:
- return "WECOM";
- case Webhook_Type.LARK:
- return "LARK";
- case Webhook_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function webhook_TypeToNumber(object: Webhook_Type): number {
- switch (object) {
- case Webhook_Type.TYPE_UNSPECIFIED:
- return 0;
- case Webhook_Type.SLACK:
- return 1;
- case Webhook_Type.DISCORD:
- return 2;
- case Webhook_Type.TEAMS:
- return 3;
- case Webhook_Type.DINGTALK:
- return 4;
- case Webhook_Type.FEISHU:
- return 5;
- case Webhook_Type.WECOM:
- return 6;
- case Webhook_Type.LARK:
- return 8;
- case Webhook_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/** TODO(zp): move to activity later. */
-export interface Activity {
-}
-
-export enum Activity_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- /**
- * TYPE_NOTIFY_ISSUE_APPROVED - Notifications via webhooks.
- *
- * TYPE_NOTIFY_ISSUE_APPROVED represents the issue approved notification.
- */
- 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 = "TYPE_NOTIFY_PIPELINE_ROLLOUT",
- /**
- * TYPE_ISSUE_CREATE - Issue related activity types.
- *
- * TYPE_ISSUE_CREATE represents creating an issue.
- */
- TYPE_ISSUE_CREATE = "TYPE_ISSUE_CREATE",
- /** TYPE_ISSUE_COMMENT_CREATE - TYPE_ISSUE_COMMENT_CREATE represents commenting on an issue. */
- TYPE_ISSUE_COMMENT_CREATE = "TYPE_ISSUE_COMMENT_CREATE",
- /** TYPE_ISSUE_FIELD_UPDATE - TYPE_ISSUE_FIELD_UPDATE represents updating the issue field, likes title, description, etc. */
- 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 = "TYPE_ISSUE_STATUS_UPDATE",
- /** TYPE_ISSUE_APPROVAL_NOTIFY - TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. */
- 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 = "TYPE_ISSUE_PIPELINE_STAGE_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 = "TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function activity_TypeFromJSON(object: any): Activity_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Activity_Type.TYPE_UNSPECIFIED;
- case 23:
- case "TYPE_NOTIFY_ISSUE_APPROVED":
- return Activity_Type.TYPE_NOTIFY_ISSUE_APPROVED;
- case 24:
- case "TYPE_NOTIFY_PIPELINE_ROLLOUT":
- return Activity_Type.TYPE_NOTIFY_PIPELINE_ROLLOUT;
- case 1:
- case "TYPE_ISSUE_CREATE":
- return Activity_Type.TYPE_ISSUE_CREATE;
- case 2:
- case "TYPE_ISSUE_COMMENT_CREATE":
- return Activity_Type.TYPE_ISSUE_COMMENT_CREATE;
- case 3:
- case "TYPE_ISSUE_FIELD_UPDATE":
- return Activity_Type.TYPE_ISSUE_FIELD_UPDATE;
- case 4:
- case "TYPE_ISSUE_STATUS_UPDATE":
- return Activity_Type.TYPE_ISSUE_STATUS_UPDATE;
- case 21:
- case "TYPE_ISSUE_APPROVAL_NOTIFY":
- return Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY;
- case 5:
- case "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE":
- return Activity_Type.TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE;
- case 22:
- case "TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE":
- return Activity_Type.TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Activity_Type.UNRECOGNIZED;
- }
-}
-
-export function activity_TypeToJSON(object: Activity_Type): string {
- switch (object) {
- case Activity_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Activity_Type.TYPE_NOTIFY_ISSUE_APPROVED:
- return "TYPE_NOTIFY_ISSUE_APPROVED";
- case Activity_Type.TYPE_NOTIFY_PIPELINE_ROLLOUT:
- return "TYPE_NOTIFY_PIPELINE_ROLLOUT";
- case Activity_Type.TYPE_ISSUE_CREATE:
- return "TYPE_ISSUE_CREATE";
- case Activity_Type.TYPE_ISSUE_COMMENT_CREATE:
- return "TYPE_ISSUE_COMMENT_CREATE";
- case Activity_Type.TYPE_ISSUE_FIELD_UPDATE:
- return "TYPE_ISSUE_FIELD_UPDATE";
- case Activity_Type.TYPE_ISSUE_STATUS_UPDATE:
- return "TYPE_ISSUE_STATUS_UPDATE";
- case Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY:
- return "TYPE_ISSUE_APPROVAL_NOTIFY";
- case Activity_Type.TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE:
- return "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE";
- case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE:
- return "TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE";
- case Activity_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_RUN_STATUS_UPDATE:
- return 22;
- case Activity_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseGetProjectRequest(): GetProjectRequest {
- return { name: "" };
-}
-
-export const GetProjectRequest: MessageFns<GetProjectRequest> = {
- encode(message: GetProjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetProjectRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetProjectRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetProjectRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetProjectRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetProjectRequest>): GetProjectRequest {
- return GetProjectRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetProjectRequest>): GetProjectRequest {
- const message = createBaseGetProjectRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListProjectsRequest(): ListProjectsRequest {
- return { pageSize: 0, pageToken: "", showDeleted: false, filter: "" };
-}
-
-export const ListProjectsRequest: MessageFns<ListProjectsRequest> = {
- encode(message: ListProjectsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(24).bool(message.showDeleted);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListProjectsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListProjectsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListProjectsRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListProjectsRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListProjectsRequest>): ListProjectsRequest {
- return ListProjectsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListProjectsRequest>): ListProjectsRequest {
- const message = createBaseListProjectsRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListProjectsResponse(): ListProjectsResponse {
- return { projects: [], nextPageToken: "" };
-}
-
-export const ListProjectsResponse: MessageFns<ListProjectsResponse> = {
- encode(message: ListProjectsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.projects) {
- Project.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListProjectsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListProjectsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.projects.push(Project.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListProjectsResponse {
- return {
- projects: globalThis.Array.isArray(object?.projects) ? object.projects.map((e: any) => Project.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListProjectsResponse): unknown {
- const obj: any = {};
- if (message.projects?.length) {
- obj.projects = message.projects.map((e) => Project.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListProjectsResponse>): ListProjectsResponse {
- return ListProjectsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListProjectsResponse>): ListProjectsResponse {
- const message = createBaseListProjectsResponse();
- message.projects = object.projects?.map((e) => Project.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchProjectsRequest(): SearchProjectsRequest {
- return { showDeleted: false, filter: "", pageSize: 0, pageToken: "" };
-}
-
-export const SearchProjectsRequest: MessageFns<SearchProjectsRequest> = {
- encode(message: SearchProjectsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.showDeleted !== false) {
- writer.uint32(8).bool(message.showDeleted);
- }
- if (message.filter !== "") {
- writer.uint32(18).string(message.filter);
- }
- if (message.pageSize !== 0) {
- writer.uint32(24).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(34).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchProjectsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchProjectsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchProjectsRequest {
- return {
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: SearchProjectsRequest): unknown {
- const obj: any = {};
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchProjectsRequest>): SearchProjectsRequest {
- return SearchProjectsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchProjectsRequest>): SearchProjectsRequest {
- const message = createBaseSearchProjectsRequest();
- message.showDeleted = object.showDeleted ?? false;
- message.filter = object.filter ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchProjectsResponse(): SearchProjectsResponse {
- return { projects: [], nextPageToken: "" };
-}
-
-export const SearchProjectsResponse: MessageFns<SearchProjectsResponse> = {
- encode(message: SearchProjectsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.projects) {
- Project.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchProjectsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchProjectsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.projects.push(Project.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchProjectsResponse {
- return {
- projects: globalThis.Array.isArray(object?.projects) ? object.projects.map((e: any) => Project.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchProjectsResponse): unknown {
- const obj: any = {};
- if (message.projects?.length) {
- obj.projects = message.projects.map((e) => Project.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchProjectsResponse>): SearchProjectsResponse {
- return SearchProjectsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchProjectsResponse>): SearchProjectsResponse {
- const message = createBaseSearchProjectsResponse();
- message.projects = object.projects?.map((e) => Project.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateProjectRequest(): CreateProjectRequest {
- return { project: undefined, projectId: "" };
-}
-
-export const CreateProjectRequest: MessageFns<CreateProjectRequest> = {
- encode(message: CreateProjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== undefined) {
- Project.encode(message.project, writer.uint32(10).fork()).join();
- }
- if (message.projectId !== "") {
- writer.uint32(18).string(message.projectId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateProjectRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateProjectRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = Project.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.projectId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateProjectRequest {
- return {
- project: isSet(object.project) ? Project.fromJSON(object.project) : undefined,
- projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
- };
- },
-
- toJSON(message: CreateProjectRequest): unknown {
- const obj: any = {};
- if (message.project !== undefined) {
- obj.project = Project.toJSON(message.project);
- }
- if (message.projectId !== "") {
- obj.projectId = message.projectId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateProjectRequest>): CreateProjectRequest {
- return CreateProjectRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateProjectRequest>): CreateProjectRequest {
- const message = createBaseCreateProjectRequest();
- message.project = (object.project !== undefined && object.project !== null)
- ? Project.fromPartial(object.project)
- : undefined;
- message.projectId = object.projectId ?? "";
- return message;
- },
-};
-
-function createBaseUpdateProjectRequest(): UpdateProjectRequest {
- return { project: undefined, updateMask: undefined };
-}
-
-export const UpdateProjectRequest: MessageFns<UpdateProjectRequest> = {
- encode(message: UpdateProjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== undefined) {
- Project.encode(message.project, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateProjectRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateProjectRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = Project.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateProjectRequest {
- return {
- project: isSet(object.project) ? Project.fromJSON(object.project) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateProjectRequest): unknown {
- const obj: any = {};
- if (message.project !== undefined) {
- obj.project = Project.toJSON(message.project);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateProjectRequest>): UpdateProjectRequest {
- return UpdateProjectRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateProjectRequest>): UpdateProjectRequest {
- const message = createBaseUpdateProjectRequest();
- message.project = (object.project !== undefined && object.project !== null)
- ? Project.fromPartial(object.project)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteProjectRequest(): DeleteProjectRequest {
- return { name: "", force: false };
-}
-
-export const DeleteProjectRequest: MessageFns<DeleteProjectRequest> = {
- encode(message: DeleteProjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.force !== false) {
- writer.uint32(16).bool(message.force);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteProjectRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteProjectRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.force = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteProjectRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
- };
- },
-
- toJSON(message: DeleteProjectRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.force !== false) {
- obj.force = message.force;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteProjectRequest>): DeleteProjectRequest {
- return DeleteProjectRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteProjectRequest>): DeleteProjectRequest {
- const message = createBaseDeleteProjectRequest();
- message.name = object.name ?? "";
- message.force = object.force ?? false;
- return message;
- },
-};
-
-function createBaseUndeleteProjectRequest(): UndeleteProjectRequest {
- return { name: "" };
-}
-
-export const UndeleteProjectRequest: MessageFns<UndeleteProjectRequest> = {
- encode(message: UndeleteProjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UndeleteProjectRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUndeleteProjectRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UndeleteProjectRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: UndeleteProjectRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UndeleteProjectRequest>): UndeleteProjectRequest {
- return UndeleteProjectRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UndeleteProjectRequest>): UndeleteProjectRequest {
- const message = createBaseUndeleteProjectRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseBatchDeleteProjectsRequest(): BatchDeleteProjectsRequest {
- return { names: [], force: false };
-}
-
-export const BatchDeleteProjectsRequest: MessageFns<BatchDeleteProjectsRequest> = {
- encode(message: BatchDeleteProjectsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.names) {
- writer.uint32(10).string(v!);
- }
- if (message.force !== false) {
- writer.uint32(16).bool(message.force);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchDeleteProjectsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchDeleteProjectsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.names.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.force = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchDeleteProjectsRequest {
- return {
- names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
- force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
- };
- },
-
- toJSON(message: BatchDeleteProjectsRequest): unknown {
- const obj: any = {};
- if (message.names?.length) {
- obj.names = message.names;
- }
- if (message.force !== false) {
- obj.force = message.force;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchDeleteProjectsRequest>): BatchDeleteProjectsRequest {
- return BatchDeleteProjectsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchDeleteProjectsRequest>): BatchDeleteProjectsRequest {
- const message = createBaseBatchDeleteProjectsRequest();
- message.names = object.names?.map((e) => e) || [];
- message.force = object.force ?? false;
- return message;
- },
-};
-
-function createBaseBatchGetIamPolicyRequest(): BatchGetIamPolicyRequest {
- return { scope: "", names: [] };
-}
-
-export const BatchGetIamPolicyRequest: MessageFns<BatchGetIamPolicyRequest> = {
- encode(message: BatchGetIamPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.scope !== "") {
- writer.uint32(10).string(message.scope);
- }
- for (const v of message.names) {
- writer.uint32(18).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetIamPolicyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetIamPolicyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.scope = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.names.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetIamPolicyRequest {
- return {
- scope: isSet(object.scope) ? globalThis.String(object.scope) : "",
- names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: BatchGetIamPolicyRequest): unknown {
- const obj: any = {};
- if (message.scope !== "") {
- obj.scope = message.scope;
- }
- if (message.names?.length) {
- obj.names = message.names;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetIamPolicyRequest>): BatchGetIamPolicyRequest {
- return BatchGetIamPolicyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetIamPolicyRequest>): BatchGetIamPolicyRequest {
- const message = createBaseBatchGetIamPolicyRequest();
- message.scope = object.scope ?? "";
- message.names = object.names?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchGetIamPolicyResponse(): BatchGetIamPolicyResponse {
- return { policyResults: [] };
-}
-
-export const BatchGetIamPolicyResponse: MessageFns<BatchGetIamPolicyResponse> = {
- encode(message: BatchGetIamPolicyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.policyResults) {
- BatchGetIamPolicyResponse_PolicyResult.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetIamPolicyResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetIamPolicyResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.policyResults.push(BatchGetIamPolicyResponse_PolicyResult.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetIamPolicyResponse {
- return {
- policyResults: globalThis.Array.isArray(object?.policyResults)
- ? object.policyResults.map((e: any) => BatchGetIamPolicyResponse_PolicyResult.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchGetIamPolicyResponse): unknown {
- const obj: any = {};
- if (message.policyResults?.length) {
- obj.policyResults = message.policyResults.map((e) => BatchGetIamPolicyResponse_PolicyResult.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetIamPolicyResponse>): BatchGetIamPolicyResponse {
- return BatchGetIamPolicyResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetIamPolicyResponse>): BatchGetIamPolicyResponse {
- const message = createBaseBatchGetIamPolicyResponse();
- message.policyResults = object.policyResults?.map((e) => BatchGetIamPolicyResponse_PolicyResult.fromPartial(e)) ||
- [];
- return message;
- },
-};
-
-function createBaseBatchGetIamPolicyResponse_PolicyResult(): BatchGetIamPolicyResponse_PolicyResult {
- return { project: "", policy: undefined };
-}
-
-export const BatchGetIamPolicyResponse_PolicyResult: MessageFns<BatchGetIamPolicyResponse_PolicyResult> = {
- encode(message: BatchGetIamPolicyResponse_PolicyResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== "") {
- writer.uint32(10).string(message.project);
- }
- if (message.policy !== undefined) {
- IamPolicy.encode(message.policy, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetIamPolicyResponse_PolicyResult {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetIamPolicyResponse_PolicyResult();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.policy = IamPolicy.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetIamPolicyResponse_PolicyResult {
- return {
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- policy: isSet(object.policy) ? IamPolicy.fromJSON(object.policy) : undefined,
- };
- },
-
- toJSON(message: BatchGetIamPolicyResponse_PolicyResult): unknown {
- const obj: any = {};
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.policy !== undefined) {
- obj.policy = IamPolicy.toJSON(message.policy);
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetIamPolicyResponse_PolicyResult>): BatchGetIamPolicyResponse_PolicyResult {
- return BatchGetIamPolicyResponse_PolicyResult.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetIamPolicyResponse_PolicyResult>): BatchGetIamPolicyResponse_PolicyResult {
- const message = createBaseBatchGetIamPolicyResponse_PolicyResult();
- message.project = object.project ?? "";
- message.policy = (object.policy !== undefined && object.policy !== null)
- ? IamPolicy.fromPartial(object.policy)
- : undefined;
- return message;
- },
-};
-
-function createBaseLabel(): Label {
- return { value: "", color: "", group: "" };
-}
-
-export const Label: MessageFns<Label> = {
- encode(message: Label, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.value !== "") {
- writer.uint32(10).string(message.value);
- }
- if (message.color !== "") {
- writer.uint32(18).string(message.color);
- }
- if (message.group !== "") {
- writer.uint32(26).string(message.group);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Label {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseLabel();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.color = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.group = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Label {
- return {
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- color: isSet(object.color) ? globalThis.String(object.color) : "",
- group: isSet(object.group) ? globalThis.String(object.group) : "",
- };
- },
-
- toJSON(message: Label): unknown {
- const obj: any = {};
- if (message.value !== "") {
- obj.value = message.value;
- }
- if (message.color !== "") {
- obj.color = message.color;
- }
- if (message.group !== "") {
- obj.group = message.group;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Label>): Label {
- return Label.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Label>): Label {
- const message = createBaseLabel();
- message.value = object.value ?? "";
- message.color = object.color ?? "";
- message.group = object.group ?? "";
- return message;
- },
-};
-
-function createBaseProject(): Project {
- return {
- name: "",
- state: State.STATE_UNSPECIFIED,
- title: "",
- webhooks: [],
- dataClassificationConfigId: "",
- issueLabels: [],
- forceIssueLabels: false,
- allowModifyStatement: false,
- autoResolveIssue: false,
- enforceIssueTitle: false,
- autoEnableBackup: false,
- skipBackupErrors: false,
- postgresDatabaseTenantMode: false,
- allowSelfApproval: false,
- executionRetryPolicy: undefined,
- ciSamplingSize: 0,
- parallelTasksPerRollout: 0,
- };
-}
-
-export const Project: MessageFns<Project> = {
- encode(message: Project, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- writer.uint32(24).int32(stateToNumber(message.state));
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- for (const v of message.webhooks) {
- Webhook.encode(v!, writer.uint32(90).fork()).join();
- }
- if (message.dataClassificationConfigId !== "") {
- writer.uint32(98).string(message.dataClassificationConfigId);
- }
- for (const v of message.issueLabels) {
- Label.encode(v!, writer.uint32(106).fork()).join();
- }
- if (message.forceIssueLabels !== false) {
- writer.uint32(112).bool(message.forceIssueLabels);
- }
- if (message.allowModifyStatement !== false) {
- writer.uint32(120).bool(message.allowModifyStatement);
- }
- if (message.autoResolveIssue !== false) {
- writer.uint32(128).bool(message.autoResolveIssue);
- }
- if (message.enforceIssueTitle !== false) {
- writer.uint32(136).bool(message.enforceIssueTitle);
- }
- if (message.autoEnableBackup !== false) {
- writer.uint32(144).bool(message.autoEnableBackup);
- }
- if (message.skipBackupErrors !== false) {
- writer.uint32(152).bool(message.skipBackupErrors);
- }
- if (message.postgresDatabaseTenantMode !== false) {
- writer.uint32(160).bool(message.postgresDatabaseTenantMode);
- }
- if (message.allowSelfApproval !== false) {
- writer.uint32(168).bool(message.allowSelfApproval);
- }
- if (message.executionRetryPolicy !== undefined) {
- Project_ExecutionRetryPolicy.encode(message.executionRetryPolicy, writer.uint32(178).fork()).join();
- }
- if (message.ciSamplingSize !== 0) {
- writer.uint32(184).int32(message.ciSamplingSize);
- }
- if (message.parallelTasksPerRollout !== 0) {
- writer.uint32(192).int32(message.parallelTasksPerRollout);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Project {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseProject();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.webhooks.push(Webhook.decode(reader, reader.uint32()));
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.dataClassificationConfigId = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.issueLabels.push(Label.decode(reader, reader.uint32()));
- continue;
- }
- case 14: {
- if (tag !== 112) {
- break;
- }
-
- message.forceIssueLabels = reader.bool();
- continue;
- }
- case 15: {
- if (tag !== 120) {
- break;
- }
-
- message.allowModifyStatement = reader.bool();
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
-
- message.autoResolveIssue = reader.bool();
- continue;
- }
- case 17: {
- if (tag !== 136) {
- break;
- }
-
- message.enforceIssueTitle = reader.bool();
- continue;
- }
- case 18: {
- if (tag !== 144) {
- break;
- }
-
- message.autoEnableBackup = reader.bool();
- continue;
- }
- case 19: {
- if (tag !== 152) {
- break;
- }
-
- message.skipBackupErrors = reader.bool();
- continue;
- }
- case 20: {
- if (tag !== 160) {
- break;
- }
-
- message.postgresDatabaseTenantMode = reader.bool();
- continue;
- }
- case 21: {
- if (tag !== 168) {
- break;
- }
-
- message.allowSelfApproval = reader.bool();
- continue;
- }
- case 22: {
- if (tag !== 178) {
- break;
- }
-
- message.executionRetryPolicy = Project_ExecutionRetryPolicy.decode(reader, reader.uint32());
- continue;
- }
- case 23: {
- if (tag !== 184) {
- break;
- }
-
- message.ciSamplingSize = reader.int32();
- continue;
- }
- case 24: {
- if (tag !== 192) {
- break;
- }
-
- message.parallelTasksPerRollout = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Project {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- webhooks: globalThis.Array.isArray(object?.webhooks) ? object.webhooks.map((e: any) => Webhook.fromJSON(e)) : [],
- dataClassificationConfigId: isSet(object.dataClassificationConfigId)
- ? globalThis.String(object.dataClassificationConfigId)
- : "",
- issueLabels: globalThis.Array.isArray(object?.issueLabels)
- ? object.issueLabels.map((e: any) => Label.fromJSON(e))
- : [],
- forceIssueLabels: isSet(object.forceIssueLabels) ? globalThis.Boolean(object.forceIssueLabels) : false,
- allowModifyStatement: isSet(object.allowModifyStatement)
- ? globalThis.Boolean(object.allowModifyStatement)
- : false,
- autoResolveIssue: isSet(object.autoResolveIssue) ? globalThis.Boolean(object.autoResolveIssue) : false,
- enforceIssueTitle: isSet(object.enforceIssueTitle) ? globalThis.Boolean(object.enforceIssueTitle) : false,
- autoEnableBackup: isSet(object.autoEnableBackup) ? globalThis.Boolean(object.autoEnableBackup) : false,
- skipBackupErrors: isSet(object.skipBackupErrors) ? globalThis.Boolean(object.skipBackupErrors) : false,
- postgresDatabaseTenantMode: isSet(object.postgresDatabaseTenantMode)
- ? globalThis.Boolean(object.postgresDatabaseTenantMode)
- : false,
- allowSelfApproval: isSet(object.allowSelfApproval) ? globalThis.Boolean(object.allowSelfApproval) : false,
- executionRetryPolicy: isSet(object.executionRetryPolicy)
- ? Project_ExecutionRetryPolicy.fromJSON(object.executionRetryPolicy)
- : undefined,
- ciSamplingSize: isSet(object.ciSamplingSize) ? globalThis.Number(object.ciSamplingSize) : 0,
- parallelTasksPerRollout: isSet(object.parallelTasksPerRollout)
- ? globalThis.Number(object.parallelTasksPerRollout)
- : 0,
- };
- },
-
- toJSON(message: Project): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.webhooks?.length) {
- obj.webhooks = message.webhooks.map((e) => Webhook.toJSON(e));
- }
- if (message.dataClassificationConfigId !== "") {
- obj.dataClassificationConfigId = message.dataClassificationConfigId;
- }
- if (message.issueLabels?.length) {
- obj.issueLabels = message.issueLabels.map((e) => Label.toJSON(e));
- }
- if (message.forceIssueLabels !== false) {
- obj.forceIssueLabels = message.forceIssueLabels;
- }
- if (message.allowModifyStatement !== false) {
- obj.allowModifyStatement = message.allowModifyStatement;
- }
- if (message.autoResolveIssue !== false) {
- obj.autoResolveIssue = message.autoResolveIssue;
- }
- if (message.enforceIssueTitle !== false) {
- obj.enforceIssueTitle = message.enforceIssueTitle;
- }
- if (message.autoEnableBackup !== false) {
- obj.autoEnableBackup = message.autoEnableBackup;
- }
- if (message.skipBackupErrors !== false) {
- obj.skipBackupErrors = message.skipBackupErrors;
- }
- if (message.postgresDatabaseTenantMode !== false) {
- obj.postgresDatabaseTenantMode = message.postgresDatabaseTenantMode;
- }
- if (message.allowSelfApproval !== false) {
- obj.allowSelfApproval = message.allowSelfApproval;
- }
- if (message.executionRetryPolicy !== undefined) {
- obj.executionRetryPolicy = Project_ExecutionRetryPolicy.toJSON(message.executionRetryPolicy);
- }
- if (message.ciSamplingSize !== 0) {
- obj.ciSamplingSize = Math.round(message.ciSamplingSize);
- }
- if (message.parallelTasksPerRollout !== 0) {
- obj.parallelTasksPerRollout = Math.round(message.parallelTasksPerRollout);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Project>): Project {
- return Project.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Project>): Project {
- const message = createBaseProject();
- message.name = object.name ?? "";
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- message.title = object.title ?? "";
- message.webhooks = object.webhooks?.map((e) => Webhook.fromPartial(e)) || [];
- message.dataClassificationConfigId = object.dataClassificationConfigId ?? "";
- message.issueLabels = object.issueLabels?.map((e) => Label.fromPartial(e)) || [];
- message.forceIssueLabels = object.forceIssueLabels ?? false;
- message.allowModifyStatement = object.allowModifyStatement ?? false;
- message.autoResolveIssue = object.autoResolveIssue ?? false;
- message.enforceIssueTitle = object.enforceIssueTitle ?? false;
- message.autoEnableBackup = object.autoEnableBackup ?? false;
- message.skipBackupErrors = object.skipBackupErrors ?? false;
- message.postgresDatabaseTenantMode = object.postgresDatabaseTenantMode ?? false;
- message.allowSelfApproval = object.allowSelfApproval ?? false;
- message.executionRetryPolicy = (object.executionRetryPolicy !== undefined && object.executionRetryPolicy !== null)
- ? Project_ExecutionRetryPolicy.fromPartial(object.executionRetryPolicy)
- : undefined;
- message.ciSamplingSize = object.ciSamplingSize ?? 0;
- message.parallelTasksPerRollout = object.parallelTasksPerRollout ?? 0;
- return message;
- },
-};
-
-function createBaseProject_ExecutionRetryPolicy(): Project_ExecutionRetryPolicy {
- return { maximumRetries: 0 };
-}
-
-export const Project_ExecutionRetryPolicy: MessageFns<Project_ExecutionRetryPolicy> = {
- encode(message: Project_ExecutionRetryPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.maximumRetries !== 0) {
- writer.uint32(8).int32(message.maximumRetries);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Project_ExecutionRetryPolicy {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseProject_ExecutionRetryPolicy();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.maximumRetries = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Project_ExecutionRetryPolicy {
- return { maximumRetries: isSet(object.maximumRetries) ? globalThis.Number(object.maximumRetries) : 0 };
- },
-
- toJSON(message: Project_ExecutionRetryPolicy): unknown {
- const obj: any = {};
- if (message.maximumRetries !== 0) {
- obj.maximumRetries = Math.round(message.maximumRetries);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Project_ExecutionRetryPolicy>): Project_ExecutionRetryPolicy {
- return Project_ExecutionRetryPolicy.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Project_ExecutionRetryPolicy>): Project_ExecutionRetryPolicy {
- const message = createBaseProject_ExecutionRetryPolicy();
- message.maximumRetries = object.maximumRetries ?? 0;
- return message;
- },
-};
-
-function createBaseAddWebhookRequest(): AddWebhookRequest {
- return { project: "", webhook: undefined };
-}
-
-export const AddWebhookRequest: MessageFns<AddWebhookRequest> = {
- encode(message: AddWebhookRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== "") {
- writer.uint32(10).string(message.project);
- }
- if (message.webhook !== undefined) {
- Webhook.encode(message.webhook, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AddWebhookRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAddWebhookRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.webhook = Webhook.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AddWebhookRequest {
- return {
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
- };
- },
-
- toJSON(message: AddWebhookRequest): unknown {
- const obj: any = {};
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.webhook !== undefined) {
- obj.webhook = Webhook.toJSON(message.webhook);
- }
- return obj;
- },
-
- create(base?: DeepPartial<AddWebhookRequest>): AddWebhookRequest {
- return AddWebhookRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AddWebhookRequest>): AddWebhookRequest {
- const message = createBaseAddWebhookRequest();
- message.project = object.project ?? "";
- message.webhook = (object.webhook !== undefined && object.webhook !== null)
- ? Webhook.fromPartial(object.webhook)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateWebhookRequest(): UpdateWebhookRequest {
- return { webhook: undefined, updateMask: undefined };
-}
-
-export const UpdateWebhookRequest: MessageFns<UpdateWebhookRequest> = {
- encode(message: UpdateWebhookRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.webhook !== undefined) {
- Webhook.encode(message.webhook, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateWebhookRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateWebhookRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.webhook = Webhook.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateWebhookRequest {
- return {
- webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateWebhookRequest): unknown {
- const obj: any = {};
- if (message.webhook !== undefined) {
- obj.webhook = Webhook.toJSON(message.webhook);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateWebhookRequest>): UpdateWebhookRequest {
- return UpdateWebhookRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateWebhookRequest>): UpdateWebhookRequest {
- const message = createBaseUpdateWebhookRequest();
- message.webhook = (object.webhook !== undefined && object.webhook !== null)
- ? Webhook.fromPartial(object.webhook)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseRemoveWebhookRequest(): RemoveWebhookRequest {
- return { webhook: undefined };
-}
-
-export const RemoveWebhookRequest: MessageFns<RemoveWebhookRequest> = {
- encode(message: RemoveWebhookRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.webhook !== undefined) {
- Webhook.encode(message.webhook, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RemoveWebhookRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRemoveWebhookRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.webhook = Webhook.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RemoveWebhookRequest {
- return { webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined };
- },
-
- toJSON(message: RemoveWebhookRequest): unknown {
- const obj: any = {};
- if (message.webhook !== undefined) {
- obj.webhook = Webhook.toJSON(message.webhook);
- }
- return obj;
- },
-
- create(base?: DeepPartial<RemoveWebhookRequest>): RemoveWebhookRequest {
- return RemoveWebhookRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RemoveWebhookRequest>): RemoveWebhookRequest {
- const message = createBaseRemoveWebhookRequest();
- message.webhook = (object.webhook !== undefined && object.webhook !== null)
- ? Webhook.fromPartial(object.webhook)
- : undefined;
- return message;
- },
-};
-
-function createBaseTestWebhookRequest(): TestWebhookRequest {
- return { project: "", webhook: undefined };
-}
-
-export const TestWebhookRequest: MessageFns<TestWebhookRequest> = {
- encode(message: TestWebhookRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== "") {
- writer.uint32(10).string(message.project);
- }
- if (message.webhook !== undefined) {
- Webhook.encode(message.webhook, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestWebhookRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestWebhookRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.webhook = Webhook.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestWebhookRequest {
- return {
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
- };
- },
-
- toJSON(message: TestWebhookRequest): unknown {
- const obj: any = {};
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.webhook !== undefined) {
- obj.webhook = Webhook.toJSON(message.webhook);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestWebhookRequest>): TestWebhookRequest {
- return TestWebhookRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TestWebhookRequest>): TestWebhookRequest {
- const message = createBaseTestWebhookRequest();
- message.project = object.project ?? "";
- message.webhook = (object.webhook !== undefined && object.webhook !== null)
- ? Webhook.fromPartial(object.webhook)
- : undefined;
- return message;
- },
-};
-
-function createBaseTestWebhookResponse(): TestWebhookResponse {
- return { error: "" };
-}
-
-export const TestWebhookResponse: MessageFns<TestWebhookResponse> = {
- encode(message: TestWebhookResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.error !== "") {
- writer.uint32(10).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TestWebhookResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTestWebhookResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TestWebhookResponse {
- return { error: isSet(object.error) ? globalThis.String(object.error) : "" };
- },
-
- toJSON(message: TestWebhookResponse): unknown {
- const obj: any = {};
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TestWebhookResponse>): TestWebhookResponse {
- return TestWebhookResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TestWebhookResponse>): TestWebhookResponse {
- const message = createBaseTestWebhookResponse();
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseWebhook(): Webhook {
- return {
- name: "",
- type: Webhook_Type.TYPE_UNSPECIFIED,
- title: "",
- url: "",
- directMessage: false,
- notificationTypes: [],
- };
-}
-
-export const Webhook: MessageFns<Webhook> = {
- encode(message: Webhook, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.type !== Webhook_Type.TYPE_UNSPECIFIED) {
- writer.uint32(16).int32(webhook_TypeToNumber(message.type));
- }
- if (message.title !== "") {
- writer.uint32(26).string(message.title);
- }
- if (message.url !== "") {
- writer.uint32(34).string(message.url);
- }
- if (message.directMessage !== false) {
- writer.uint32(48).bool(message.directMessage);
- }
- writer.uint32(42).fork();
- for (const v of message.notificationTypes) {
- writer.int32(activity_TypeToNumber(v));
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Webhook {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWebhook();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.type = webhook_TypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.url = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.directMessage = reader.bool();
- continue;
- }
- case 5: {
- if (tag === 40) {
- message.notificationTypes.push(activity_TypeFromJSON(reader.int32()));
-
- continue;
- }
-
- if (tag === 42) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.notificationTypes.push(activity_TypeFromJSON(reader.int32()));
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Webhook {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type) ? webhook_TypeFromJSON(object.type) : Webhook_Type.TYPE_UNSPECIFIED,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- url: isSet(object.url) ? globalThis.String(object.url) : "",
- directMessage: isSet(object.directMessage) ? globalThis.Boolean(object.directMessage) : false,
- notificationTypes: globalThis.Array.isArray(object?.notificationTypes)
- ? object.notificationTypes.map((e: any) => activity_TypeFromJSON(e))
- : [],
- };
- },
-
- toJSON(message: Webhook): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.type !== Webhook_Type.TYPE_UNSPECIFIED) {
- obj.type = webhook_TypeToJSON(message.type);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.url !== "") {
- obj.url = message.url;
- }
- if (message.directMessage !== false) {
- obj.directMessage = message.directMessage;
- }
- if (message.notificationTypes?.length) {
- obj.notificationTypes = message.notificationTypes.map((e) => activity_TypeToJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Webhook>): Webhook {
- return Webhook.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Webhook>): Webhook {
- const message = createBaseWebhook();
- message.name = object.name ?? "";
- message.type = object.type ?? Webhook_Type.TYPE_UNSPECIFIED;
- message.title = object.title ?? "";
- message.url = object.url ?? "";
- message.directMessage = object.directMessage ?? false;
- message.notificationTypes = object.notificationTypes?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseActivity(): Activity {
- return {};
-}
-
-export const Activity: MessageFns<Activity> = {
- encode(_: Activity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Activity {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseActivity();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): Activity {
- return {};
- },
-
- toJSON(_: Activity): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<Activity>): Activity {
- return Activity.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<Activity>): Activity {
- const message = createBaseActivity();
- return message;
- },
-};
-
-export type ProjectServiceDefinition = typeof ProjectServiceDefinition;
-export const ProjectServiceDefinition = {
- name: "ProjectService",
- fullName: "bytebase.v1.ProjectService",
- methods: {
- /**
- * GetProject retrieves a project by name.
- * Users with "bb.projects.get" permission on the workspace or the project owner can access this method.
- * Permissions required: bb.projects.get
- */
- getProject: {
- name: "GetProject",
- requestType: GetProjectRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 23,
- 18,
- 21,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.list */
- listProjects: {
- name: "ListProjects",
- requestType: ListProjectsRequest,
- requestStream: false,
- responseType: ListProjectsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([16, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([14, 18, 12, 47, 118, 49, 47, 112, 114, 111, 106, 101, 99, 116, 115])],
- },
- },
- },
- /** Permissions required: None */
- searchProjects: {
- name: "SearchProjects",
- requestType: SearchProjectsRequest,
- requestStream: false,
- responseType: SearchProjectsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 24,
- 58,
- 1,
- 42,
- 34,
- 19,
- 47,
- 118,
- 49,
- 47,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.create */
- createProject: {
- name: "CreateProject",
- requestType: CreateProjectRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 23,
- 58,
- 7,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 34,
- 12,
- 47,
- 118,
- 49,
- 47,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- updateProject: {
- name: "UpdateProject",
- requestType: UpdateProjectRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 19,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 58,
- 7,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 50,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.delete */
- deleteProject: {
- name: "DeleteProject",
- requestType: DeleteProjectRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 100, 101, 108, 101, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 23,
- 42,
- 21,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.undelete */
- undeleteProject: {
- name: "UndeleteProject",
- requestType: UndeleteProjectRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 46,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 35,
- 58,
- 1,
- 42,
- 34,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.delete */
- batchDeleteProjects: {
- name: "BatchDeleteProjects",
- requestType: BatchDeleteProjectsRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 100, 101, 108, 101, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 29,
- 58,
- 1,
- 42,
- 34,
- 24,
- 47,
- 118,
- 49,
- 47,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 68,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.getIamPolicy */
- getIamPolicy: {
- name: "GetIamPolicy",
- requestType: GetIamPolicyRequest,
- requestStream: false,
- responseType: IamPolicy,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 24,
- 98,
- 98,
- 46,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 46,
- 103,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 18,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 115,
- 111,
- 117,
- 114,
- 99,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 103,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- },
- },
- },
- /**
- * Deprecated.
- * Permissions required: bb.projects.getIamPolicy
- */
- batchGetIamPolicy: {
- name: "BatchGetIamPolicy",
- requestType: BatchGetIamPolicyRequest,
- requestStream: false,
- responseType: BatchGetIamPolicyResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 24,
- 98,
- 98,
- 46,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 46,
- 103,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 38,
- 18,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 115,
- 99,
- 111,
- 112,
- 101,
- 61,
- 42,
- 47,
- 42,
- 125,
- 47,
- 105,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 105,
- 101,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 71,
- 101,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.setIamPolicy */
- setIamPolicy: {
- name: "SetIamPolicy",
- requestType: SetIamPolicyRequest,
- requestStream: false,
- responseType: IamPolicy,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 24,
- 98,
- 98,
- 46,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 46,
- 115,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 1,
- 42,
- 34,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 115,
- 111,
- 117,
- 114,
- 99,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 115,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- addWebhook: {
- name: "AddWebhook",
- requestType: AddWebhookRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 58,
- 1,
- 42,
- 34,
- 35,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 97,
- 100,
- 100,
- 87,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- updateWebhook: {
- name: "UpdateWebhook",
- requestType: UpdateWebhookRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 19,
- 119,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 59,
- 58,
- 1,
- 42,
- 34,
- 54,
- 47,
- 118,
- 49,
- 47,
- 123,
- 119,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 119,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 87,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- removeWebhook: {
- name: "RemoveWebhook",
- requestType: RemoveWebhookRequest,
- requestStream: false,
- responseType: Project,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 59,
- 58,
- 1,
- 42,
- 34,
- 54,
- 47,
- 118,
- 49,
- 47,
- 123,
- 119,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 119,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- 115,
- 47,
- 42,
- 125,
- 58,
- 114,
- 101,
- 109,
- 111,
- 118,
- 101,
- 87,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.projects.update */
- testWebhook: {
- name: "TestWebhook",
- requestType: TestWebhookRequest,
- requestStream: false,
- responseType: TestWebhookResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 112, 114, 111, 106, 101, 99, 116, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 41,
- 58,
- 1,
- 42,
- 34,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 116,
- 101,
- 115,
- 116,
- 87,
- 101,
- 98,
- 104,
- 111,
- 111,
- 107,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/release_service.ts b/frontend/src/types/proto/v1/release_service.ts
deleted file mode 100644
index da28049bca..0000000000
--- a/frontend/src/types/proto/v1/release_service.ts
+++ /dev/null
@@ -1,2172 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/release_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import {
- State,
- stateFromJSON,
- stateToJSON,
- stateToNumber,
- VCSType,
- vCSTypeFromJSON,
- vCSTypeToJSON,
- vCSTypeToNumber,
-} from "./common";
-import { Advice } from "./sql_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum ReleaseFileType {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- VERSIONED = "VERSIONED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function releaseFileTypeFromJSON(object: any): ReleaseFileType {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return ReleaseFileType.TYPE_UNSPECIFIED;
- case 1:
- case "VERSIONED":
- return ReleaseFileType.VERSIONED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ReleaseFileType.UNRECOGNIZED;
- }
-}
-
-export function releaseFileTypeToJSON(object: ReleaseFileType): string {
- switch (object) {
- case ReleaseFileType.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case ReleaseFileType.VERSIONED:
- return "VERSIONED";
- case ReleaseFileType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function releaseFileTypeToNumber(object: ReleaseFileType): number {
- switch (object) {
- case ReleaseFileType.TYPE_UNSPECIFIED:
- return 0;
- case ReleaseFileType.VERSIONED:
- return 1;
- case ReleaseFileType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GetReleaseRequest {
- /** Format: projects/{project}/releases/{release} */
- name: string;
-}
-
-export interface ListReleasesRequest {
- /** Format: projects/{project} */
- parent: string;
- /**
- * The maximum number of releases to return. The service may return fewer than this value.
- * If unspecified, at most 10 releases will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListReleases` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListReleases` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Show deleted releases if specified. */
- showDeleted: boolean;
-}
-
-export interface ListReleasesResponse {
- releases: Release[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateReleaseRequest {
- /** Format: projects/{project} */
- parent: string;
- /** The release to create. */
- release: Release | undefined;
-}
-
-export interface UpdateReleaseRequest {
- /** The release to update. */
- release:
- | Release
- | undefined;
- /** The list of fields to be updated. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteReleaseRequest {
- /**
- * The name of the release to delete.
- * Format: projects/{project}/releases/{release}
- */
- name: string;
-}
-
-export interface UndeleteReleaseRequest {
- /**
- * The name of the deleted release.
- * Format: projects/{project}/releases/{release}
- */
- name: string;
-}
-
-export interface CheckReleaseRequest {
- /** Format: projects/{project} */
- parent: string;
- /** The release to check. */
- release:
- | Release
- | undefined;
- /**
- * The targets to dry-run the release.
- * Can be database or databaseGroup.
- * Format:
- * projects/{project}/databaseGroups/{databaseGroup}
- * instances/{instance}/databases/{database}
- */
- targets: string[];
-}
-
-export interface CheckReleaseResponse {
- results: CheckReleaseResponse_CheckResult[];
- /** The affected rows of the check. */
- affectedRows: number;
- /** The aggregated risk level of the check. */
- riskLevel: CheckReleaseResponse_RiskLevel;
-}
-
-export enum CheckReleaseResponse_RiskLevel {
- RISK_LEVEL_UNSPECIFIED = "RISK_LEVEL_UNSPECIFIED",
- LOW = "LOW",
- MODERATE = "MODERATE",
- HIGH = "HIGH",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function checkReleaseResponse_RiskLevelFromJSON(object: any): CheckReleaseResponse_RiskLevel {
- switch (object) {
- case 0:
- case "RISK_LEVEL_UNSPECIFIED":
- return CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED;
- case 1:
- case "LOW":
- return CheckReleaseResponse_RiskLevel.LOW;
- case 2:
- case "MODERATE":
- return CheckReleaseResponse_RiskLevel.MODERATE;
- case 3:
- case "HIGH":
- return CheckReleaseResponse_RiskLevel.HIGH;
- case -1:
- case "UNRECOGNIZED":
- default:
- return CheckReleaseResponse_RiskLevel.UNRECOGNIZED;
- }
-}
-
-export function checkReleaseResponse_RiskLevelToJSON(object: CheckReleaseResponse_RiskLevel): string {
- switch (object) {
- case CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED:
- return "RISK_LEVEL_UNSPECIFIED";
- case CheckReleaseResponse_RiskLevel.LOW:
- return "LOW";
- case CheckReleaseResponse_RiskLevel.MODERATE:
- return "MODERATE";
- case CheckReleaseResponse_RiskLevel.HIGH:
- return "HIGH";
- case CheckReleaseResponse_RiskLevel.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function checkReleaseResponse_RiskLevelToNumber(object: CheckReleaseResponse_RiskLevel): number {
- switch (object) {
- case CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED:
- return 0;
- case CheckReleaseResponse_RiskLevel.LOW:
- return 1;
- case CheckReleaseResponse_RiskLevel.MODERATE:
- return 2;
- case CheckReleaseResponse_RiskLevel.HIGH:
- return 3;
- case CheckReleaseResponse_RiskLevel.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface CheckReleaseResponse_CheckResult {
- /** The file path that is being checked. */
- file: string;
- /**
- * The target that the check is performed on.
- * Should be a database. Format: instances/{instance}/databases/{database}
- */
- target: string;
- /** The list of advice for the file and the target. */
- advices: Advice[];
- /** The count of affected rows of the statement on the target. */
- affectedRows: number;
- /** The risk level of the statement on the target. */
- riskLevel: CheckReleaseResponse_RiskLevel;
-}
-
-export interface Release {
- /** Format: projects/{project}/releases/{release} */
- name: string;
- title: string;
- files: Release_File[];
- vcsSource:
- | Release_VCSSource
- | undefined;
- /** Format: users/[email protected] */
- creator: string;
- createTime: Timestamp | undefined;
- state: State;
-}
-
-export interface Release_File {
- /** The unique identifier for the file. */
- id: string;
- /** The path of the file. e.g. `2.2/V0001_create_table.sql`. */
- path: string;
- type: ReleaseFileType;
- version: string;
- changeType: Release_File_ChangeType;
- /**
- * For inputs, we must either use `sheet` or `statement`.
- * For outputs, we always use `sheet`. `statement` is the preview of the sheet content.
- *
- * The sheet that holds the content.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet: string;
- /** The raw SQL statement content. */
- statement: Uint8Array;
- /** The SHA256 hash value of the sheet content or the statement. */
- sheetSha256: string;
- /** The size of the statement in bytes. */
- statementSize: Long;
-}
-
-export enum Release_File_ChangeType {
- CHANGE_TYPE_UNSPECIFIED = "CHANGE_TYPE_UNSPECIFIED",
- DDL = "DDL",
- DDL_GHOST = "DDL_GHOST",
- DML = "DML",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function release_File_ChangeTypeFromJSON(object: any): Release_File_ChangeType {
- switch (object) {
- case 0:
- case "CHANGE_TYPE_UNSPECIFIED":
- return Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED;
- case 1:
- case "DDL":
- return Release_File_ChangeType.DDL;
- case 2:
- case "DDL_GHOST":
- return Release_File_ChangeType.DDL_GHOST;
- case 3:
- case "DML":
- return Release_File_ChangeType.DML;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Release_File_ChangeType.UNRECOGNIZED;
- }
-}
-
-export function release_File_ChangeTypeToJSON(object: Release_File_ChangeType): string {
- switch (object) {
- case Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED:
- return "CHANGE_TYPE_UNSPECIFIED";
- case Release_File_ChangeType.DDL:
- return "DDL";
- case Release_File_ChangeType.DDL_GHOST:
- return "DDL_GHOST";
- case Release_File_ChangeType.DML:
- return "DML";
- case Release_File_ChangeType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function release_File_ChangeTypeToNumber(object: Release_File_ChangeType): number {
- switch (object) {
- case Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED:
- return 0;
- case Release_File_ChangeType.DDL:
- return 1;
- case Release_File_ChangeType.DDL_GHOST:
- return 2;
- case Release_File_ChangeType.DML:
- return 3;
- case Release_File_ChangeType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface Release_VCSSource {
- vcsType: VCSType;
- /** The url link to the e.g. GitHub commit or pull request. */
- url: string;
-}
-
-function createBaseGetReleaseRequest(): GetReleaseRequest {
- return { name: "" };
-}
-
-export const GetReleaseRequest: MessageFns<GetReleaseRequest> = {
- encode(message: GetReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetReleaseRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetReleaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetReleaseRequest>): GetReleaseRequest {
- return GetReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetReleaseRequest>): GetReleaseRequest {
- const message = createBaseGetReleaseRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListReleasesRequest(): ListReleasesRequest {
- return { parent: "", pageSize: 0, pageToken: "", showDeleted: false };
-}
-
-export const ListReleasesRequest: MessageFns<ListReleasesRequest> = {
- encode(message: ListReleasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(32).bool(message.showDeleted);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListReleasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListReleasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListReleasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- };
- },
-
- toJSON(message: ListReleasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListReleasesRequest>): ListReleasesRequest {
- return ListReleasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListReleasesRequest>): ListReleasesRequest {
- const message = createBaseListReleasesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- return message;
- },
-};
-
-function createBaseListReleasesResponse(): ListReleasesResponse {
- return { releases: [], nextPageToken: "" };
-}
-
-export const ListReleasesResponse: MessageFns<ListReleasesResponse> = {
- encode(message: ListReleasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.releases) {
- Release.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListReleasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListReleasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.releases.push(Release.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListReleasesResponse {
- return {
- releases: globalThis.Array.isArray(object?.releases) ? object.releases.map((e: any) => Release.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListReleasesResponse): unknown {
- const obj: any = {};
- if (message.releases?.length) {
- obj.releases = message.releases.map((e) => Release.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListReleasesResponse>): ListReleasesResponse {
- return ListReleasesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListReleasesResponse>): ListReleasesResponse {
- const message = createBaseListReleasesResponse();
- message.releases = object.releases?.map((e) => Release.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateReleaseRequest(): CreateReleaseRequest {
- return { parent: "", release: undefined };
-}
-
-export const CreateReleaseRequest: MessageFns<CreateReleaseRequest> = {
- encode(message: CreateReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.release !== undefined) {
- Release.encode(message.release, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.release = Release.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateReleaseRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
- };
- },
-
- toJSON(message: CreateReleaseRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.release !== undefined) {
- obj.release = Release.toJSON(message.release);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateReleaseRequest>): CreateReleaseRequest {
- return CreateReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateReleaseRequest>): CreateReleaseRequest {
- const message = createBaseCreateReleaseRequest();
- message.parent = object.parent ?? "";
- message.release = (object.release !== undefined && object.release !== null)
- ? Release.fromPartial(object.release)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateReleaseRequest(): UpdateReleaseRequest {
- return { release: undefined, updateMask: undefined };
-}
-
-export const UpdateReleaseRequest: MessageFns<UpdateReleaseRequest> = {
- encode(message: UpdateReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.release !== undefined) {
- Release.encode(message.release, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.release = Release.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateReleaseRequest {
- return {
- release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateReleaseRequest): unknown {
- const obj: any = {};
- if (message.release !== undefined) {
- obj.release = Release.toJSON(message.release);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateReleaseRequest>): UpdateReleaseRequest {
- return UpdateReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateReleaseRequest>): UpdateReleaseRequest {
- const message = createBaseUpdateReleaseRequest();
- message.release = (object.release !== undefined && object.release !== null)
- ? Release.fromPartial(object.release)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteReleaseRequest(): DeleteReleaseRequest {
- return { name: "" };
-}
-
-export const DeleteReleaseRequest: MessageFns<DeleteReleaseRequest> = {
- encode(message: DeleteReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteReleaseRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteReleaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteReleaseRequest>): DeleteReleaseRequest {
- return DeleteReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteReleaseRequest>): DeleteReleaseRequest {
- const message = createBaseDeleteReleaseRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUndeleteReleaseRequest(): UndeleteReleaseRequest {
- return { name: "" };
-}
-
-export const UndeleteReleaseRequest: MessageFns<UndeleteReleaseRequest> = {
- encode(message: UndeleteReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UndeleteReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUndeleteReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UndeleteReleaseRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: UndeleteReleaseRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UndeleteReleaseRequest>): UndeleteReleaseRequest {
- return UndeleteReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UndeleteReleaseRequest>): UndeleteReleaseRequest {
- const message = createBaseUndeleteReleaseRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseCheckReleaseRequest(): CheckReleaseRequest {
- return { parent: "", release: undefined, targets: [] };
-}
-
-export const CheckReleaseRequest: MessageFns<CheckReleaseRequest> = {
- encode(message: CheckReleaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.release !== undefined) {
- Release.encode(message.release, writer.uint32(18).fork()).join();
- }
- for (const v of message.targets) {
- writer.uint32(26).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckReleaseRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckReleaseRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.release = Release.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.targets.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckReleaseRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
- targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: CheckReleaseRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.release !== undefined) {
- obj.release = Release.toJSON(message.release);
- }
- if (message.targets?.length) {
- obj.targets = message.targets;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckReleaseRequest>): CheckReleaseRequest {
- return CheckReleaseRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckReleaseRequest>): CheckReleaseRequest {
- const message = createBaseCheckReleaseRequest();
- message.parent = object.parent ?? "";
- message.release = (object.release !== undefined && object.release !== null)
- ? Release.fromPartial(object.release)
- : undefined;
- message.targets = object.targets?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseCheckReleaseResponse(): CheckReleaseResponse {
- return { results: [], affectedRows: 0, riskLevel: CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED };
-}
-
-export const CheckReleaseResponse: MessageFns<CheckReleaseResponse> = {
- encode(message: CheckReleaseResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.results) {
- CheckReleaseResponse_CheckResult.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.affectedRows !== 0) {
- writer.uint32(16).int32(message.affectedRows);
- }
- if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
- writer.uint32(24).int32(checkReleaseResponse_RiskLevelToNumber(message.riskLevel));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckReleaseResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckReleaseResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.results.push(CheckReleaseResponse_CheckResult.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.affectedRows = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.riskLevel = checkReleaseResponse_RiskLevelFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckReleaseResponse {
- return {
- results: globalThis.Array.isArray(object?.results)
- ? object.results.map((e: any) => CheckReleaseResponse_CheckResult.fromJSON(e))
- : [],
- affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
- riskLevel: isSet(object.riskLevel)
- ? checkReleaseResponse_RiskLevelFromJSON(object.riskLevel)
- : CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
- };
- },
-
- toJSON(message: CheckReleaseResponse): unknown {
- const obj: any = {};
- if (message.results?.length) {
- obj.results = message.results.map((e) => CheckReleaseResponse_CheckResult.toJSON(e));
- }
- if (message.affectedRows !== 0) {
- obj.affectedRows = Math.round(message.affectedRows);
- }
- if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
- obj.riskLevel = checkReleaseResponse_RiskLevelToJSON(message.riskLevel);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckReleaseResponse>): CheckReleaseResponse {
- return CheckReleaseResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckReleaseResponse>): CheckReleaseResponse {
- const message = createBaseCheckReleaseResponse();
- message.results = object.results?.map((e) => CheckReleaseResponse_CheckResult.fromPartial(e)) || [];
- message.affectedRows = object.affectedRows ?? 0;
- message.riskLevel = object.riskLevel ?? CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseCheckReleaseResponse_CheckResult(): CheckReleaseResponse_CheckResult {
- return {
- file: "",
- target: "",
- advices: [],
- affectedRows: 0,
- riskLevel: CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
- };
-}
-
-export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_CheckResult> = {
- encode(message: CheckReleaseResponse_CheckResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.file !== "") {
- writer.uint32(10).string(message.file);
- }
- if (message.target !== "") {
- writer.uint32(18).string(message.target);
- }
- for (const v of message.advices) {
- Advice.encode(v!, writer.uint32(26).fork()).join();
- }
- if (message.affectedRows !== 0) {
- writer.uint32(32).int32(message.affectedRows);
- }
- if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
- writer.uint32(40).int32(checkReleaseResponse_RiskLevelToNumber(message.riskLevel));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckReleaseResponse_CheckResult {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckReleaseResponse_CheckResult();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.file = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.advices.push(Advice.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.affectedRows = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.riskLevel = checkReleaseResponse_RiskLevelFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckReleaseResponse_CheckResult {
- return {
- file: isSet(object.file) ? globalThis.String(object.file) : "",
- target: isSet(object.target) ? globalThis.String(object.target) : "",
- advices: globalThis.Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [],
- affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
- riskLevel: isSet(object.riskLevel)
- ? checkReleaseResponse_RiskLevelFromJSON(object.riskLevel)
- : CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
- };
- },
-
- toJSON(message: CheckReleaseResponse_CheckResult): unknown {
- const obj: any = {};
- if (message.file !== "") {
- obj.file = message.file;
- }
- if (message.target !== "") {
- obj.target = message.target;
- }
- if (message.advices?.length) {
- obj.advices = message.advices.map((e) => Advice.toJSON(e));
- }
- if (message.affectedRows !== 0) {
- obj.affectedRows = Math.round(message.affectedRows);
- }
- if (message.riskLevel !== CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
- obj.riskLevel = checkReleaseResponse_RiskLevelToJSON(message.riskLevel);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckReleaseResponse_CheckResult>): CheckReleaseResponse_CheckResult {
- return CheckReleaseResponse_CheckResult.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckReleaseResponse_CheckResult>): CheckReleaseResponse_CheckResult {
- const message = createBaseCheckReleaseResponse_CheckResult();
- message.file = object.file ?? "";
- message.target = object.target ?? "";
- message.advices = object.advices?.map((e) => Advice.fromPartial(e)) || [];
- message.affectedRows = object.affectedRows ?? 0;
- message.riskLevel = object.riskLevel ?? CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseRelease(): Release {
- return {
- name: "",
- title: "",
- files: [],
- vcsSource: undefined,
- creator: "",
- createTime: undefined,
- state: State.STATE_UNSPECIFIED,
- };
-}
-
-export const Release: MessageFns<Release> = {
- encode(message: Release, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- for (const v of message.files) {
- Release_File.encode(v!, writer.uint32(26).fork()).join();
- }
- if (message.vcsSource !== undefined) {
- Release_VCSSource.encode(message.vcsSource, writer.uint32(34).fork()).join();
- }
- if (message.creator !== "") {
- writer.uint32(42).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(50).fork()).join();
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- writer.uint32(56).int32(stateToNumber(message.state));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Release {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRelease();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.files.push(Release_File.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.vcsSource = Release_VCSSource.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Release {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- files: globalThis.Array.isArray(object?.files) ? object.files.map((e: any) => Release_File.fromJSON(e)) : [],
- vcsSource: isSet(object.vcsSource) ? Release_VCSSource.fromJSON(object.vcsSource) : undefined,
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- };
- },
-
- toJSON(message: Release): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.files?.length) {
- obj.files = message.files.map((e) => Release_File.toJSON(e));
- }
- if (message.vcsSource !== undefined) {
- obj.vcsSource = Release_VCSSource.toJSON(message.vcsSource);
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Release>): Release {
- return Release.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Release>): Release {
- const message = createBaseRelease();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.files = object.files?.map((e) => Release_File.fromPartial(e)) || [];
- message.vcsSource = (object.vcsSource !== undefined && object.vcsSource !== null)
- ? Release_VCSSource.fromPartial(object.vcsSource)
- : undefined;
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseRelease_File(): Release_File {
- return {
- id: "",
- path: "",
- type: ReleaseFileType.TYPE_UNSPECIFIED,
- version: "",
- changeType: Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED,
- sheet: "",
- statement: new Uint8Array(0),
- sheetSha256: "",
- statementSize: Long.ZERO,
- };
-}
-
-export const Release_File: MessageFns<Release_File> = {
- encode(message: Release_File, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.path !== "") {
- writer.uint32(18).string(message.path);
- }
- if (message.type !== ReleaseFileType.TYPE_UNSPECIFIED) {
- writer.uint32(40).int32(releaseFileTypeToNumber(message.type));
- }
- if (message.version !== "") {
- writer.uint32(50).string(message.version);
- }
- if (message.changeType !== Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
- writer.uint32(72).int32(release_File_ChangeTypeToNumber(message.changeType));
- }
- if (message.sheet !== "") {
- writer.uint32(26).string(message.sheet);
- }
- if (message.statement.length !== 0) {
- writer.uint32(58).bytes(message.statement);
- }
- if (message.sheetSha256 !== "") {
- writer.uint32(34).string(message.sheetSha256);
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- writer.uint32(64).int64(message.statementSize.toString());
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Release_File {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRelease_File();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.path = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.type = releaseFileTypeFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.changeType = release_File_ChangeTypeFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.statement = reader.bytes();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.sheetSha256 = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.statementSize = Long.fromString(reader.int64().toString());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Release_File {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- path: isSet(object.path) ? globalThis.String(object.path) : "",
- type: isSet(object.type) ? releaseFileTypeFromJSON(object.type) : ReleaseFileType.TYPE_UNSPECIFIED,
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- changeType: isSet(object.changeType)
- ? release_File_ChangeTypeFromJSON(object.changeType)
- : Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED,
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- statement: isSet(object.statement) ? bytesFromBase64(object.statement) : new Uint8Array(0),
- sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
- statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
- };
- },
-
- toJSON(message: Release_File): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.path !== "") {
- obj.path = message.path;
- }
- if (message.type !== ReleaseFileType.TYPE_UNSPECIFIED) {
- obj.type = releaseFileTypeToJSON(message.type);
- }
- if (message.version !== "") {
- obj.version = message.version;
- }
- if (message.changeType !== Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
- obj.changeType = release_File_ChangeTypeToJSON(message.changeType);
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.statement.length !== 0) {
- obj.statement = base64FromBytes(message.statement);
- }
- if (message.sheetSha256 !== "") {
- obj.sheetSha256 = message.sheetSha256;
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- obj.statementSize = (message.statementSize || Long.ZERO).toString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<Release_File>): Release_File {
- return Release_File.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Release_File>): Release_File {
- const message = createBaseRelease_File();
- message.id = object.id ?? "";
- message.path = object.path ?? "";
- message.type = object.type ?? ReleaseFileType.TYPE_UNSPECIFIED;
- message.version = object.version ?? "";
- message.changeType = object.changeType ?? Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED;
- message.sheet = object.sheet ?? "";
- message.statement = object.statement ?? new Uint8Array(0);
- message.sheetSha256 = object.sheetSha256 ?? "";
- message.statementSize = (object.statementSize !== undefined && object.statementSize !== null)
- ? Long.fromValue(object.statementSize)
- : Long.ZERO;
- return message;
- },
-};
-
-function createBaseRelease_VCSSource(): Release_VCSSource {
- return { vcsType: VCSType.VCS_TYPE_UNSPECIFIED, url: "" };
-}
-
-export const Release_VCSSource: MessageFns<Release_VCSSource> = {
- encode(message: Release_VCSSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(vCSTypeToNumber(message.vcsType));
- }
- if (message.url !== "") {
- writer.uint32(18).string(message.url);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Release_VCSSource {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRelease_VCSSource();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.vcsType = vCSTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.url = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Release_VCSSource {
- return {
- vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : VCSType.VCS_TYPE_UNSPECIFIED,
- url: isSet(object.url) ? globalThis.String(object.url) : "",
- };
- },
-
- toJSON(message: Release_VCSSource): unknown {
- const obj: any = {};
- if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
- obj.vcsType = vCSTypeToJSON(message.vcsType);
- }
- if (message.url !== "") {
- obj.url = message.url;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Release_VCSSource>): Release_VCSSource {
- return Release_VCSSource.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Release_VCSSource>): Release_VCSSource {
- const message = createBaseRelease_VCSSource();
- message.vcsType = object.vcsType ?? VCSType.VCS_TYPE_UNSPECIFIED;
- message.url = object.url ?? "";
- return message;
- },
-};
-
-export type ReleaseServiceDefinition = typeof ReleaseServiceDefinition;
-export const ReleaseServiceDefinition = {
- name: "ReleaseService",
- fullName: "bytebase.v1.ReleaseService",
- methods: {
- /** Permissions required: bb.releases.get */
- getRelease: {
- name: "GetRelease",
- requestType: GetReleaseRequest,
- requestStream: false,
- responseType: Release,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.list */
- listReleases: {
- name: "ListReleases",
- requestType: ListReleasesRequest,
- requestStream: false,
- responseType: ListReleasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.create */
- createRelease: {
- name: "CreateRelease",
- requestType: CreateReleaseRequest,
- requestStream: false,
- responseType: Release,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([14, 112, 97, 114, 101, 110, 116, 44, 114, 101, 108, 101, 97, 115, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 7,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 34,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.update */
- updateRelease: {
- name: "UpdateRelease",
- requestType: UpdateReleaseRequest,
- requestStream: false,
- responseType: Release,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 19,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 117, 112, 100, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 51,
- 58,
- 7,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 50,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.delete */
- deleteRelease: {
- name: "DeleteRelease",
- requestType: DeleteReleaseRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 100, 101, 108, 101, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 42,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.undelete */
- undeleteRelease: {
- name: "UndeleteRelease",
- requestType: UndeleteReleaseRequest,
- requestStream: false,
- responseType: Release,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 46,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 34,
- 41,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.releases.check */
- checkRelease: {
- name: "CheckRelease",
- requestType: CheckReleaseRequest,
- requestStream: false,
- responseType: CheckReleaseResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([17, 98, 98, 46, 114, 101, 108, 101, 97, 115, 101, 115, 46, 99, 104, 101, 99, 107])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 1,
- 42,
- 34,
- 38,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 108,
- 101,
- 97,
- 115,
- 101,
- 115,
- 58,
- 99,
- 104,
- 101,
- 99,
- 107,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/review_config_service.ts b/frontend/src/types/proto/v1/review_config_service.ts
deleted file mode 100644
index e0a0cea9da..0000000000
--- a/frontend/src/types/proto/v1/review_config_service.ts
+++ /dev/null
@@ -1,1104 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/review_config_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { SQLReviewRule } from "./org_policy_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface ListReviewConfigsRequest {
- /**
- * Not used.
- * The maximum number of sql review to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 sql review will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListReviewConfigs` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListReviewConfigsResponse {
- /** The sql review from the specified request. */
- reviewConfigs: ReviewConfig[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateReviewConfigRequest {
- /** The sql review to create. */
- reviewConfig: ReviewConfig | undefined;
-}
-
-export interface UpdateReviewConfigRequest {
- /**
- * The sql review to update.
- *
- * The name field is used to identify the sql review to update.
- */
- reviewConfig:
- | ReviewConfig
- | undefined;
- /** The list of fields to update. */
- updateMask:
- | string[]
- | undefined;
- /**
- * If set to true, and the config is not found, a new config will be created.
- * In this situation, `update_mask` is ignored.
- */
- allowMissing: boolean;
-}
-
-export interface GetReviewConfigRequest {
- /**
- * The name of the sql review to retrieve.
- * Format: reviewConfigs/{reviewConfig}
- */
- name: string;
-}
-
-export interface DeleteReviewConfigRequest {
- /**
- * The name of the sql review to delete.
- * Format: reviewConfigs/{reviewConfig}
- */
- name: string;
-}
-
-export interface ReviewConfig {
- /**
- * The name of the sql review to retrieve.
- * Format: reviewConfigs/{reviewConfig}
- */
- name: string;
- title: string;
- enabled: boolean;
- rules: SQLReviewRule[];
- /**
- * resources using the config.
- * Format: {resurce}/{resource id}, for example, environments/test.
- */
- resources: string[];
-}
-
-function createBaseListReviewConfigsRequest(): ListReviewConfigsRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListReviewConfigsRequest: MessageFns<ListReviewConfigsRequest> = {
- encode(message: ListReviewConfigsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListReviewConfigsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListReviewConfigsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListReviewConfigsRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListReviewConfigsRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListReviewConfigsRequest>): ListReviewConfigsRequest {
- return ListReviewConfigsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListReviewConfigsRequest>): ListReviewConfigsRequest {
- const message = createBaseListReviewConfigsRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListReviewConfigsResponse(): ListReviewConfigsResponse {
- return { reviewConfigs: [], nextPageToken: "" };
-}
-
-export const ListReviewConfigsResponse: MessageFns<ListReviewConfigsResponse> = {
- encode(message: ListReviewConfigsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.reviewConfigs) {
- ReviewConfig.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListReviewConfigsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListReviewConfigsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.reviewConfigs.push(ReviewConfig.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListReviewConfigsResponse {
- return {
- reviewConfigs: globalThis.Array.isArray(object?.reviewConfigs)
- ? object.reviewConfigs.map((e: any) => ReviewConfig.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListReviewConfigsResponse): unknown {
- const obj: any = {};
- if (message.reviewConfigs?.length) {
- obj.reviewConfigs = message.reviewConfigs.map((e) => ReviewConfig.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListReviewConfigsResponse>): ListReviewConfigsResponse {
- return ListReviewConfigsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListReviewConfigsResponse>): ListReviewConfigsResponse {
- const message = createBaseListReviewConfigsResponse();
- message.reviewConfigs = object.reviewConfigs?.map((e) => ReviewConfig.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateReviewConfigRequest(): CreateReviewConfigRequest {
- return { reviewConfig: undefined };
-}
-
-export const CreateReviewConfigRequest: MessageFns<CreateReviewConfigRequest> = {
- encode(message: CreateReviewConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.reviewConfig !== undefined) {
- ReviewConfig.encode(message.reviewConfig, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateReviewConfigRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateReviewConfigRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.reviewConfig = ReviewConfig.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateReviewConfigRequest {
- return { reviewConfig: isSet(object.reviewConfig) ? ReviewConfig.fromJSON(object.reviewConfig) : undefined };
- },
-
- toJSON(message: CreateReviewConfigRequest): unknown {
- const obj: any = {};
- if (message.reviewConfig !== undefined) {
- obj.reviewConfig = ReviewConfig.toJSON(message.reviewConfig);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateReviewConfigRequest>): CreateReviewConfigRequest {
- return CreateReviewConfigRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateReviewConfigRequest>): CreateReviewConfigRequest {
- const message = createBaseCreateReviewConfigRequest();
- message.reviewConfig = (object.reviewConfig !== undefined && object.reviewConfig !== null)
- ? ReviewConfig.fromPartial(object.reviewConfig)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateReviewConfigRequest(): UpdateReviewConfigRequest {
- return { reviewConfig: undefined, updateMask: undefined, allowMissing: false };
-}
-
-export const UpdateReviewConfigRequest: MessageFns<UpdateReviewConfigRequest> = {
- encode(message: UpdateReviewConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.reviewConfig !== undefined) {
- ReviewConfig.encode(message.reviewConfig, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateReviewConfigRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateReviewConfigRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.reviewConfig = ReviewConfig.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateReviewConfigRequest {
- return {
- reviewConfig: isSet(object.reviewConfig) ? ReviewConfig.fromJSON(object.reviewConfig) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- };
- },
-
- toJSON(message: UpdateReviewConfigRequest): unknown {
- const obj: any = {};
- if (message.reviewConfig !== undefined) {
- obj.reviewConfig = ReviewConfig.toJSON(message.reviewConfig);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateReviewConfigRequest>): UpdateReviewConfigRequest {
- return UpdateReviewConfigRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateReviewConfigRequest>): UpdateReviewConfigRequest {
- const message = createBaseUpdateReviewConfigRequest();
- message.reviewConfig = (object.reviewConfig !== undefined && object.reviewConfig !== null)
- ? ReviewConfig.fromPartial(object.reviewConfig)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.allowMissing = object.allowMissing ?? false;
- return message;
- },
-};
-
-function createBaseGetReviewConfigRequest(): GetReviewConfigRequest {
- return { name: "" };
-}
-
-export const GetReviewConfigRequest: MessageFns<GetReviewConfigRequest> = {
- encode(message: GetReviewConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetReviewConfigRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetReviewConfigRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetReviewConfigRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetReviewConfigRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetReviewConfigRequest>): GetReviewConfigRequest {
- return GetReviewConfigRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetReviewConfigRequest>): GetReviewConfigRequest {
- const message = createBaseGetReviewConfigRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseDeleteReviewConfigRequest(): DeleteReviewConfigRequest {
- return { name: "" };
-}
-
-export const DeleteReviewConfigRequest: MessageFns<DeleteReviewConfigRequest> = {
- encode(message: DeleteReviewConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteReviewConfigRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteReviewConfigRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteReviewConfigRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteReviewConfigRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteReviewConfigRequest>): DeleteReviewConfigRequest {
- return DeleteReviewConfigRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteReviewConfigRequest>): DeleteReviewConfigRequest {
- const message = createBaseDeleteReviewConfigRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseReviewConfig(): ReviewConfig {
- return { name: "", title: "", enabled: false, rules: [], resources: [] };
-}
-
-export const ReviewConfig: MessageFns<ReviewConfig> = {
- encode(message: ReviewConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.enabled !== false) {
- writer.uint32(24).bool(message.enabled);
- }
- for (const v of message.rules) {
- SQLReviewRule.encode(v!, writer.uint32(58).fork()).join();
- }
- for (const v of message.resources) {
- writer.uint32(66).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ReviewConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseReviewConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.rules.push(SQLReviewRule.decode(reader, reader.uint32()));
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.resources.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ReviewConfig {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- rules: globalThis.Array.isArray(object?.rules) ? object.rules.map((e: any) => SQLReviewRule.fromJSON(e)) : [],
- resources: globalThis.Array.isArray(object?.resources)
- ? object.resources.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: ReviewConfig): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.rules?.length) {
- obj.rules = message.rules.map((e) => SQLReviewRule.toJSON(e));
- }
- if (message.resources?.length) {
- obj.resources = message.resources;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ReviewConfig>): ReviewConfig {
- return ReviewConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ReviewConfig>): ReviewConfig {
- const message = createBaseReviewConfig();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.enabled = object.enabled ?? false;
- message.rules = object.rules?.map((e) => SQLReviewRule.fromPartial(e)) || [];
- message.resources = object.resources?.map((e) => e) || [];
- return message;
- },
-};
-
-export type ReviewConfigServiceDefinition = typeof ReviewConfigServiceDefinition;
-export const ReviewConfigServiceDefinition = {
- name: "ReviewConfigService",
- fullName: "bytebase.v1.ReviewConfigService",
- methods: {
- /** Permissions required: bb.reviewConfigs.create */
- createReviewConfig: {
- name: "CreateReviewConfig",
- requestType: CreateReviewConfigRequest,
- requestStream: false,
- responseType: ReviewConfig,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 58,
- 13,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 95,
- 99,
- 111,
- 110,
- 102,
- 105,
- 103,
- 34,
- 17,
- 47,
- 118,
- 49,
- 47,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.reviewConfigs.list */
- listReviewConfigs: {
- name: "ListReviewConfigs",
- requestType: ListReviewConfigsRequest,
- requestStream: false,
- responseType: ListReviewConfigsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [
- new Uint8Array([
- 21,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 46,
- 108,
- 105,
- 115,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 19,
- 18,
- 17,
- 47,
- 118,
- 49,
- 47,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.reviewConfigs.get */
- getReviewConfig: {
- name: "GetReviewConfig",
- requestType: GetReviewConfigRequest,
- requestStream: false,
- responseType: ReviewConfig,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 20,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 46,
- 103,
- 101,
- 116,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 28,
- 18,
- 26,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.reviewConfigs.update */
- updateReviewConfig: {
- name: "UpdateReviewConfig",
- requestType: UpdateReviewConfigRequest,
- requestStream: false,
- responseType: ReviewConfig,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 25,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 95,
- 99,
- 111,
- 110,
- 102,
- 105,
- 103,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 46,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 57,
- 58,
- 13,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 95,
- 99,
- 111,
- 110,
- 102,
- 105,
- 103,
- 50,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 95,
- 99,
- 111,
- 110,
- 102,
- 105,
- 103,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.reviewConfigs.delete */
- deleteReviewConfig: {
- name: "DeleteReviewConfig",
- requestType: DeleteReviewConfigRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 23,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 28,
- 42,
- 26,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 67,
- 111,
- 110,
- 102,
- 105,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/revision_service.ts b/frontend/src/types/proto/v1/revision_service.ts
deleted file mode 100644
index a402e26dd4..0000000000
--- a/frontend/src/types/proto/v1/revision_service.ts
+++ /dev/null
@@ -1,1418 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/revision_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { Timestamp } from "../google/protobuf/timestamp";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface ListRevisionsRequest {
- /**
- * The parent of the revisions.
- * Format: instances/{instance}/databases/{database}
- */
- parent: string;
- /**
- * The maximum number of revisions to return. The service may return fewer
- * than this value. If unspecified, at most 10 revisions will be returned. The
- * maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListRevisions` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListRevisions` must
- * match the call that provided the page token.
- */
- pageToken: string;
- showDeleted: boolean;
-}
-
-export interface ListRevisionsResponse {
- revisions: Revision[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateRevisionRequest {
- /** Format: instances/{instance}/databases/{database} */
- parent: string;
- /** The revision to create. */
- revision: Revision | undefined;
-}
-
-export interface BatchCreateRevisionsRequest {
- /**
- * The parent resource shared by all revisions being created.
- * Format: instances/{instance}/databases/{database}
- */
- parent: string;
- /**
- * The request message specifying the revisions to create.
- * A maximum of 100 revisions can be created in a batch.
- */
- requests: CreateRevisionRequest[];
-}
-
-export interface BatchCreateRevisionsResponse {
- /** The created revisions. */
- revisions: Revision[];
-}
-
-export interface GetRevisionRequest {
- /**
- * The name of the revision.
- * Format: instances/{instance}/databases/{database}/revisions/{revision}
- */
- name: string;
-}
-
-export interface DeleteRevisionRequest {
- /**
- * The name of the revision to delete.
- * Format: instances/{instance}/databases/{database}/revisions/{revision}
- */
- name: string;
-}
-
-export interface Revision {
- /** Format: instances/{instance}/databases/{database}/revisions/{revision} */
- name: string;
- /**
- * Format: projects/{project}/releases/{release}
- * Can be empty.
- */
- release: string;
- createTime:
- | Timestamp
- | undefined;
- /**
- * Format: users/[email protected]
- * Can be empty.
- */
- deleter: string;
- /** Can be empty. */
- deleteTime:
- | Timestamp
- | undefined;
- /**
- * Format: projects/{project}/releases/{release}/files/{id}
- * Can be empty.
- */
- file: string;
- version: string;
- /**
- * The sheet that holds the content.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet: string;
- /** The SHA256 hash value of the sheet. */
- sheetSha256: string;
- /** The statement is used for preview purpose. */
- statement: string;
- statementSize: Long;
- /**
- * The issue associated with the revision.
- * Can be empty.
- * Format: projects/{project}/issues/{issue}
- */
- issue: string;
- /**
- * The task run associated with the revision.
- * Can be empty.
- * Format:
- * projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
- */
- taskRun: string;
-}
-
-function createBaseListRevisionsRequest(): ListRevisionsRequest {
- return { parent: "", pageSize: 0, pageToken: "", showDeleted: false };
-}
-
-export const ListRevisionsRequest: MessageFns<ListRevisionsRequest> = {
- encode(message: ListRevisionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(32).bool(message.showDeleted);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRevisionsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRevisionsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRevisionsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- };
- },
-
- toJSON(message: ListRevisionsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRevisionsRequest>): ListRevisionsRequest {
- return ListRevisionsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRevisionsRequest>): ListRevisionsRequest {
- const message = createBaseListRevisionsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- return message;
- },
-};
-
-function createBaseListRevisionsResponse(): ListRevisionsResponse {
- return { revisions: [], nextPageToken: "" };
-}
-
-export const ListRevisionsResponse: MessageFns<ListRevisionsResponse> = {
- encode(message: ListRevisionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.revisions) {
- Revision.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRevisionsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRevisionsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.revisions.push(Revision.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRevisionsResponse {
- return {
- revisions: globalThis.Array.isArray(object?.revisions)
- ? object.revisions.map((e: any) => Revision.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListRevisionsResponse): unknown {
- const obj: any = {};
- if (message.revisions?.length) {
- obj.revisions = message.revisions.map((e) => Revision.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRevisionsResponse>): ListRevisionsResponse {
- return ListRevisionsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRevisionsResponse>): ListRevisionsResponse {
- const message = createBaseListRevisionsResponse();
- message.revisions = object.revisions?.map((e) => Revision.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateRevisionRequest(): CreateRevisionRequest {
- return { parent: "", revision: undefined };
-}
-
-export const CreateRevisionRequest: MessageFns<CreateRevisionRequest> = {
- encode(message: CreateRevisionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.revision !== undefined) {
- Revision.encode(message.revision, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateRevisionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateRevisionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.revision = Revision.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateRevisionRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- revision: isSet(object.revision) ? Revision.fromJSON(object.revision) : undefined,
- };
- },
-
- toJSON(message: CreateRevisionRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.revision !== undefined) {
- obj.revision = Revision.toJSON(message.revision);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateRevisionRequest>): CreateRevisionRequest {
- return CreateRevisionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateRevisionRequest>): CreateRevisionRequest {
- const message = createBaseCreateRevisionRequest();
- message.parent = object.parent ?? "";
- message.revision = (object.revision !== undefined && object.revision !== null)
- ? Revision.fromPartial(object.revision)
- : undefined;
- return message;
- },
-};
-
-function createBaseBatchCreateRevisionsRequest(): BatchCreateRevisionsRequest {
- return { parent: "", requests: [] };
-}
-
-export const BatchCreateRevisionsRequest: MessageFns<BatchCreateRevisionsRequest> = {
- encode(message: BatchCreateRevisionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.requests) {
- CreateRevisionRequest.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateRevisionsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCreateRevisionsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.requests.push(CreateRevisionRequest.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCreateRevisionsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- requests: globalThis.Array.isArray(object?.requests)
- ? object.requests.map((e: any) => CreateRevisionRequest.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchCreateRevisionsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.requests?.length) {
- obj.requests = message.requests.map((e) => CreateRevisionRequest.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCreateRevisionsRequest>): BatchCreateRevisionsRequest {
- return BatchCreateRevisionsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCreateRevisionsRequest>): BatchCreateRevisionsRequest {
- const message = createBaseBatchCreateRevisionsRequest();
- message.parent = object.parent ?? "";
- message.requests = object.requests?.map((e) => CreateRevisionRequest.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchCreateRevisionsResponse(): BatchCreateRevisionsResponse {
- return { revisions: [] };
-}
-
-export const BatchCreateRevisionsResponse: MessageFns<BatchCreateRevisionsResponse> = {
- encode(message: BatchCreateRevisionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.revisions) {
- Revision.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateRevisionsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCreateRevisionsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.revisions.push(Revision.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCreateRevisionsResponse {
- return {
- revisions: globalThis.Array.isArray(object?.revisions)
- ? object.revisions.map((e: any) => Revision.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchCreateRevisionsResponse): unknown {
- const obj: any = {};
- if (message.revisions?.length) {
- obj.revisions = message.revisions.map((e) => Revision.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCreateRevisionsResponse>): BatchCreateRevisionsResponse {
- return BatchCreateRevisionsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCreateRevisionsResponse>): BatchCreateRevisionsResponse {
- const message = createBaseBatchCreateRevisionsResponse();
- message.revisions = object.revisions?.map((e) => Revision.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseGetRevisionRequest(): GetRevisionRequest {
- return { name: "" };
-}
-
-export const GetRevisionRequest: MessageFns<GetRevisionRequest> = {
- encode(message: GetRevisionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetRevisionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetRevisionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetRevisionRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetRevisionRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetRevisionRequest>): GetRevisionRequest {
- return GetRevisionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetRevisionRequest>): GetRevisionRequest {
- const message = createBaseGetRevisionRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseDeleteRevisionRequest(): DeleteRevisionRequest {
- return { name: "" };
-}
-
-export const DeleteRevisionRequest: MessageFns<DeleteRevisionRequest> = {
- encode(message: DeleteRevisionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteRevisionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteRevisionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteRevisionRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteRevisionRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteRevisionRequest>): DeleteRevisionRequest {
- return DeleteRevisionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteRevisionRequest>): DeleteRevisionRequest {
- const message = createBaseDeleteRevisionRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseRevision(): Revision {
- return {
- name: "",
- release: "",
- createTime: undefined,
- deleter: "",
- deleteTime: undefined,
- file: "",
- version: "",
- sheet: "",
- sheetSha256: "",
- statement: "",
- statementSize: Long.ZERO,
- issue: "",
- taskRun: "",
- };
-}
-
-export const Revision: MessageFns<Revision> = {
- encode(message: Revision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.release !== "") {
- writer.uint32(18).string(message.release);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(34).fork()).join();
- }
- if (message.deleter !== "") {
- writer.uint32(42).string(message.deleter);
- }
- if (message.deleteTime !== undefined) {
- Timestamp.encode(message.deleteTime, writer.uint32(50).fork()).join();
- }
- if (message.file !== "") {
- writer.uint32(58).string(message.file);
- }
- if (message.version !== "") {
- writer.uint32(66).string(message.version);
- }
- if (message.sheet !== "") {
- writer.uint32(74).string(message.sheet);
- }
- if (message.sheetSha256 !== "") {
- writer.uint32(82).string(message.sheetSha256);
- }
- if (message.statement !== "") {
- writer.uint32(90).string(message.statement);
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- writer.uint32(96).int64(message.statementSize.toString());
- }
- if (message.issue !== "") {
- writer.uint32(106).string(message.issue);
- }
- if (message.taskRun !== "") {
- writer.uint32(114).string(message.taskRun);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Revision {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRevision();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.release = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.deleter = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.deleteTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.file = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.sheetSha256 = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 96) {
- break;
- }
-
- message.statementSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.issue = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.taskRun = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Revision {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- release: isSet(object.release) ? globalThis.String(object.release) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- deleter: isSet(object.deleter) ? globalThis.String(object.deleter) : "",
- deleteTime: isSet(object.deleteTime) ? fromJsonTimestamp(object.deleteTime) : undefined,
- file: isSet(object.file) ? globalThis.String(object.file) : "",
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
- issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
- taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
- };
- },
-
- toJSON(message: Revision): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.release !== "") {
- obj.release = message.release;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.deleter !== "") {
- obj.deleter = message.deleter;
- }
- if (message.deleteTime !== undefined) {
- obj.deleteTime = fromTimestamp(message.deleteTime).toISOString();
- }
- if (message.file !== "") {
- obj.file = message.file;
- }
- if (message.version !== "") {
- obj.version = message.version;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.sheetSha256 !== "") {
- obj.sheetSha256 = message.sheetSha256;
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (!message.statementSize.equals(Long.ZERO)) {
- obj.statementSize = (message.statementSize || Long.ZERO).toString();
- }
- if (message.issue !== "") {
- obj.issue = message.issue;
- }
- if (message.taskRun !== "") {
- obj.taskRun = message.taskRun;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Revision>): Revision {
- return Revision.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Revision>): Revision {
- const message = createBaseRevision();
- message.name = object.name ?? "";
- message.release = object.release ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.deleter = object.deleter ?? "";
- message.deleteTime = (object.deleteTime !== undefined && object.deleteTime !== null)
- ? Timestamp.fromPartial(object.deleteTime)
- : undefined;
- message.file = object.file ?? "";
- message.version = object.version ?? "";
- message.sheet = object.sheet ?? "";
- message.sheetSha256 = object.sheetSha256 ?? "";
- message.statement = object.statement ?? "";
- message.statementSize = (object.statementSize !== undefined && object.statementSize !== null)
- ? Long.fromValue(object.statementSize)
- : Long.ZERO;
- message.issue = object.issue ?? "";
- message.taskRun = object.taskRun ?? "";
- return message;
- },
-};
-
-export type RevisionServiceDefinition = typeof RevisionServiceDefinition;
-export const RevisionServiceDefinition = {
- name: "RevisionService",
- fullName: "bytebase.v1.RevisionService",
- methods: {
- /** Permissions required: bb.revisions.list */
- listRevisions: {
- name: "ListRevisions",
- requestType: ListRevisionsRequest,
- requestStream: false,
- responseType: ListRevisionsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [
- new Uint8Array([17, 98, 98, 46, 114, 101, 118, 105, 115, 105, 111, 110, 115, 46, 108, 105, 115, 116]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 48,
- 18,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.revisions.get */
- getRevision: {
- name: "GetRevision",
- requestType: GetRevisionRequest,
- requestStream: false,
- responseType: Revision,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 114, 101, 118, 105, 115, 105, 111, 110, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 48,
- 18,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.revisions.create */
- createRevision: {
- name: "CreateRevision",
- requestType: CreateRevisionRequest,
- requestStream: false,
- responseType: Revision,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 58,
- 58,
- 8,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 34,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.revisions.create */
- batchCreateRevisions: {
- name: "BatchCreateRevisions",
- requestType: BatchCreateRevisionsRequest,
- requestStream: false,
- responseType: BatchCreateRevisionsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 46,
- 99,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 63,
- 58,
- 1,
- 42,
- 34,
- 58,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 67,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.revisions.delete */
- deleteRevision: {
- name: "DeleteRevision",
- requestType: DeleteRevisionRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 46,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 48,
- 42,
- 46,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 47,
- 114,
- 101,
- 118,
- 105,
- 115,
- 105,
- 111,
- 110,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/risk_service.ts b/frontend/src/types/proto/v1/risk_service.ts
deleted file mode 100644
index dba254bed2..0000000000
--- a/frontend/src/types/proto/v1/risk_service.ts
+++ /dev/null
@@ -1,975 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/risk_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Expr } from "../google/type/expr";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface ListRisksRequest {
- /**
- * Not used.
- * The maximum number of risks to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 risks will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListRisks` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `LiskRisks` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListRisksResponse {
- risks: Risk[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateRiskRequest {
- /** The risk to create. */
- risk: Risk | undefined;
-}
-
-export interface GetRiskRequest {
- /**
- * The name of the risk to retrieve.
- * Format: risks/{risk}
- */
- name: string;
-}
-
-export interface UpdateRiskRequest {
- /**
- * The risk to update.
- *
- * The risk's `name` field is used to identify the risk to update.
- * Format: risks/{risk}
- */
- risk:
- | Risk
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface DeleteRiskRequest {
- /**
- * The name of the risk to delete.
- * Format: risks/{risk}
- */
- name: string;
-}
-
-export interface Risk {
- /** Format: risks/{risk} */
- name: string;
- source: Risk_Source;
- title: string;
- level: number;
- active: boolean;
- /**
- * The condition that is associated with the risk.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * All supported variables:
- * affected_rows: affected row count in the DDL/DML, support "==", "!=", "<", "<=", ">", ">=" operations.
- * table_rows: table row count number, support "==", "!=", "<", "<=", ">", ">=" operations.
- * environment_id: the environment resource id, support "==", "!=", "in [xx]", "!(in [xx])" operations.
- * project_id: the project resource id, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * db_engine: the database engine type, support "==", "!=", "in [xx]", "!(in [xx])" operations. Check the Engine enum for the values.
- * sql_type: the SQL type, support "==", "!=", "in [xx]", "!(in [xx])" operations.
- * when the risk source is DDL, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L70 for supported values.
- * when the risk source is DML, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L71 for supported values.
- * database_name: the database name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * sql_statement: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * export_rows: export data count, support "==", "!=", "<", "<=", ">", ">=" operations.
- * expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
- * role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- *
- * When the risk source is DDL/DML, support following variables:
- * affected_rows
- * table_rows
- * environment_id
- * project_id
- * db_engine
- * sql_type
- * database_name
- * schema_name
- * table_name
- * sql_statement
- *
- * When the risk source is CREATE_DATABASE, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- *
- * When the risk source is DATA_EXPORT, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- * schema_name
- * table_name
- * export_rows
- *
- * When the risk source is REQUEST_QUERY, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- * schema_name
- * table_name
- * expiration_days
- *
- * When the risk source is REQUEST_EXPORT, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- * schema_name
- * table_name
- * expiration_days
- * export_rows
- *
- * When the risk source is REQUEST_ROLE, support following variables:
- * project_id
- * expiration_days
- * role
- */
- condition: Expr | undefined;
-}
-
-export enum Risk_Source {
- SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
- DDL = "DDL",
- DML = "DML",
- CREATE_DATABASE = "CREATE_DATABASE",
- DATA_EXPORT = "DATA_EXPORT",
- REQUEST_ROLE = "REQUEST_ROLE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function risk_SourceFromJSON(object: any): Risk_Source {
- switch (object) {
- case 0:
- case "SOURCE_UNSPECIFIED":
- return Risk_Source.SOURCE_UNSPECIFIED;
- case 1:
- case "DDL":
- return Risk_Source.DDL;
- case 2:
- case "DML":
- return Risk_Source.DML;
- case 3:
- case "CREATE_DATABASE":
- return Risk_Source.CREATE_DATABASE;
- case 6:
- case "DATA_EXPORT":
- return Risk_Source.DATA_EXPORT;
- case 7:
- case "REQUEST_ROLE":
- return Risk_Source.REQUEST_ROLE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Risk_Source.UNRECOGNIZED;
- }
-}
-
-export function risk_SourceToJSON(object: Risk_Source): string {
- switch (object) {
- case Risk_Source.SOURCE_UNSPECIFIED:
- return "SOURCE_UNSPECIFIED";
- case Risk_Source.DDL:
- return "DDL";
- case Risk_Source.DML:
- return "DML";
- case Risk_Source.CREATE_DATABASE:
- return "CREATE_DATABASE";
- case Risk_Source.DATA_EXPORT:
- return "DATA_EXPORT";
- case Risk_Source.REQUEST_ROLE:
- return "REQUEST_ROLE";
- case Risk_Source.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.DATA_EXPORT:
- return 6;
- case Risk_Source.REQUEST_ROLE:
- return 7;
- case Risk_Source.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseListRisksRequest(): ListRisksRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListRisksRequest: MessageFns<ListRisksRequest> = {
- encode(message: ListRisksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRisksRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRisksRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRisksRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListRisksRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRisksRequest>): ListRisksRequest {
- return ListRisksRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRisksRequest>): ListRisksRequest {
- const message = createBaseListRisksRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListRisksResponse(): ListRisksResponse {
- return { risks: [], nextPageToken: "" };
-}
-
-export const ListRisksResponse: MessageFns<ListRisksResponse> = {
- encode(message: ListRisksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.risks) {
- Risk.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRisksResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRisksResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.risks.push(Risk.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRisksResponse {
- return {
- risks: globalThis.Array.isArray(object?.risks) ? object.risks.map((e: any) => Risk.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListRisksResponse): unknown {
- const obj: any = {};
- if (message.risks?.length) {
- obj.risks = message.risks.map((e) => Risk.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRisksResponse>): ListRisksResponse {
- return ListRisksResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRisksResponse>): ListRisksResponse {
- const message = createBaseListRisksResponse();
- message.risks = object.risks?.map((e) => Risk.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateRiskRequest(): CreateRiskRequest {
- return { risk: undefined };
-}
-
-export const CreateRiskRequest: MessageFns<CreateRiskRequest> = {
- encode(message: CreateRiskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.risk !== undefined) {
- Risk.encode(message.risk, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateRiskRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateRiskRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.risk = Risk.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateRiskRequest {
- return { risk: isSet(object.risk) ? Risk.fromJSON(object.risk) : undefined };
- },
-
- toJSON(message: CreateRiskRequest): unknown {
- const obj: any = {};
- if (message.risk !== undefined) {
- obj.risk = Risk.toJSON(message.risk);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateRiskRequest>): CreateRiskRequest {
- return CreateRiskRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateRiskRequest>): CreateRiskRequest {
- const message = createBaseCreateRiskRequest();
- message.risk = (object.risk !== undefined && object.risk !== null) ? Risk.fromPartial(object.risk) : undefined;
- return message;
- },
-};
-
-function createBaseGetRiskRequest(): GetRiskRequest {
- return { name: "" };
-}
-
-export const GetRiskRequest: MessageFns<GetRiskRequest> = {
- encode(message: GetRiskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetRiskRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetRiskRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetRiskRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetRiskRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetRiskRequest>): GetRiskRequest {
- return GetRiskRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetRiskRequest>): GetRiskRequest {
- const message = createBaseGetRiskRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUpdateRiskRequest(): UpdateRiskRequest {
- return { risk: undefined, updateMask: undefined };
-}
-
-export const UpdateRiskRequest: MessageFns<UpdateRiskRequest> = {
- encode(message: UpdateRiskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.risk !== undefined) {
- Risk.encode(message.risk, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateRiskRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateRiskRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.risk = Risk.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateRiskRequest {
- return {
- risk: isSet(object.risk) ? Risk.fromJSON(object.risk) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateRiskRequest): unknown {
- const obj: any = {};
- if (message.risk !== undefined) {
- obj.risk = Risk.toJSON(message.risk);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateRiskRequest>): UpdateRiskRequest {
- return UpdateRiskRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateRiskRequest>): UpdateRiskRequest {
- const message = createBaseUpdateRiskRequest();
- message.risk = (object.risk !== undefined && object.risk !== null) ? Risk.fromPartial(object.risk) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseDeleteRiskRequest(): DeleteRiskRequest {
- return { name: "" };
-}
-
-export const DeleteRiskRequest: MessageFns<DeleteRiskRequest> = {
- encode(message: DeleteRiskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteRiskRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteRiskRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteRiskRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteRiskRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteRiskRequest>): DeleteRiskRequest {
- return DeleteRiskRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteRiskRequest>): DeleteRiskRequest {
- const message = createBaseDeleteRiskRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseRisk(): Risk {
- return { name: "", source: Risk_Source.SOURCE_UNSPECIFIED, title: "", level: 0, active: false, condition: undefined };
-}
-
-export const Risk: MessageFns<Risk> = {
- encode(message: Risk, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.source !== Risk_Source.SOURCE_UNSPECIFIED) {
- writer.uint32(24).int32(risk_SourceToNumber(message.source));
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- if (message.level !== 0) {
- writer.uint32(40).int32(message.level);
- }
- if (message.active !== false) {
- writer.uint32(56).bool(message.active);
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(66).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Risk {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRisk();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.source = risk_SourceFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.level = reader.int32();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.active = reader.bool();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Risk {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- source: isSet(object.source) ? risk_SourceFromJSON(object.source) : Risk_Source.SOURCE_UNSPECIFIED,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- level: isSet(object.level) ? globalThis.Number(object.level) : 0,
- active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- };
- },
-
- toJSON(message: Risk): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.source !== Risk_Source.SOURCE_UNSPECIFIED) {
- obj.source = risk_SourceToJSON(message.source);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.level !== 0) {
- obj.level = Math.round(message.level);
- }
- if (message.active !== false) {
- obj.active = message.active;
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Risk>): Risk {
- return Risk.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Risk>): Risk {
- const message = createBaseRisk();
- message.name = object.name ?? "";
- message.source = object.source ?? Risk_Source.SOURCE_UNSPECIFIED;
- message.title = object.title ?? "";
- message.level = object.level ?? 0;
- message.active = object.active ?? false;
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- return message;
- },
-};
-
-export type RiskServiceDefinition = typeof RiskServiceDefinition;
-export const RiskServiceDefinition = {
- name: "RiskService",
- fullName: "bytebase.v1.RiskService",
- methods: {
- /** Permissions required: bb.risks.list */
- listRisks: {
- name: "ListRisks",
- requestType: ListRisksRequest,
- requestStream: false,
- responseType: ListRisksResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([13, 98, 98, 46, 114, 105, 115, 107, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([11, 18, 9, 47, 118, 49, 47, 114, 105, 115, 107, 115])],
- },
- },
- },
- /** Permissions required: bb.risks.create */
- createRisk: {
- name: "CreateRisk",
- requestType: CreateRiskRequest,
- requestStream: false,
- responseType: Risk,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 114, 105, 115, 107])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 105, 115, 107, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [new Uint8Array([17, 58, 4, 114, 105, 115, 107, 34, 9, 47, 118, 49, 47, 114, 105, 115, 107, 115])],
- },
- },
- },
- /** Permissions required: bb.risks.list */
- getRisk: {
- name: "GetRisk",
- requestType: GetRiskRequest,
- requestStream: false,
- responseType: Risk,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([13, 98, 98, 46, 114, 105, 115, 107, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 18,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 105,
- 115,
- 107,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.risks.update */
- updateRisk: {
- name: "UpdateRisk",
- requestType: UpdateRiskRequest,
- requestStream: false,
- responseType: Risk,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([16, 114, 105, 115, 107, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 105, 115, 107, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 31,
- 58,
- 4,
- 114,
- 105,
- 115,
- 107,
- 50,
- 23,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 105,
- 115,
- 107,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 105,
- 115,
- 107,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.risks.delete */
- deleteRisk: {
- name: "DeleteRisk",
- requestType: DeleteRiskRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 105, 115, 107, 115, 46, 100, 101, 108, 101, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 42,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 105,
- 115,
- 107,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/role_service.ts b/frontend/src/types/proto/v1/role_service.ts
deleted file mode 100644
index 68999f46b6..0000000000
--- a/frontend/src/types/proto/v1/role_service.ts
+++ /dev/null
@@ -1,895 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/role_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface ListRolesRequest {
- /**
- * Not used.
- * The maximum number of roles to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 reviews will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListRoles` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListRoles` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListRolesResponse {
- roles: Role[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateRoleRequest {
- role:
- | Role
- | undefined;
- /**
- * The ID to use for the role, which will become the final component
- * of the role's resource name.
- *
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][A-Z][0-9]/.
- */
- roleId: string;
-}
-
-export interface GetRoleRequest {
- /**
- * The name of the role to retrieve.
- * Format: roles/{role}
- */
- name: string;
-}
-
-export interface UpdateRoleRequest {
- role: Role | undefined;
- updateMask:
- | string[]
- | undefined;
- /** If set to true, and the role is not found, a new role will be created. */
- allowMissing: boolean;
-}
-
-export interface DeleteRoleRequest {
- /** Format: roles/{role} */
- name: string;
-}
-
-export interface Role {
- /** Format: roles/{role} */
- name: string;
- title: string;
- description: string;
- permissions: string[];
- type: Role_Type;
-}
-
-export enum Role_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- BUILT_IN = "BUILT_IN",
- CUSTOM = "CUSTOM",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function role_TypeFromJSON(object: any): Role_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Role_Type.TYPE_UNSPECIFIED;
- case 1:
- case "BUILT_IN":
- return Role_Type.BUILT_IN;
- case 2:
- case "CUSTOM":
- return Role_Type.CUSTOM;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Role_Type.UNRECOGNIZED;
- }
-}
-
-export function role_TypeToJSON(object: Role_Type): string {
- switch (object) {
- case Role_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Role_Type.BUILT_IN:
- return "BUILT_IN";
- case Role_Type.CUSTOM:
- return "CUSTOM";
- case Role_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function role_TypeToNumber(object: Role_Type): number {
- switch (object) {
- case Role_Type.TYPE_UNSPECIFIED:
- return 0;
- case Role_Type.BUILT_IN:
- return 1;
- case Role_Type.CUSTOM:
- return 2;
- case Role_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-function createBaseListRolesRequest(): ListRolesRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListRolesRequest: MessageFns<ListRolesRequest> = {
- encode(message: ListRolesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRolesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRolesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRolesRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListRolesRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRolesRequest>): ListRolesRequest {
- return ListRolesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRolesRequest>): ListRolesRequest {
- const message = createBaseListRolesRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListRolesResponse(): ListRolesResponse {
- return { roles: [], nextPageToken: "" };
-}
-
-export const ListRolesResponse: MessageFns<ListRolesResponse> = {
- encode(message: ListRolesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.roles) {
- Role.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRolesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRolesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.roles.push(Role.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRolesResponse {
- return {
- roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => Role.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListRolesResponse): unknown {
- const obj: any = {};
- if (message.roles?.length) {
- obj.roles = message.roles.map((e) => Role.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRolesResponse>): ListRolesResponse {
- return ListRolesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRolesResponse>): ListRolesResponse {
- const message = createBaseListRolesResponse();
- message.roles = object.roles?.map((e) => Role.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateRoleRequest(): CreateRoleRequest {
- return { role: undefined, roleId: "" };
-}
-
-export const CreateRoleRequest: MessageFns<CreateRoleRequest> = {
- encode(message: CreateRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.role !== undefined) {
- Role.encode(message.role, writer.uint32(10).fork()).join();
- }
- if (message.roleId !== "") {
- writer.uint32(18).string(message.roleId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateRoleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateRoleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.role = Role.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.roleId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateRoleRequest {
- return {
- role: isSet(object.role) ? Role.fromJSON(object.role) : undefined,
- roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
- };
- },
-
- toJSON(message: CreateRoleRequest): unknown {
- const obj: any = {};
- if (message.role !== undefined) {
- obj.role = Role.toJSON(message.role);
- }
- if (message.roleId !== "") {
- obj.roleId = message.roleId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateRoleRequest>): CreateRoleRequest {
- return CreateRoleRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateRoleRequest>): CreateRoleRequest {
- const message = createBaseCreateRoleRequest();
- message.role = (object.role !== undefined && object.role !== null) ? Role.fromPartial(object.role) : undefined;
- message.roleId = object.roleId ?? "";
- return message;
- },
-};
-
-function createBaseGetRoleRequest(): GetRoleRequest {
- return { name: "" };
-}
-
-export const GetRoleRequest: MessageFns<GetRoleRequest> = {
- encode(message: GetRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetRoleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetRoleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetRoleRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetRoleRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetRoleRequest>): GetRoleRequest {
- return GetRoleRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetRoleRequest>): GetRoleRequest {
- const message = createBaseGetRoleRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUpdateRoleRequest(): UpdateRoleRequest {
- return { role: undefined, updateMask: undefined, allowMissing: false };
-}
-
-export const UpdateRoleRequest: MessageFns<UpdateRoleRequest> = {
- encode(message: UpdateRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.role !== undefined) {
- Role.encode(message.role, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateRoleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateRoleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.role = Role.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateRoleRequest {
- return {
- role: isSet(object.role) ? Role.fromJSON(object.role) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- };
- },
-
- toJSON(message: UpdateRoleRequest): unknown {
- const obj: any = {};
- if (message.role !== undefined) {
- obj.role = Role.toJSON(message.role);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateRoleRequest>): UpdateRoleRequest {
- return UpdateRoleRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateRoleRequest>): UpdateRoleRequest {
- const message = createBaseUpdateRoleRequest();
- message.role = (object.role !== undefined && object.role !== null) ? Role.fromPartial(object.role) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.allowMissing = object.allowMissing ?? false;
- return message;
- },
-};
-
-function createBaseDeleteRoleRequest(): DeleteRoleRequest {
- return { name: "" };
-}
-
-export const DeleteRoleRequest: MessageFns<DeleteRoleRequest> = {
- encode(message: DeleteRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteRoleRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteRoleRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteRoleRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteRoleRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteRoleRequest>): DeleteRoleRequest {
- return DeleteRoleRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteRoleRequest>): DeleteRoleRequest {
- const message = createBaseDeleteRoleRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseRole(): Role {
- return { name: "", title: "", description: "", permissions: [], type: Role_Type.TYPE_UNSPECIFIED };
-}
-
-export const Role: MessageFns<Role> = {
- encode(message: Role, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- for (const v of message.permissions) {
- writer.uint32(34).string(v!);
- }
- if (message.type !== Role_Type.TYPE_UNSPECIFIED) {
- writer.uint32(40).int32(role_TypeToNumber(message.type));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Role {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRole();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.permissions.push(reader.string());
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.type = role_TypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Role {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- permissions: globalThis.Array.isArray(object?.permissions)
- ? object.permissions.map((e: any) => globalThis.String(e))
- : [],
- type: isSet(object.type) ? role_TypeFromJSON(object.type) : Role_Type.TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: Role): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.permissions?.length) {
- obj.permissions = message.permissions;
- }
- if (message.type !== Role_Type.TYPE_UNSPECIFIED) {
- obj.type = role_TypeToJSON(message.type);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Role>): Role {
- return Role.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Role>): Role {
- const message = createBaseRole();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.permissions = object.permissions?.map((e) => e) || [];
- message.type = object.type ?? Role_Type.TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-export type RoleServiceDefinition = typeof RoleServiceDefinition;
-export const RoleServiceDefinition = {
- name: "RoleService",
- fullName: "bytebase.v1.RoleService",
- methods: {
- /** Permissions required: bb.roles.list */
- listRoles: {
- name: "ListRoles",
- requestType: ListRolesRequest,
- requestStream: false,
- responseType: ListRolesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([13, 98, 98, 46, 114, 111, 108, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([11, 18, 9, 47, 118, 49, 47, 114, 111, 108, 101, 115])],
- },
- },
- },
- /** Permissions required: bb.roles.get */
- getRole: {
- name: "GetRole",
- requestType: GetRoleRequest,
- requestStream: false,
- responseType: Role,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([12, 98, 98, 46, 114, 111, 108, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 18,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 111,
- 108,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.roles.create */
- createRole: {
- name: "CreateRole",
- requestType: CreateRoleRequest,
- requestStream: false,
- responseType: Role,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 111, 108, 101, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [new Uint8Array([17, 58, 4, 114, 111, 108, 101, 34, 9, 47, 118, 49, 47, 114, 111, 108, 101, 115])],
- },
- },
- },
- /** Permissions required: bb.roles.update */
- updateRole: {
- name: "UpdateRole",
- requestType: UpdateRoleRequest,
- requestStream: false,
- responseType: Role,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([16, 114, 111, 108, 101, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 111, 108, 101, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 31,
- 58,
- 4,
- 114,
- 111,
- 108,
- 101,
- 50,
- 23,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 111,
- 108,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 111,
- 108,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.roles.delete */
- deleteRole: {
- name: "DeleteRole",
- requestType: DeleteRoleRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 111, 108, 101, 115, 46, 100, 101, 108, 101, 116, 101])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 42,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 114,
- 111,
- 108,
- 101,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.ts
deleted file mode 100644
index 3ae66be4e0..0000000000
--- a/frontend/src/types/proto/v1/rollout_service.ts
+++ /dev/null
@@ -1,6665 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/rollout_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber, Position } from "./common";
-import { Plan } from "./plan_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface BatchRunTasksRequest {
- /**
- * The name of the parent of the tasks.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}
- */
- parent: string;
- /**
- * The tasks to run.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}
- */
- tasks: string[];
- reason: string;
- /** The task run should run after run_time. */
- runTime?: Timestamp | undefined;
-}
-
-export interface BatchRunTasksResponse {
-}
-
-export interface BatchSkipTasksRequest {
- /**
- * The name of the parent of the tasks.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}
- */
- parent: string;
- /**
- * The tasks to skip.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}
- */
- tasks: string[];
- reason: string;
-}
-
-export interface BatchSkipTasksResponse {
-}
-
-export interface BatchCancelTaskRunsRequest {
- /**
- * The name of the parent of the taskRuns.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}
- * Use `projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/-` to cancel task runs under the same stage.
- */
- parent: string;
- /**
- * The taskRuns to cancel.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
- */
- taskRuns: string[];
- reason: string;
-}
-
-export interface BatchCancelTaskRunsResponse {
-}
-
-export interface GetRolloutRequest {
- /**
- * The name of the rollout to retrieve.
- * Format: projects/{project}/rollouts/{rollout}
- */
- name: string;
-}
-
-export interface ListRolloutsRequest {
- /**
- * The parent, which owns this collection of rollouts.
- * Format: projects/{project}
- * Use "projects/-" to list all rollouts from all projects.
- */
- parent: string;
- /**
- * The maximum number of rollouts to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 rollouts will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListRollouts` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListRollouts` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListRolloutsResponse {
- /** The rollouts from the specified request. */
- rollouts: Rollout[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateRolloutRequest {
- /**
- * The parent project where this rollout will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The rollout to create. */
- rollout:
- | Rollout
- | undefined;
- /**
- * Create the rollout and the stages up to the target stage.
- * Format: environments/{environment}
- * If unspecified, all stages are created.
- * If set to "", no stages are created.
- */
- target?:
- | string
- | undefined;
- /**
- * If set, validate the request and preview the rollout, but
- * do not actually create it.
- */
- validateOnly: boolean;
-}
-
-export interface PreviewRolloutRequest {
- /**
- * The name of the project.
- * Format: projects/{project}
- */
- project: string;
- /** The plan used to preview rollout. */
- plan: Plan | undefined;
-}
-
-export interface ListTaskRunsRequest {
- /**
- * The parent, which owns this collection of plans.
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}
- * Use "projects/{project}/rollouts/{rollout}/stages/-/tasks/-" to list all taskRuns from a rollout.
- */
- parent: string;
- /**
- * Not used.
- * The maximum number of taskRuns to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 taskRuns will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListTaskRuns` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListTaskRuns` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListTaskRunsResponse {
- /** The taskRuns from the specified request. */
- taskRuns: TaskRun[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface GetTaskRunRequest {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun} */
- name: string;
-}
-
-export interface GetTaskRunLogRequest {
- /**
- * Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
- * TODO(d): check the resource_reference.
- */
- parent: string;
-}
-
-export interface Rollout {
- /**
- * The resource name of the rollout.
- * Format: projects/{project}/rollouts/{rollout}
- */
- name: string;
- /**
- * The plan that this rollout is based on.
- * Format: projects/{project}/plans/{plan}
- */
- plan: string;
- title: string;
- /** stages and thus tasks of the rollout. */
- stages: Stage[];
- /** Format: users/[email protected] */
- creator: string;
- createTime:
- | Timestamp
- | undefined;
- /**
- * The issue associated with the rollout. Could be empty.
- * Format: projects/{project}/issues/{issue}
- */
- issue: string;
-}
-
-export interface Stage {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage} */
- name: string;
- /**
- * id is the environment id of the stage.
- * e.g. "prod".
- */
- id: string;
- /**
- * environment is the environment of the stage.
- * Format: environments/{environment}.
- */
- environment: string;
- tasks: Task[];
-}
-
-export interface Task {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task} */
- name: string;
- /**
- * A UUID4 string that uniquely identifies the Spec.
- * Could be empty if the rollout of the task does not have an associating plan.
- */
- specId: string;
- /** Status is the status of the task. */
- status: Task_Status;
- skippedReason: string;
- type: Task_Type;
- /**
- * Format: instances/{instance} if the task is DatabaseCreate.
- * Format: instances/{instance}/databases/{database}
- */
- target: string;
- databaseCreate?: Task_DatabaseCreate | undefined;
- databaseSchemaUpdate?: Task_DatabaseSchemaUpdate | undefined;
- databaseDataUpdate?: Task_DatabaseDataUpdate | undefined;
- databaseDataExport?: Task_DatabaseDataExport | undefined;
-}
-
-export enum Task_Status {
- 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 {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return Task_Status.STATUS_UNSPECIFIED;
- case 1:
- case "NOT_STARTED":
- return Task_Status.NOT_STARTED;
- case 2:
- case "PENDING":
- return Task_Status.PENDING;
- case 3:
- case "RUNNING":
- return Task_Status.RUNNING;
- case 4:
- case "DONE":
- return Task_Status.DONE;
- case 5:
- case "FAILED":
- return Task_Status.FAILED;
- case 6:
- case "CANCELED":
- return Task_Status.CANCELED;
- case 7:
- case "SKIPPED":
- return Task_Status.SKIPPED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Task_Status.UNRECOGNIZED;
- }
-}
-
-export function task_StatusToJSON(object: Task_Status): string {
- switch (object) {
- case Task_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case Task_Status.NOT_STARTED:
- return "NOT_STARTED";
- case Task_Status.PENDING:
- return "PENDING";
- case Task_Status.RUNNING:
- return "RUNNING";
- case Task_Status.DONE:
- return "DONE";
- case Task_Status.FAILED:
- return "FAILED";
- case Task_Status.CANCELED:
- return "CANCELED";
- case Task_Status.SKIPPED:
- return "SKIPPED";
- case Task_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 = "TYPE_UNSPECIFIED",
- GENERAL = "GENERAL",
- /** DATABASE_CREATE - use payload DatabaseCreate */
- DATABASE_CREATE = "DATABASE_CREATE",
- /** DATABASE_SCHEMA_UPDATE - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE = "DATABASE_SCHEMA_UPDATE",
- /** DATABASE_SCHEMA_UPDATE_SDL - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE_SDL = "DATABASE_SCHEMA_UPDATE_SDL",
- /** DATABASE_SCHEMA_UPDATE_GHOST - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE_GHOST = "DATABASE_SCHEMA_UPDATE_GHOST",
- /** DATABASE_DATA_UPDATE - use payload DatabaseDataUpdate */
- DATABASE_DATA_UPDATE = "DATABASE_DATA_UPDATE",
- /** DATABASE_EXPORT - use payload DatabaseDataExport */
- DATABASE_EXPORT = "DATABASE_EXPORT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function task_TypeFromJSON(object: any): Task_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return Task_Type.TYPE_UNSPECIFIED;
- case 1:
- case "GENERAL":
- return Task_Type.GENERAL;
- case 2:
- case "DATABASE_CREATE":
- return Task_Type.DATABASE_CREATE;
- case 4:
- case "DATABASE_SCHEMA_UPDATE":
- return Task_Type.DATABASE_SCHEMA_UPDATE;
- case 5:
- case "DATABASE_SCHEMA_UPDATE_SDL":
- return Task_Type.DATABASE_SCHEMA_UPDATE_SDL;
- case 9:
- case "DATABASE_SCHEMA_UPDATE_GHOST":
- return Task_Type.DATABASE_SCHEMA_UPDATE_GHOST;
- case 8:
- case "DATABASE_DATA_UPDATE":
- return Task_Type.DATABASE_DATA_UPDATE;
- case 12:
- case "DATABASE_EXPORT":
- return Task_Type.DATABASE_EXPORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Task_Type.UNRECOGNIZED;
- }
-}
-
-export function task_TypeToJSON(object: Task_Type): string {
- switch (object) {
- case Task_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case Task_Type.GENERAL:
- return "GENERAL";
- case Task_Type.DATABASE_CREATE:
- return "DATABASE_CREATE";
- case Task_Type.DATABASE_SCHEMA_UPDATE:
- return "DATABASE_SCHEMA_UPDATE";
- case Task_Type.DATABASE_SCHEMA_UPDATE_SDL:
- return "DATABASE_SCHEMA_UPDATE_SDL";
- case Task_Type.DATABASE_SCHEMA_UPDATE_GHOST:
- return "DATABASE_SCHEMA_UPDATE_GHOST";
- case Task_Type.DATABASE_DATA_UPDATE:
- return "DATABASE_DATA_UPDATE";
- case Task_Type.DATABASE_EXPORT:
- return "DATABASE_EXPORT";
- case Task_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_UPDATE:
- return 4;
- case Task_Type.DATABASE_SCHEMA_UPDATE_SDL:
- return 5;
- case Task_Type.DATABASE_SCHEMA_UPDATE_GHOST:
- return 9;
- case Task_Type.DATABASE_DATA_UPDATE:
- return 8;
- case Task_Type.DATABASE_EXPORT:
- return 12;
- case Task_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface Task_DatabaseCreate {
- /**
- * The project owning the database.
- * Format: projects/{project}
- */
- project: string;
- /** database name */
- database: string;
- /** table name */
- table: string;
- /** Format: projects/{project}/sheets/{sheet} */
- sheet: string;
- characterSet: string;
- collation: string;
- environment: string;
-}
-
-export interface Task_DatabaseSchemaUpdate {
- /** Format: projects/{project}/sheets/{sheet} */
- sheet: string;
- schemaVersion: string;
-}
-
-export interface Task_DatabaseDataUpdate {
- /** Format: projects/{project}/sheets/{sheet} */
- sheet: string;
- schemaVersion: string;
-}
-
-export interface Task_DatabaseDataExport {
- /**
- * The resource name of the target.
- * Format: instances/{instance-id}/databases/{database-name}
- */
- target: string;
- /**
- * The resource name of the sheet.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet: string;
- /** The format of the exported file. */
- format: ExportFormat;
- /**
- * The zip password provide by users.
- * Leave it empty if no needs to encrypt the zip file.
- */
- password?: string | undefined;
-}
-
-export interface TaskRun {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun} */
- name: string;
- /** Format: user/[email protected] */
- creator: string;
- createTime: Timestamp | undefined;
- updateTime: Timestamp | undefined;
- status: TaskRun_Status;
- /** Below are the results of a task run. */
- detail: string;
- /**
- * The resource name of the changelog.
- * Format: instances/{instance}/databases/{database}/changelogs/{changelog}
- */
- changelog: string;
- schemaVersion: string;
- startTime: Timestamp | undefined;
- exportArchiveStatus: TaskRun_ExportArchiveStatus;
- /** The prior backup detail that will be used to rollback the task run. */
- priorBackupDetail: TaskRun_PriorBackupDetail | undefined;
- schedulerInfo:
- | TaskRun_SchedulerInfo
- | undefined;
- /** Format: projects/{project}/sheets/{sheet} */
- sheet: string;
- /**
- * The task run should run after run_time.
- * This can only be set when creating the task run calling BatchRunTasks.
- */
- runTime?: Timestamp | undefined;
-}
-
-export enum TaskRun_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- PENDING = "PENDING",
- RUNNING = "RUNNING",
- DONE = "DONE",
- FAILED = "FAILED",
- CANCELED = "CANCELED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskRun_StatusFromJSON(object: any): TaskRun_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return TaskRun_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return TaskRun_Status.PENDING;
- case 2:
- case "RUNNING":
- return TaskRun_Status.RUNNING;
- case 3:
- case "DONE":
- return TaskRun_Status.DONE;
- case 4:
- case "FAILED":
- return TaskRun_Status.FAILED;
- case 5:
- case "CANCELED":
- return TaskRun_Status.CANCELED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskRun_Status.UNRECOGNIZED;
- }
-}
-
-export function taskRun_StatusToJSON(object: TaskRun_Status): string {
- switch (object) {
- case TaskRun_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case TaskRun_Status.PENDING:
- return "PENDING";
- case TaskRun_Status.RUNNING:
- return "RUNNING";
- case TaskRun_Status.DONE:
- return "DONE";
- case TaskRun_Status.FAILED:
- return "FAILED";
- case TaskRun_Status.CANCELED:
- return "CANCELED";
- case TaskRun_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_ExportArchiveStatus {
- EXPORT_ARCHIVE_STATUS_UNSPECIFIED = "EXPORT_ARCHIVE_STATUS_UNSPECIFIED",
- READY = "READY",
- EXPORTED = "EXPORTED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskRun_ExportArchiveStatusFromJSON(object: any): TaskRun_ExportArchiveStatus {
- switch (object) {
- case 0:
- case "EXPORT_ARCHIVE_STATUS_UNSPECIFIED":
- return TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED;
- case 1:
- case "READY":
- return TaskRun_ExportArchiveStatus.READY;
- case 2:
- case "EXPORTED":
- return TaskRun_ExportArchiveStatus.EXPORTED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskRun_ExportArchiveStatus.UNRECOGNIZED;
- }
-}
-
-export function taskRun_ExportArchiveStatusToJSON(object: TaskRun_ExportArchiveStatus): string {
- switch (object) {
- case TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED:
- return "EXPORT_ARCHIVE_STATUS_UNSPECIFIED";
- case TaskRun_ExportArchiveStatus.READY:
- return "READY";
- case TaskRun_ExportArchiveStatus.EXPORTED:
- return "EXPORTED";
- case TaskRun_ExportArchiveStatus.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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_PriorBackupDetail {
- items: TaskRun_PriorBackupDetail_Item[];
-}
-
-export interface TaskRun_PriorBackupDetail_Item {
- /** The original table information. */
- sourceTable:
- | TaskRun_PriorBackupDetail_Item_Table
- | undefined;
- /** The target backup table information. */
- targetTable: TaskRun_PriorBackupDetail_Item_Table | undefined;
- startPosition: Position | undefined;
- endPosition: Position | undefined;
-}
-
-export interface TaskRun_PriorBackupDetail_Item_Table {
- /**
- * The database information.
- * Format: instances/{instance}/databases/{database}
- */
- database: string;
- schema: string;
- table: string;
-}
-
-export interface TaskRun_SchedulerInfo {
- reportTime: Timestamp | undefined;
- waitingCause: TaskRun_SchedulerInfo_WaitingCause | undefined;
-}
-
-export interface TaskRun_SchedulerInfo_WaitingCause {
- connectionLimit?: boolean | undefined;
- task?: TaskRun_SchedulerInfo_WaitingCause_Task | undefined;
- parallelTasksLimit?: boolean | undefined;
-}
-
-export interface TaskRun_SchedulerInfo_WaitingCause_Task {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task} */
- task: string;
- /** Format: projects/{project}/issues/{issue} */
- issue: string;
-}
-
-export interface TaskRunLog {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/log */
- name: string;
- entries: TaskRunLogEntry[];
-}
-
-export interface TaskRunLogEntry {
- type: TaskRunLogEntry_Type;
- logTime: Timestamp | undefined;
- deployId: string;
- schemaDump: TaskRunLogEntry_SchemaDump | undefined;
- commandExecute: TaskRunLogEntry_CommandExecute | undefined;
- databaseSync: TaskRunLogEntry_DatabaseSync | undefined;
- taskRunStatusUpdate: TaskRunLogEntry_TaskRunStatusUpdate | undefined;
- transactionControl: TaskRunLogEntry_TransactionControl | undefined;
- priorBackup: TaskRunLogEntry_PriorBackup | undefined;
- retryInfo: TaskRunLogEntry_RetryInfo | undefined;
-}
-
-export enum TaskRunLogEntry_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- SCHEMA_DUMP = "SCHEMA_DUMP",
- COMMAND_EXECUTE = "COMMAND_EXECUTE",
- DATABASE_SYNC = "DATABASE_SYNC",
- TASK_RUN_STATUS_UPDATE = "TASK_RUN_STATUS_UPDATE",
- TRANSACTION_CONTROL = "TRANSACTION_CONTROL",
- PRIOR_BACKUP = "PRIOR_BACKUP",
- RETRY_INFO = "RETRY_INFO",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskRunLogEntry_TypeFromJSON(object: any): TaskRunLogEntry_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return TaskRunLogEntry_Type.TYPE_UNSPECIFIED;
- case 1:
- case "SCHEMA_DUMP":
- return TaskRunLogEntry_Type.SCHEMA_DUMP;
- case 2:
- case "COMMAND_EXECUTE":
- return TaskRunLogEntry_Type.COMMAND_EXECUTE;
- case 3:
- case "DATABASE_SYNC":
- return TaskRunLogEntry_Type.DATABASE_SYNC;
- case 4:
- case "TASK_RUN_STATUS_UPDATE":
- return TaskRunLogEntry_Type.TASK_RUN_STATUS_UPDATE;
- case 5:
- case "TRANSACTION_CONTROL":
- return TaskRunLogEntry_Type.TRANSACTION_CONTROL;
- case 6:
- case "PRIOR_BACKUP":
- return TaskRunLogEntry_Type.PRIOR_BACKUP;
- case 7:
- case "RETRY_INFO":
- return TaskRunLogEntry_Type.RETRY_INFO;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskRunLogEntry_Type.UNRECOGNIZED;
- }
-}
-
-export function taskRunLogEntry_TypeToJSON(object: TaskRunLogEntry_Type): string {
- switch (object) {
- case TaskRunLogEntry_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case TaskRunLogEntry_Type.SCHEMA_DUMP:
- return "SCHEMA_DUMP";
- case TaskRunLogEntry_Type.COMMAND_EXECUTE:
- return "COMMAND_EXECUTE";
- case TaskRunLogEntry_Type.DATABASE_SYNC:
- return "DATABASE_SYNC";
- case TaskRunLogEntry_Type.TASK_RUN_STATUS_UPDATE:
- return "TASK_RUN_STATUS_UPDATE";
- case TaskRunLogEntry_Type.TRANSACTION_CONTROL:
- return "TRANSACTION_CONTROL";
- case TaskRunLogEntry_Type.PRIOR_BACKUP:
- return "PRIOR_BACKUP";
- case TaskRunLogEntry_Type.RETRY_INFO:
- return "RETRY_INFO";
- case TaskRunLogEntry_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function taskRunLogEntry_TypeToNumber(object: TaskRunLogEntry_Type): number {
- switch (object) {
- case TaskRunLogEntry_Type.TYPE_UNSPECIFIED:
- return 0;
- case TaskRunLogEntry_Type.SCHEMA_DUMP:
- return 1;
- case TaskRunLogEntry_Type.COMMAND_EXECUTE:
- return 2;
- case TaskRunLogEntry_Type.DATABASE_SYNC:
- return 3;
- case TaskRunLogEntry_Type.TASK_RUN_STATUS_UPDATE:
- return 4;
- case TaskRunLogEntry_Type.TRANSACTION_CONTROL:
- return 5;
- case TaskRunLogEntry_Type.PRIOR_BACKUP:
- return 6;
- case TaskRunLogEntry_Type.RETRY_INFO:
- return 7;
- case TaskRunLogEntry_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface TaskRunLogEntry_SchemaDump {
- startTime: Timestamp | undefined;
- endTime: Timestamp | undefined;
- error: string;
-}
-
-export interface TaskRunLogEntry_CommandExecute {
- logTime:
- | Timestamp
- | undefined;
- /** The indexes of the executed commands. */
- commandIndexes: number[];
- response: TaskRunLogEntry_CommandExecute_CommandResponse | undefined;
-}
-
-export interface TaskRunLogEntry_CommandExecute_CommandResponse {
- logTime: Timestamp | undefined;
- error: string;
- affectedRows: number;
- /**
- * `all_affected_rows` is the affected rows of each command.
- * `all_affected_rows` may be unavailable if the database driver doesn't support it. Caller should fallback to `affected_rows` in that case.
- */
- allAffectedRows: number[];
-}
-
-export interface TaskRunLogEntry_DatabaseSync {
- startTime: Timestamp | undefined;
- endTime: Timestamp | undefined;
- error: string;
-}
-
-export interface TaskRunLogEntry_TaskRunStatusUpdate {
- status: TaskRunLogEntry_TaskRunStatusUpdate_Status;
-}
-
-export enum TaskRunLogEntry_TaskRunStatusUpdate_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- /** RUNNING_WAITING - the task run is ready to be executed by the scheduler */
- RUNNING_WAITING = "RUNNING_WAITING",
- /** RUNNING_RUNNING - the task run is being executed by the scheduler */
- RUNNING_RUNNING = "RUNNING_RUNNING",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskRunLogEntry_TaskRunStatusUpdate_StatusFromJSON(
- object: any,
-): TaskRunLogEntry_TaskRunStatusUpdate_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED;
- case 1:
- case "RUNNING_WAITING":
- return TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_WAITING;
- case 2:
- case "RUNNING_RUNNING":
- return TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_RUNNING;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskRunLogEntry_TaskRunStatusUpdate_Status.UNRECOGNIZED;
- }
-}
-
-export function taskRunLogEntry_TaskRunStatusUpdate_StatusToJSON(
- object: TaskRunLogEntry_TaskRunStatusUpdate_Status,
-): string {
- switch (object) {
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_WAITING:
- return "RUNNING_WAITING";
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_RUNNING:
- return "RUNNING_RUNNING";
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function taskRunLogEntry_TaskRunStatusUpdate_StatusToNumber(
- object: TaskRunLogEntry_TaskRunStatusUpdate_Status,
-): number {
- switch (object) {
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED:
- return 0;
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_WAITING:
- return 1;
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.RUNNING_RUNNING:
- return 2;
- case TaskRunLogEntry_TaskRunStatusUpdate_Status.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface TaskRunLogEntry_TransactionControl {
- type: TaskRunLogEntry_TransactionControl_Type;
- error: string;
-}
-
-export enum TaskRunLogEntry_TransactionControl_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- BEGIN = "BEGIN",
- COMMIT = "COMMIT",
- ROLLBACK = "ROLLBACK",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function taskRunLogEntry_TransactionControl_TypeFromJSON(object: any): TaskRunLogEntry_TransactionControl_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED;
- case 1:
- case "BEGIN":
- return TaskRunLogEntry_TransactionControl_Type.BEGIN;
- case 2:
- case "COMMIT":
- return TaskRunLogEntry_TransactionControl_Type.COMMIT;
- case 3:
- case "ROLLBACK":
- return TaskRunLogEntry_TransactionControl_Type.ROLLBACK;
- case -1:
- case "UNRECOGNIZED":
- default:
- return TaskRunLogEntry_TransactionControl_Type.UNRECOGNIZED;
- }
-}
-
-export function taskRunLogEntry_TransactionControl_TypeToJSON(object: TaskRunLogEntry_TransactionControl_Type): string {
- switch (object) {
- case TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case TaskRunLogEntry_TransactionControl_Type.BEGIN:
- return "BEGIN";
- case TaskRunLogEntry_TransactionControl_Type.COMMIT:
- return "COMMIT";
- case TaskRunLogEntry_TransactionControl_Type.ROLLBACK:
- return "ROLLBACK";
- case TaskRunLogEntry_TransactionControl_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function taskRunLogEntry_TransactionControl_TypeToNumber(
- object: TaskRunLogEntry_TransactionControl_Type,
-): number {
- switch (object) {
- case TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED:
- return 0;
- case TaskRunLogEntry_TransactionControl_Type.BEGIN:
- return 1;
- case TaskRunLogEntry_TransactionControl_Type.COMMIT:
- return 2;
- case TaskRunLogEntry_TransactionControl_Type.ROLLBACK:
- return 3;
- case TaskRunLogEntry_TransactionControl_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface TaskRunLogEntry_PriorBackup {
- startTime: Timestamp | undefined;
- endTime: Timestamp | undefined;
- priorBackupDetail: TaskRun_PriorBackupDetail | undefined;
- error: string;
-}
-
-export interface TaskRunLogEntry_RetryInfo {
- error: string;
- retryCount: number;
- maximumRetries: number;
-}
-
-export interface GetTaskRunSessionRequest {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun} */
- parent: string;
-}
-
-export interface TaskRunSession {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/session */
- name: string;
- postgres?: TaskRunSession_Postgres | undefined;
-}
-
-export interface TaskRunSession_Postgres {
- /** `session` is the session of the task run executing commands. */
- session:
- | TaskRunSession_Postgres_Session
- | undefined;
- /** `blocking_sessions` block `session`. */
- blockingSessions: TaskRunSession_Postgres_Session[];
- /** `blocked_sessions` are blocked by `session`. */
- blockedSessions: TaskRunSession_Postgres_Session[];
-}
-
-/** Read from `pg_stat_activity` */
-export interface TaskRunSession_Postgres_Session {
- pid: string;
- blockedByPids: string[];
- query: string;
- state?: string | undefined;
- waitEventType?: string | undefined;
- waitEvent?: string | undefined;
- datname?: string | undefined;
- usename?: string | undefined;
- applicationName: string;
- clientAddr?: string | undefined;
- clientPort?: string | undefined;
- backendStart: Timestamp | undefined;
- xactStart?: Timestamp | undefined;
- queryStart?: Timestamp | undefined;
-}
-
-export interface PreviewTaskRunRollbackRequest {
- /** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskRuns/{taskRun} */
- name: string;
-}
-
-export interface PreviewTaskRunRollbackResponse {
- statement: string;
-}
-
-function createBaseBatchRunTasksRequest(): BatchRunTasksRequest {
- return { parent: "", tasks: [], reason: "", runTime: undefined };
-}
-
-export const BatchRunTasksRequest: MessageFns<BatchRunTasksRequest> = {
- encode(message: BatchRunTasksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.tasks) {
- writer.uint32(18).string(v!);
- }
- if (message.reason !== "") {
- writer.uint32(26).string(message.reason);
- }
- if (message.runTime !== undefined) {
- Timestamp.encode(message.runTime, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchRunTasksRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchRunTasksRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tasks.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.reason = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.runTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchRunTasksRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
- runTime: isSet(object.runTime) ? fromJsonTimestamp(object.runTime) : undefined,
- };
- },
-
- toJSON(message: BatchRunTasksRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.tasks?.length) {
- obj.tasks = message.tasks;
- }
- if (message.reason !== "") {
- obj.reason = message.reason;
- }
- if (message.runTime !== undefined) {
- obj.runTime = fromTimestamp(message.runTime).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchRunTasksRequest>): BatchRunTasksRequest {
- return BatchRunTasksRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchRunTasksRequest>): BatchRunTasksRequest {
- const message = createBaseBatchRunTasksRequest();
- message.parent = object.parent ?? "";
- message.tasks = object.tasks?.map((e) => e) || [];
- message.reason = object.reason ?? "";
- message.runTime = (object.runTime !== undefined && object.runTime !== null)
- ? Timestamp.fromPartial(object.runTime)
- : undefined;
- return message;
- },
-};
-
-function createBaseBatchRunTasksResponse(): BatchRunTasksResponse {
- return {};
-}
-
-export const BatchRunTasksResponse: MessageFns<BatchRunTasksResponse> = {
- encode(_: BatchRunTasksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchRunTasksResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchRunTasksResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchRunTasksResponse {
- return {};
- },
-
- toJSON(_: BatchRunTasksResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchRunTasksResponse>): BatchRunTasksResponse {
- return BatchRunTasksResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchRunTasksResponse>): BatchRunTasksResponse {
- const message = createBaseBatchRunTasksResponse();
- return message;
- },
-};
-
-function createBaseBatchSkipTasksRequest(): BatchSkipTasksRequest {
- return { parent: "", tasks: [], reason: "" };
-}
-
-export const BatchSkipTasksRequest: MessageFns<BatchSkipTasksRequest> = {
- encode(message: BatchSkipTasksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.tasks) {
- writer.uint32(18).string(v!);
- }
- if (message.reason !== "") {
- writer.uint32(26).string(message.reason);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSkipTasksRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSkipTasksRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.tasks.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.reason = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchSkipTasksRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
- };
- },
-
- toJSON(message: BatchSkipTasksRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.tasks?.length) {
- obj.tasks = message.tasks;
- }
- if (message.reason !== "") {
- obj.reason = message.reason;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchSkipTasksRequest>): BatchSkipTasksRequest {
- return BatchSkipTasksRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchSkipTasksRequest>): BatchSkipTasksRequest {
- const message = createBaseBatchSkipTasksRequest();
- message.parent = object.parent ?? "";
- message.tasks = object.tasks?.map((e) => e) || [];
- message.reason = object.reason ?? "";
- return message;
- },
-};
-
-function createBaseBatchSkipTasksResponse(): BatchSkipTasksResponse {
- return {};
-}
-
-export const BatchSkipTasksResponse: MessageFns<BatchSkipTasksResponse> = {
- encode(_: BatchSkipTasksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchSkipTasksResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchSkipTasksResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchSkipTasksResponse {
- return {};
- },
-
- toJSON(_: BatchSkipTasksResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchSkipTasksResponse>): BatchSkipTasksResponse {
- return BatchSkipTasksResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchSkipTasksResponse>): BatchSkipTasksResponse {
- const message = createBaseBatchSkipTasksResponse();
- return message;
- },
-};
-
-function createBaseBatchCancelTaskRunsRequest(): BatchCancelTaskRunsRequest {
- return { parent: "", taskRuns: [], reason: "" };
-}
-
-export const BatchCancelTaskRunsRequest: MessageFns<BatchCancelTaskRunsRequest> = {
- encode(message: BatchCancelTaskRunsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.taskRuns) {
- writer.uint32(18).string(v!);
- }
- if (message.reason !== "") {
- writer.uint32(26).string(message.reason);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelTaskRunsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCancelTaskRunsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.taskRuns.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.reason = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCancelTaskRunsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- taskRuns: globalThis.Array.isArray(object?.taskRuns) ? object.taskRuns.map((e: any) => globalThis.String(e)) : [],
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
- };
- },
-
- toJSON(message: BatchCancelTaskRunsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.taskRuns?.length) {
- obj.taskRuns = message.taskRuns;
- }
- if (message.reason !== "") {
- obj.reason = message.reason;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCancelTaskRunsRequest>): BatchCancelTaskRunsRequest {
- return BatchCancelTaskRunsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCancelTaskRunsRequest>): BatchCancelTaskRunsRequest {
- const message = createBaseBatchCancelTaskRunsRequest();
- message.parent = object.parent ?? "";
- message.taskRuns = object.taskRuns?.map((e) => e) || [];
- message.reason = object.reason ?? "";
- return message;
- },
-};
-
-function createBaseBatchCancelTaskRunsResponse(): BatchCancelTaskRunsResponse {
- return {};
-}
-
-export const BatchCancelTaskRunsResponse: MessageFns<BatchCancelTaskRunsResponse> = {
- encode(_: BatchCancelTaskRunsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelTaskRunsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCancelTaskRunsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): BatchCancelTaskRunsResponse {
- return {};
- },
-
- toJSON(_: BatchCancelTaskRunsResponse): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<BatchCancelTaskRunsResponse>): BatchCancelTaskRunsResponse {
- return BatchCancelTaskRunsResponse.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<BatchCancelTaskRunsResponse>): BatchCancelTaskRunsResponse {
- const message = createBaseBatchCancelTaskRunsResponse();
- return message;
- },
-};
-
-function createBaseGetRolloutRequest(): GetRolloutRequest {
- return { name: "" };
-}
-
-export const GetRolloutRequest: MessageFns<GetRolloutRequest> = {
- encode(message: GetRolloutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetRolloutRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetRolloutRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetRolloutRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetRolloutRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetRolloutRequest>): GetRolloutRequest {
- return GetRolloutRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetRolloutRequest>): GetRolloutRequest {
- const message = createBaseGetRolloutRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseListRolloutsRequest(): ListRolloutsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListRolloutsRequest: MessageFns<ListRolloutsRequest> = {
- encode(message: ListRolloutsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRolloutsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRolloutsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRolloutsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListRolloutsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRolloutsRequest>): ListRolloutsRequest {
- return ListRolloutsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRolloutsRequest>): ListRolloutsRequest {
- const message = createBaseListRolloutsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListRolloutsResponse(): ListRolloutsResponse {
- return { rollouts: [], nextPageToken: "" };
-}
-
-export const ListRolloutsResponse: MessageFns<ListRolloutsResponse> = {
- encode(message: ListRolloutsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.rollouts) {
- Rollout.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListRolloutsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListRolloutsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.rollouts.push(Rollout.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListRolloutsResponse {
- return {
- rollouts: globalThis.Array.isArray(object?.rollouts) ? object.rollouts.map((e: any) => Rollout.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListRolloutsResponse): unknown {
- const obj: any = {};
- if (message.rollouts?.length) {
- obj.rollouts = message.rollouts.map((e) => Rollout.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListRolloutsResponse>): ListRolloutsResponse {
- return ListRolloutsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListRolloutsResponse>): ListRolloutsResponse {
- const message = createBaseListRolloutsResponse();
- message.rollouts = object.rollouts?.map((e) => Rollout.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateRolloutRequest(): CreateRolloutRequest {
- return { parent: "", rollout: undefined, target: undefined, validateOnly: false };
-}
-
-export const CreateRolloutRequest: MessageFns<CreateRolloutRequest> = {
- encode(message: CreateRolloutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.rollout !== undefined) {
- Rollout.encode(message.rollout, writer.uint32(18).fork()).join();
- }
- if (message.target !== undefined) {
- writer.uint32(26).string(message.target);
- }
- if (message.validateOnly !== false) {
- writer.uint32(32).bool(message.validateOnly);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateRolloutRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateRolloutRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.rollout = Rollout.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateRolloutRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- rollout: isSet(object.rollout) ? Rollout.fromJSON(object.rollout) : undefined,
- target: isSet(object.target) ? globalThis.String(object.target) : undefined,
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- };
- },
-
- toJSON(message: CreateRolloutRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.rollout !== undefined) {
- obj.rollout = Rollout.toJSON(message.rollout);
- }
- if (message.target !== undefined) {
- obj.target = message.target;
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateRolloutRequest>): CreateRolloutRequest {
- return CreateRolloutRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateRolloutRequest>): CreateRolloutRequest {
- const message = createBaseCreateRolloutRequest();
- message.parent = object.parent ?? "";
- message.rollout = (object.rollout !== undefined && object.rollout !== null)
- ? Rollout.fromPartial(object.rollout)
- : undefined;
- message.target = object.target ?? undefined;
- message.validateOnly = object.validateOnly ?? false;
- return message;
- },
-};
-
-function createBasePreviewRolloutRequest(): PreviewRolloutRequest {
- return { project: "", plan: undefined };
-}
-
-export const PreviewRolloutRequest: MessageFns<PreviewRolloutRequest> = {
- encode(message: PreviewRolloutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== "") {
- writer.uint32(10).string(message.project);
- }
- if (message.plan !== undefined) {
- Plan.encode(message.plan, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PreviewRolloutRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePreviewRolloutRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.plan = Plan.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PreviewRolloutRequest {
- return {
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
- };
- },
-
- toJSON(message: PreviewRolloutRequest): unknown {
- const obj: any = {};
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.plan !== undefined) {
- obj.plan = Plan.toJSON(message.plan);
- }
- return obj;
- },
-
- create(base?: DeepPartial<PreviewRolloutRequest>): PreviewRolloutRequest {
- return PreviewRolloutRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PreviewRolloutRequest>): PreviewRolloutRequest {
- const message = createBasePreviewRolloutRequest();
- message.project = object.project ?? "";
- message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined;
- return message;
- },
-};
-
-function createBaseListTaskRunsRequest(): ListTaskRunsRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListTaskRunsRequest: MessageFns<ListTaskRunsRequest> = {
- encode(message: ListTaskRunsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListTaskRunsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListTaskRunsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListTaskRunsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListTaskRunsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListTaskRunsRequest>): ListTaskRunsRequest {
- return ListTaskRunsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListTaskRunsRequest>): ListTaskRunsRequest {
- const message = createBaseListTaskRunsRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListTaskRunsResponse(): ListTaskRunsResponse {
- return { taskRuns: [], nextPageToken: "" };
-}
-
-export const ListTaskRunsResponse: MessageFns<ListTaskRunsResponse> = {
- encode(message: ListTaskRunsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.taskRuns) {
- TaskRun.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListTaskRunsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListTaskRunsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.taskRuns.push(TaskRun.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListTaskRunsResponse {
- return {
- taskRuns: globalThis.Array.isArray(object?.taskRuns) ? object.taskRuns.map((e: any) => TaskRun.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListTaskRunsResponse): unknown {
- const obj: any = {};
- if (message.taskRuns?.length) {
- obj.taskRuns = message.taskRuns.map((e) => TaskRun.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListTaskRunsResponse>): ListTaskRunsResponse {
- return ListTaskRunsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListTaskRunsResponse>): ListTaskRunsResponse {
- const message = createBaseListTaskRunsResponse();
- message.taskRuns = object.taskRuns?.map((e) => TaskRun.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseGetTaskRunRequest(): GetTaskRunRequest {
- return { name: "" };
-}
-
-export const GetTaskRunRequest: MessageFns<GetTaskRunRequest> = {
- encode(message: GetTaskRunRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetTaskRunRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetTaskRunRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetTaskRunRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetTaskRunRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetTaskRunRequest>): GetTaskRunRequest {
- return GetTaskRunRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetTaskRunRequest>): GetTaskRunRequest {
- const message = createBaseGetTaskRunRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseGetTaskRunLogRequest(): GetTaskRunLogRequest {
- return { parent: "" };
-}
-
-export const GetTaskRunLogRequest: MessageFns<GetTaskRunLogRequest> = {
- encode(message: GetTaskRunLogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetTaskRunLogRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetTaskRunLogRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetTaskRunLogRequest {
- return { parent: isSet(object.parent) ? globalThis.String(object.parent) : "" };
- },
-
- toJSON(message: GetTaskRunLogRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetTaskRunLogRequest>): GetTaskRunLogRequest {
- return GetTaskRunLogRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetTaskRunLogRequest>): GetTaskRunLogRequest {
- const message = createBaseGetTaskRunLogRequest();
- message.parent = object.parent ?? "";
- return message;
- },
-};
-
-function createBaseRollout(): Rollout {
- return { name: "", plan: "", title: "", stages: [], creator: "", createTime: undefined, issue: "" };
-}
-
-export const Rollout: MessageFns<Rollout> = {
- encode(message: Rollout, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.plan !== "") {
- writer.uint32(26).string(message.plan);
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- for (const v of message.stages) {
- Stage.encode(v!, writer.uint32(42).fork()).join();
- }
- if (message.creator !== "") {
- writer.uint32(50).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(58).fork()).join();
- }
- if (message.issue !== "") {
- writer.uint32(74).string(message.issue);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Rollout {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRollout();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.plan = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.stages.push(Stage.decode(reader, reader.uint32()));
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.issue = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Rollout {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- plan: isSet(object.plan) ? globalThis.String(object.plan) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- stages: globalThis.Array.isArray(object?.stages) ? object.stages.map((e: any) => Stage.fromJSON(e)) : [],
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
- };
- },
-
- toJSON(message: Rollout): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.plan !== "") {
- obj.plan = message.plan;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.stages?.length) {
- obj.stages = message.stages.map((e) => Stage.toJSON(e));
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.issue !== "") {
- obj.issue = message.issue;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Rollout>): Rollout {
- return Rollout.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Rollout>): Rollout {
- const message = createBaseRollout();
- message.name = object.name ?? "";
- message.plan = object.plan ?? "";
- message.title = object.title ?? "";
- message.stages = object.stages?.map((e) => Stage.fromPartial(e)) || [];
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.issue = object.issue ?? "";
- return message;
- },
-};
-
-function createBaseStage(): Stage {
- return { name: "", id: "", environment: "", tasks: [] };
-}
-
-export const Stage: MessageFns<Stage> = {
- encode(message: Stage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.id !== "") {
- writer.uint32(26).string(message.id);
- }
- if (message.environment !== "") {
- writer.uint32(34).string(message.environment);
- }
- for (const v of message.tasks) {
- Task.encode(v!, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Stage {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseStage();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.tasks.push(Task.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Stage {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => Task.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: Stage): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- if (message.tasks?.length) {
- obj.tasks = message.tasks.map((e) => Task.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Stage>): Stage {
- return Stage.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Stage>): Stage {
- const message = createBaseStage();
- message.name = object.name ?? "";
- message.id = object.id ?? "";
- message.environment = object.environment ?? "";
- message.tasks = object.tasks?.map((e) => Task.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTask(): Task {
- return {
- name: "",
- specId: "",
- status: Task_Status.STATUS_UNSPECIFIED,
- skippedReason: "",
- type: Task_Type.TYPE_UNSPECIFIED,
- target: "",
- databaseCreate: undefined,
- databaseSchemaUpdate: undefined,
- databaseDataUpdate: undefined,
- databaseDataExport: undefined,
- };
-}
-
-export const Task: MessageFns<Task> = {
- encode(message: Task, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.specId !== "") {
- writer.uint32(34).string(message.specId);
- }
- 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 !== Task_Type.TYPE_UNSPECIFIED) {
- writer.uint32(48).int32(task_TypeToNumber(message.type));
- }
- if (message.target !== "") {
- writer.uint32(66).string(message.target);
- }
- if (message.databaseCreate !== undefined) {
- Task_DatabaseCreate.encode(message.databaseCreate, writer.uint32(74).fork()).join();
- }
- if (message.databaseSchemaUpdate !== undefined) {
- Task_DatabaseSchemaUpdate.encode(message.databaseSchemaUpdate, writer.uint32(90).fork()).join();
- }
- if (message.databaseDataUpdate !== undefined) {
- Task_DatabaseDataUpdate.encode(message.databaseDataUpdate, writer.uint32(98).fork()).join();
- }
- if (message.databaseDataExport !== undefined) {
- Task_DatabaseDataExport.encode(message.databaseDataExport, writer.uint32(130).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Task {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.specId = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.status = task_StatusFromJSON(reader.int32());
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.skippedReason = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.type = task_TypeFromJSON(reader.int32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.databaseCreate = Task_DatabaseCreate.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.databaseSchemaUpdate = Task_DatabaseSchemaUpdate.decode(reader, reader.uint32());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.databaseDataUpdate = Task_DatabaseDataUpdate.decode(reader, reader.uint32());
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.databaseDataExport = Task_DatabaseDataExport.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Task {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- specId: isSet(object.specId) ? globalThis.String(object.specId) : "",
- status: isSet(object.status) ? task_StatusFromJSON(object.status) : Task_Status.STATUS_UNSPECIFIED,
- skippedReason: isSet(object.skippedReason) ? globalThis.String(object.skippedReason) : "",
- type: isSet(object.type) ? task_TypeFromJSON(object.type) : Task_Type.TYPE_UNSPECIFIED,
- target: isSet(object.target) ? globalThis.String(object.target) : "",
- databaseCreate: isSet(object.databaseCreate) ? Task_DatabaseCreate.fromJSON(object.databaseCreate) : undefined,
- databaseSchemaUpdate: isSet(object.databaseSchemaUpdate)
- ? Task_DatabaseSchemaUpdate.fromJSON(object.databaseSchemaUpdate)
- : undefined,
- databaseDataUpdate: isSet(object.databaseDataUpdate)
- ? Task_DatabaseDataUpdate.fromJSON(object.databaseDataUpdate)
- : undefined,
- databaseDataExport: isSet(object.databaseDataExport)
- ? Task_DatabaseDataExport.fromJSON(object.databaseDataExport)
- : undefined,
- };
- },
-
- toJSON(message: Task): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.specId !== "") {
- obj.specId = message.specId;
- }
- if (message.status !== Task_Status.STATUS_UNSPECIFIED) {
- obj.status = task_StatusToJSON(message.status);
- }
- if (message.skippedReason !== "") {
- obj.skippedReason = message.skippedReason;
- }
- if (message.type !== Task_Type.TYPE_UNSPECIFIED) {
- obj.type = task_TypeToJSON(message.type);
- }
- if (message.target !== "") {
- obj.target = message.target;
- }
- if (message.databaseCreate !== undefined) {
- obj.databaseCreate = Task_DatabaseCreate.toJSON(message.databaseCreate);
- }
- if (message.databaseSchemaUpdate !== undefined) {
- obj.databaseSchemaUpdate = Task_DatabaseSchemaUpdate.toJSON(message.databaseSchemaUpdate);
- }
- if (message.databaseDataUpdate !== undefined) {
- obj.databaseDataUpdate = Task_DatabaseDataUpdate.toJSON(message.databaseDataUpdate);
- }
- if (message.databaseDataExport !== undefined) {
- obj.databaseDataExport = Task_DatabaseDataExport.toJSON(message.databaseDataExport);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Task>): Task {
- return Task.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Task>): Task {
- const message = createBaseTask();
- message.name = object.name ?? "";
- message.specId = object.specId ?? "";
- message.status = object.status ?? Task_Status.STATUS_UNSPECIFIED;
- message.skippedReason = object.skippedReason ?? "";
- message.type = object.type ?? Task_Type.TYPE_UNSPECIFIED;
- message.target = object.target ?? "";
- message.databaseCreate = (object.databaseCreate !== undefined && object.databaseCreate !== null)
- ? Task_DatabaseCreate.fromPartial(object.databaseCreate)
- : undefined;
- message.databaseSchemaUpdate = (object.databaseSchemaUpdate !== undefined && object.databaseSchemaUpdate !== null)
- ? Task_DatabaseSchemaUpdate.fromPartial(object.databaseSchemaUpdate)
- : undefined;
- message.databaseDataUpdate = (object.databaseDataUpdate !== undefined && object.databaseDataUpdate !== null)
- ? Task_DatabaseDataUpdate.fromPartial(object.databaseDataUpdate)
- : undefined;
- message.databaseDataExport = (object.databaseDataExport !== undefined && object.databaseDataExport !== null)
- ? Task_DatabaseDataExport.fromPartial(object.databaseDataExport)
- : undefined;
- return message;
- },
-};
-
-function createBaseTask_DatabaseCreate(): Task_DatabaseCreate {
- return { project: "", database: "", table: "", sheet: "", characterSet: "", collation: "", environment: "" };
-}
-
-export const Task_DatabaseCreate: MessageFns<Task_DatabaseCreate> = {
- encode(message: Task_DatabaseCreate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.project !== "") {
- writer.uint32(10).string(message.project);
- }
- if (message.database !== "") {
- writer.uint32(18).string(message.database);
- }
- if (message.table !== "") {
- writer.uint32(26).string(message.table);
- }
- if (message.sheet !== "") {
- writer.uint32(34).string(message.sheet);
- }
- if (message.characterSet !== "") {
- writer.uint32(42).string(message.characterSet);
- }
- if (message.collation !== "") {
- writer.uint32(50).string(message.collation);
- }
- if (message.environment !== "") {
- writer.uint32(58).string(message.environment);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Task_DatabaseCreate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTask_DatabaseCreate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.characterSet = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.collation = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.environment = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Task_DatabaseCreate {
- return {
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
- collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
- environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
- };
- },
-
- toJSON(message: Task_DatabaseCreate): unknown {
- const obj: any = {};
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.characterSet !== "") {
- obj.characterSet = message.characterSet;
- }
- if (message.collation !== "") {
- obj.collation = message.collation;
- }
- if (message.environment !== "") {
- obj.environment = message.environment;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Task_DatabaseCreate>): Task_DatabaseCreate {
- return Task_DatabaseCreate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Task_DatabaseCreate>): Task_DatabaseCreate {
- const message = createBaseTask_DatabaseCreate();
- message.project = object.project ?? "";
- message.database = object.database ?? "";
- message.table = object.table ?? "";
- message.sheet = object.sheet ?? "";
- message.characterSet = object.characterSet ?? "";
- message.collation = object.collation ?? "";
- message.environment = object.environment ?? "";
- return message;
- },
-};
-
-function createBaseTask_DatabaseSchemaUpdate(): Task_DatabaseSchemaUpdate {
- return { sheet: "", schemaVersion: "" };
-}
-
-export const Task_DatabaseSchemaUpdate: MessageFns<Task_DatabaseSchemaUpdate> = {
- encode(message: Task_DatabaseSchemaUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sheet !== "") {
- writer.uint32(10).string(message.sheet);
- }
- if (message.schemaVersion !== "") {
- writer.uint32(18).string(message.schemaVersion);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Task_DatabaseSchemaUpdate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTask_DatabaseSchemaUpdate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemaVersion = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Task_DatabaseSchemaUpdate {
- return {
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
- };
- },
-
- toJSON(message: Task_DatabaseSchemaUpdate): unknown {
- const obj: any = {};
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.schemaVersion !== "") {
- obj.schemaVersion = message.schemaVersion;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Task_DatabaseSchemaUpdate>): Task_DatabaseSchemaUpdate {
- return Task_DatabaseSchemaUpdate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Task_DatabaseSchemaUpdate>): Task_DatabaseSchemaUpdate {
- const message = createBaseTask_DatabaseSchemaUpdate();
- message.sheet = object.sheet ?? "";
- message.schemaVersion = object.schemaVersion ?? "";
- return message;
- },
-};
-
-function createBaseTask_DatabaseDataUpdate(): Task_DatabaseDataUpdate {
- return { sheet: "", schemaVersion: "" };
-}
-
-export const Task_DatabaseDataUpdate: MessageFns<Task_DatabaseDataUpdate> = {
- encode(message: Task_DatabaseDataUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sheet !== "") {
- writer.uint32(10).string(message.sheet);
- }
- if (message.schemaVersion !== "") {
- writer.uint32(18).string(message.schemaVersion);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Task_DatabaseDataUpdate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTask_DatabaseDataUpdate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemaVersion = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Task_DatabaseDataUpdate {
- return {
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
- };
- },
-
- toJSON(message: Task_DatabaseDataUpdate): unknown {
- const obj: any = {};
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.schemaVersion !== "") {
- obj.schemaVersion = message.schemaVersion;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Task_DatabaseDataUpdate>): Task_DatabaseDataUpdate {
- return Task_DatabaseDataUpdate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Task_DatabaseDataUpdate>): Task_DatabaseDataUpdate {
- const message = createBaseTask_DatabaseDataUpdate();
- message.sheet = object.sheet ?? "";
- message.schemaVersion = object.schemaVersion ?? "";
- return message;
- },
-};
-
-function createBaseTask_DatabaseDataExport(): Task_DatabaseDataExport {
- return { target: "", sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };
-}
-
-export const Task_DatabaseDataExport: MessageFns<Task_DatabaseDataExport> = {
- encode(message: Task_DatabaseDataExport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.target !== "") {
- writer.uint32(10).string(message.target);
- }
- if (message.sheet !== "") {
- writer.uint32(18).string(message.sheet);
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- writer.uint32(24).int32(exportFormatToNumber(message.format));
- }
- if (message.password !== undefined) {
- writer.uint32(34).string(message.password);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Task_DatabaseDataExport {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTask_DatabaseDataExport();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.target = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.format = exportFormatFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Task_DatabaseDataExport {
- return {
- target: isSet(object.target) ? globalThis.String(object.target) : "",
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
- password: isSet(object.password) ? globalThis.String(object.password) : undefined,
- };
- },
-
- toJSON(message: Task_DatabaseDataExport): unknown {
- const obj: any = {};
- if (message.target !== "") {
- obj.target = message.target;
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- obj.format = exportFormatToJSON(message.format);
- }
- if (message.password !== undefined) {
- obj.password = message.password;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Task_DatabaseDataExport>): Task_DatabaseDataExport {
- return Task_DatabaseDataExport.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Task_DatabaseDataExport>): Task_DatabaseDataExport {
- const message = createBaseTask_DatabaseDataExport();
- message.target = object.target ?? "";
- message.sheet = object.sheet ?? "";
- message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
- message.password = object.password ?? undefined;
- return message;
- },
-};
-
-function createBaseTaskRun(): TaskRun {
- return {
- name: "",
- creator: "",
- createTime: undefined,
- updateTime: undefined,
- status: TaskRun_Status.STATUS_UNSPECIFIED,
- detail: "",
- changelog: "",
- schemaVersion: "",
- startTime: undefined,
- exportArchiveStatus: TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED,
- priorBackupDetail: undefined,
- schedulerInfo: undefined,
- sheet: "",
- runTime: undefined,
- };
-}
-
-export const TaskRun: MessageFns<TaskRun> = {
- encode(message: TaskRun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.creator !== "") {
- writer.uint32(26).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(42).fork()).join();
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(50).fork()).join();
- }
- if (message.status !== TaskRun_Status.STATUS_UNSPECIFIED) {
- writer.uint32(64).int32(taskRun_StatusToNumber(message.status));
- }
- if (message.detail !== "") {
- writer.uint32(74).string(message.detail);
- }
- if (message.changelog !== "") {
- writer.uint32(162).string(message.changelog);
- }
- if (message.schemaVersion !== "") {
- writer.uint32(90).string(message.schemaVersion);
- }
- if (message.startTime !== undefined) {
- Timestamp.encode(message.startTime, writer.uint32(114).fork()).join();
- }
- if (message.exportArchiveStatus !== TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED) {
- writer.uint32(128).int32(taskRun_ExportArchiveStatusToNumber(message.exportArchiveStatus));
- }
- if (message.priorBackupDetail !== undefined) {
- TaskRun_PriorBackupDetail.encode(message.priorBackupDetail, writer.uint32(138).fork()).join();
- }
- if (message.schedulerInfo !== undefined) {
- TaskRun_SchedulerInfo.encode(message.schedulerInfo, writer.uint32(146).fork()).join();
- }
- if (message.sheet !== "") {
- writer.uint32(154).string(message.sheet);
- }
- if (message.runTime !== undefined) {
- Timestamp.encode(message.runTime, writer.uint32(170).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.status = taskRun_StatusFromJSON(reader.int32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.detail = reader.string();
- continue;
- }
- case 20: {
- if (tag !== 162) {
- break;
- }
-
- message.changelog = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.schemaVersion = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.startTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
-
- message.exportArchiveStatus = taskRun_ExportArchiveStatusFromJSON(reader.int32());
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.priorBackupDetail = TaskRun_PriorBackupDetail.decode(reader, reader.uint32());
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.schedulerInfo = TaskRun_SchedulerInfo.decode(reader, reader.uint32());
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- }
- case 21: {
- if (tag !== 170) {
- break;
- }
-
- message.runTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- status: isSet(object.status) ? taskRun_StatusFromJSON(object.status) : TaskRun_Status.STATUS_UNSPECIFIED,
- detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
- changelog: isSet(object.changelog) ? globalThis.String(object.changelog) : "",
- schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
- startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
- exportArchiveStatus: isSet(object.exportArchiveStatus)
- ? taskRun_ExportArchiveStatusFromJSON(object.exportArchiveStatus)
- : TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED,
- priorBackupDetail: isSet(object.priorBackupDetail)
- ? TaskRun_PriorBackupDetail.fromJSON(object.priorBackupDetail)
- : undefined,
- schedulerInfo: isSet(object.schedulerInfo) ? TaskRun_SchedulerInfo.fromJSON(object.schedulerInfo) : undefined,
- sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- runTime: isSet(object.runTime) ? fromJsonTimestamp(object.runTime) : undefined,
- };
- },
-
- toJSON(message: TaskRun): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.status !== TaskRun_Status.STATUS_UNSPECIFIED) {
- obj.status = taskRun_StatusToJSON(message.status);
- }
- if (message.detail !== "") {
- obj.detail = message.detail;
- }
- if (message.changelog !== "") {
- obj.changelog = message.changelog;
- }
- if (message.schemaVersion !== "") {
- obj.schemaVersion = message.schemaVersion;
- }
- if (message.startTime !== undefined) {
- obj.startTime = fromTimestamp(message.startTime).toISOString();
- }
- if (message.exportArchiveStatus !== TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED) {
- obj.exportArchiveStatus = taskRun_ExportArchiveStatusToJSON(message.exportArchiveStatus);
- }
- if (message.priorBackupDetail !== undefined) {
- obj.priorBackupDetail = TaskRun_PriorBackupDetail.toJSON(message.priorBackupDetail);
- }
- if (message.schedulerInfo !== undefined) {
- obj.schedulerInfo = TaskRun_SchedulerInfo.toJSON(message.schedulerInfo);
- }
- if (message.sheet !== "") {
- obj.sheet = message.sheet;
- }
- if (message.runTime !== undefined) {
- obj.runTime = fromTimestamp(message.runTime).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun>): TaskRun {
- return TaskRun.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun>): TaskRun {
- const message = createBaseTaskRun();
- message.name = object.name ?? "";
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.status = object.status ?? TaskRun_Status.STATUS_UNSPECIFIED;
- message.detail = object.detail ?? "";
- message.changelog = object.changelog ?? "";
- message.schemaVersion = object.schemaVersion ?? "";
- message.startTime = (object.startTime !== undefined && object.startTime !== null)
- ? Timestamp.fromPartial(object.startTime)
- : undefined;
- message.exportArchiveStatus = object.exportArchiveStatus ??
- TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED;
- message.priorBackupDetail = (object.priorBackupDetail !== undefined && object.priorBackupDetail !== null)
- ? TaskRun_PriorBackupDetail.fromPartial(object.priorBackupDetail)
- : undefined;
- message.schedulerInfo = (object.schedulerInfo !== undefined && object.schedulerInfo !== null)
- ? TaskRun_SchedulerInfo.fromPartial(object.schedulerInfo)
- : undefined;
- message.sheet = object.sheet ?? "";
- message.runTime = (object.runTime !== undefined && object.runTime !== null)
- ? Timestamp.fromPartial(object.runTime)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRun_PriorBackupDetail(): TaskRun_PriorBackupDetail {
- return { items: [] };
-}
-
-export const TaskRun_PriorBackupDetail: MessageFns<TaskRun_PriorBackupDetail> = {
- encode(message: TaskRun_PriorBackupDetail, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.items) {
- TaskRun_PriorBackupDetail_Item.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_PriorBackupDetail {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_PriorBackupDetail();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.items.push(TaskRun_PriorBackupDetail_Item.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_PriorBackupDetail {
- return {
- items: globalThis.Array.isArray(object?.items)
- ? object.items.map((e: any) => TaskRun_PriorBackupDetail_Item.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: TaskRun_PriorBackupDetail): unknown {
- const obj: any = {};
- if (message.items?.length) {
- obj.items = message.items.map((e) => TaskRun_PriorBackupDetail_Item.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_PriorBackupDetail>): TaskRun_PriorBackupDetail {
- return TaskRun_PriorBackupDetail.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_PriorBackupDetail>): TaskRun_PriorBackupDetail {
- const message = createBaseTaskRun_PriorBackupDetail();
- message.items = object.items?.map((e) => TaskRun_PriorBackupDetail_Item.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTaskRun_PriorBackupDetail_Item(): TaskRun_PriorBackupDetail_Item {
- return { sourceTable: undefined, targetTable: undefined, startPosition: undefined, endPosition: undefined };
-}
-
-export const TaskRun_PriorBackupDetail_Item: MessageFns<TaskRun_PriorBackupDetail_Item> = {
- encode(message: TaskRun_PriorBackupDetail_Item, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sourceTable !== undefined) {
- TaskRun_PriorBackupDetail_Item_Table.encode(message.sourceTable, writer.uint32(10).fork()).join();
- }
- if (message.targetTable !== undefined) {
- TaskRun_PriorBackupDetail_Item_Table.encode(message.targetTable, writer.uint32(18).fork()).join();
- }
- if (message.startPosition !== undefined) {
- Position.encode(message.startPosition, writer.uint32(26).fork()).join();
- }
- if (message.endPosition !== undefined) {
- Position.encode(message.endPosition, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_PriorBackupDetail_Item {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_PriorBackupDetail_Item();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sourceTable = TaskRun_PriorBackupDetail_Item_Table.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.targetTable = TaskRun_PriorBackupDetail_Item_Table.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.startPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.endPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_PriorBackupDetail_Item {
- return {
- sourceTable: isSet(object.sourceTable)
- ? TaskRun_PriorBackupDetail_Item_Table.fromJSON(object.sourceTable)
- : undefined,
- targetTable: isSet(object.targetTable)
- ? TaskRun_PriorBackupDetail_Item_Table.fromJSON(object.targetTable)
- : undefined,
- startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
- endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
- };
- },
-
- toJSON(message: TaskRun_PriorBackupDetail_Item): unknown {
- const obj: any = {};
- if (message.sourceTable !== undefined) {
- obj.sourceTable = TaskRun_PriorBackupDetail_Item_Table.toJSON(message.sourceTable);
- }
- if (message.targetTable !== undefined) {
- obj.targetTable = TaskRun_PriorBackupDetail_Item_Table.toJSON(message.targetTable);
- }
- if (message.startPosition !== undefined) {
- obj.startPosition = Position.toJSON(message.startPosition);
- }
- if (message.endPosition !== undefined) {
- obj.endPosition = Position.toJSON(message.endPosition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_PriorBackupDetail_Item>): TaskRun_PriorBackupDetail_Item {
- return TaskRun_PriorBackupDetail_Item.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_PriorBackupDetail_Item>): TaskRun_PriorBackupDetail_Item {
- const message = createBaseTaskRun_PriorBackupDetail_Item();
- message.sourceTable = (object.sourceTable !== undefined && object.sourceTable !== null)
- ? TaskRun_PriorBackupDetail_Item_Table.fromPartial(object.sourceTable)
- : undefined;
- message.targetTable = (object.targetTable !== undefined && object.targetTable !== null)
- ? TaskRun_PriorBackupDetail_Item_Table.fromPartial(object.targetTable)
- : undefined;
- message.startPosition = (object.startPosition !== undefined && object.startPosition !== null)
- ? Position.fromPartial(object.startPosition)
- : undefined;
- message.endPosition = (object.endPosition !== undefined && object.endPosition !== null)
- ? Position.fromPartial(object.endPosition)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRun_PriorBackupDetail_Item_Table(): TaskRun_PriorBackupDetail_Item_Table {
- return { database: "", schema: "", table: "" };
-}
-
-export const TaskRun_PriorBackupDetail_Item_Table: MessageFns<TaskRun_PriorBackupDetail_Item_Table> = {
- encode(message: TaskRun_PriorBackupDetail_Item_Table, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.database !== "") {
- writer.uint32(10).string(message.database);
- }
- if (message.schema !== "") {
- writer.uint32(18).string(message.schema);
- }
- if (message.table !== "") {
- writer.uint32(26).string(message.table);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_PriorBackupDetail_Item_Table {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_PriorBackupDetail_Item_Table();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.table = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_PriorBackupDetail_Item_Table {
- return {
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
- table: isSet(object.table) ? globalThis.String(object.table) : "",
- };
- },
-
- toJSON(message: TaskRun_PriorBackupDetail_Item_Table): unknown {
- const obj: any = {};
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.schema !== "") {
- obj.schema = message.schema;
- }
- if (message.table !== "") {
- obj.table = message.table;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_PriorBackupDetail_Item_Table>): TaskRun_PriorBackupDetail_Item_Table {
- return TaskRun_PriorBackupDetail_Item_Table.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_PriorBackupDetail_Item_Table>): TaskRun_PriorBackupDetail_Item_Table {
- const message = createBaseTaskRun_PriorBackupDetail_Item_Table();
- message.database = object.database ?? "";
- message.schema = object.schema ?? "";
- message.table = object.table ?? "";
- return message;
- },
-};
-
-function createBaseTaskRun_SchedulerInfo(): TaskRun_SchedulerInfo {
- return { reportTime: undefined, waitingCause: undefined };
-}
-
-export const TaskRun_SchedulerInfo: MessageFns<TaskRun_SchedulerInfo> = {
- encode(message: TaskRun_SchedulerInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.reportTime !== undefined) {
- Timestamp.encode(message.reportTime, writer.uint32(10).fork()).join();
- }
- if (message.waitingCause !== undefined) {
- TaskRun_SchedulerInfo_WaitingCause.encode(message.waitingCause, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_SchedulerInfo {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_SchedulerInfo();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.reportTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.waitingCause = TaskRun_SchedulerInfo_WaitingCause.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_SchedulerInfo {
- return {
- reportTime: isSet(object.reportTime) ? fromJsonTimestamp(object.reportTime) : undefined,
- waitingCause: isSet(object.waitingCause)
- ? TaskRun_SchedulerInfo_WaitingCause.fromJSON(object.waitingCause)
- : undefined,
- };
- },
-
- toJSON(message: TaskRun_SchedulerInfo): unknown {
- const obj: any = {};
- if (message.reportTime !== undefined) {
- obj.reportTime = fromTimestamp(message.reportTime).toISOString();
- }
- if (message.waitingCause !== undefined) {
- obj.waitingCause = TaskRun_SchedulerInfo_WaitingCause.toJSON(message.waitingCause);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_SchedulerInfo>): TaskRun_SchedulerInfo {
- return TaskRun_SchedulerInfo.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_SchedulerInfo>): TaskRun_SchedulerInfo {
- const message = createBaseTaskRun_SchedulerInfo();
- message.reportTime = (object.reportTime !== undefined && object.reportTime !== null)
- ? Timestamp.fromPartial(object.reportTime)
- : undefined;
- message.waitingCause = (object.waitingCause !== undefined && object.waitingCause !== null)
- ? TaskRun_SchedulerInfo_WaitingCause.fromPartial(object.waitingCause)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRun_SchedulerInfo_WaitingCause(): TaskRun_SchedulerInfo_WaitingCause {
- return { connectionLimit: undefined, task: undefined, parallelTasksLimit: undefined };
-}
-
-export const TaskRun_SchedulerInfo_WaitingCause: MessageFns<TaskRun_SchedulerInfo_WaitingCause> = {
- encode(message: TaskRun_SchedulerInfo_WaitingCause, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.connectionLimit !== undefined) {
- writer.uint32(8).bool(message.connectionLimit);
- }
- if (message.task !== undefined) {
- TaskRun_SchedulerInfo_WaitingCause_Task.encode(message.task, writer.uint32(18).fork()).join();
- }
- if (message.parallelTasksLimit !== undefined) {
- writer.uint32(24).bool(message.parallelTasksLimit);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_SchedulerInfo_WaitingCause {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_SchedulerInfo_WaitingCause();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.connectionLimit = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.task = TaskRun_SchedulerInfo_WaitingCause_Task.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.parallelTasksLimit = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_SchedulerInfo_WaitingCause {
- return {
- connectionLimit: isSet(object.connectionLimit) ? globalThis.Boolean(object.connectionLimit) : undefined,
- task: isSet(object.task) ? TaskRun_SchedulerInfo_WaitingCause_Task.fromJSON(object.task) : undefined,
- parallelTasksLimit: isSet(object.parallelTasksLimit) ? globalThis.Boolean(object.parallelTasksLimit) : undefined,
- };
- },
-
- toJSON(message: TaskRun_SchedulerInfo_WaitingCause): unknown {
- const obj: any = {};
- if (message.connectionLimit !== undefined) {
- obj.connectionLimit = message.connectionLimit;
- }
- if (message.task !== undefined) {
- obj.task = TaskRun_SchedulerInfo_WaitingCause_Task.toJSON(message.task);
- }
- if (message.parallelTasksLimit !== undefined) {
- obj.parallelTasksLimit = message.parallelTasksLimit;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_SchedulerInfo_WaitingCause>): TaskRun_SchedulerInfo_WaitingCause {
- return TaskRun_SchedulerInfo_WaitingCause.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_SchedulerInfo_WaitingCause>): TaskRun_SchedulerInfo_WaitingCause {
- const message = createBaseTaskRun_SchedulerInfo_WaitingCause();
- message.connectionLimit = object.connectionLimit ?? undefined;
- message.task = (object.task !== undefined && object.task !== null)
- ? TaskRun_SchedulerInfo_WaitingCause_Task.fromPartial(object.task)
- : undefined;
- message.parallelTasksLimit = object.parallelTasksLimit ?? undefined;
- return message;
- },
-};
-
-function createBaseTaskRun_SchedulerInfo_WaitingCause_Task(): TaskRun_SchedulerInfo_WaitingCause_Task {
- return { task: "", issue: "" };
-}
-
-export const TaskRun_SchedulerInfo_WaitingCause_Task: MessageFns<TaskRun_SchedulerInfo_WaitingCause_Task> = {
- encode(message: TaskRun_SchedulerInfo_WaitingCause_Task, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.task !== "") {
- writer.uint32(10).string(message.task);
- }
- if (message.issue !== "") {
- writer.uint32(18).string(message.issue);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRun_SchedulerInfo_WaitingCause_Task {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRun_SchedulerInfo_WaitingCause_Task();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.task = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.issue = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRun_SchedulerInfo_WaitingCause_Task {
- return {
- task: isSet(object.task) ? globalThis.String(object.task) : "",
- issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
- };
- },
-
- toJSON(message: TaskRun_SchedulerInfo_WaitingCause_Task): unknown {
- const obj: any = {};
- if (message.task !== "") {
- obj.task = message.task;
- }
- if (message.issue !== "") {
- obj.issue = message.issue;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRun_SchedulerInfo_WaitingCause_Task>): TaskRun_SchedulerInfo_WaitingCause_Task {
- return TaskRun_SchedulerInfo_WaitingCause_Task.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRun_SchedulerInfo_WaitingCause_Task>): TaskRun_SchedulerInfo_WaitingCause_Task {
- const message = createBaseTaskRun_SchedulerInfo_WaitingCause_Task();
- message.task = object.task ?? "";
- message.issue = object.issue ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunLog(): TaskRunLog {
- return { name: "", entries: [] };
-}
-
-export const TaskRunLog: MessageFns<TaskRunLog> = {
- encode(message: TaskRunLog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- for (const v of message.entries) {
- TaskRunLogEntry.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLog {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLog();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.entries.push(TaskRunLogEntry.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLog {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- entries: globalThis.Array.isArray(object?.entries)
- ? object.entries.map((e: any) => TaskRunLogEntry.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: TaskRunLog): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.entries?.length) {
- obj.entries = message.entries.map((e) => TaskRunLogEntry.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLog>): TaskRunLog {
- return TaskRunLog.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLog>): TaskRunLog {
- const message = createBaseTaskRunLog();
- message.name = object.name ?? "";
- message.entries = object.entries?.map((e) => TaskRunLogEntry.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry(): TaskRunLogEntry {
- return {
- type: TaskRunLogEntry_Type.TYPE_UNSPECIFIED,
- logTime: undefined,
- deployId: "",
- schemaDump: undefined,
- commandExecute: undefined,
- databaseSync: undefined,
- taskRunStatusUpdate: undefined,
- transactionControl: undefined,
- priorBackup: undefined,
- retryInfo: undefined,
- };
-}
-
-export const TaskRunLogEntry: MessageFns<TaskRunLogEntry> = {
- encode(message: TaskRunLogEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== TaskRunLogEntry_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(taskRunLogEntry_TypeToNumber(message.type));
- }
- if (message.logTime !== undefined) {
- Timestamp.encode(message.logTime, writer.uint32(50).fork()).join();
- }
- if (message.deployId !== "") {
- writer.uint32(98).string(message.deployId);
- }
- if (message.schemaDump !== undefined) {
- TaskRunLogEntry_SchemaDump.encode(message.schemaDump, writer.uint32(18).fork()).join();
- }
- if (message.commandExecute !== undefined) {
- TaskRunLogEntry_CommandExecute.encode(message.commandExecute, writer.uint32(26).fork()).join();
- }
- if (message.databaseSync !== undefined) {
- TaskRunLogEntry_DatabaseSync.encode(message.databaseSync, writer.uint32(34).fork()).join();
- }
- if (message.taskRunStatusUpdate !== undefined) {
- TaskRunLogEntry_TaskRunStatusUpdate.encode(message.taskRunStatusUpdate, writer.uint32(42).fork()).join();
- }
- if (message.transactionControl !== undefined) {
- TaskRunLogEntry_TransactionControl.encode(message.transactionControl, writer.uint32(58).fork()).join();
- }
- if (message.priorBackup !== undefined) {
- TaskRunLogEntry_PriorBackup.encode(message.priorBackup, writer.uint32(66).fork()).join();
- }
- if (message.retryInfo !== undefined) {
- TaskRunLogEntry_RetryInfo.encode(message.retryInfo, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = taskRunLogEntry_TypeFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.logTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.deployId = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.schemaDump = TaskRunLogEntry_SchemaDump.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.commandExecute = TaskRunLogEntry_CommandExecute.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.databaseSync = TaskRunLogEntry_DatabaseSync.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.taskRunStatusUpdate = TaskRunLogEntry_TaskRunStatusUpdate.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.transactionControl = TaskRunLogEntry_TransactionControl.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.priorBackup = TaskRunLogEntry_PriorBackup.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.retryInfo = TaskRunLogEntry_RetryInfo.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry {
- return {
- type: isSet(object.type) ? taskRunLogEntry_TypeFromJSON(object.type) : TaskRunLogEntry_Type.TYPE_UNSPECIFIED,
- logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
- deployId: isSet(object.deployId) ? globalThis.String(object.deployId) : "",
- schemaDump: isSet(object.schemaDump) ? TaskRunLogEntry_SchemaDump.fromJSON(object.schemaDump) : undefined,
- commandExecute: isSet(object.commandExecute)
- ? TaskRunLogEntry_CommandExecute.fromJSON(object.commandExecute)
- : undefined,
- databaseSync: isSet(object.databaseSync) ? TaskRunLogEntry_DatabaseSync.fromJSON(object.databaseSync) : undefined,
- taskRunStatusUpdate: isSet(object.taskRunStatusUpdate)
- ? TaskRunLogEntry_TaskRunStatusUpdate.fromJSON(object.taskRunStatusUpdate)
- : undefined,
- transactionControl: isSet(object.transactionControl)
- ? TaskRunLogEntry_TransactionControl.fromJSON(object.transactionControl)
- : undefined,
- priorBackup: isSet(object.priorBackup) ? TaskRunLogEntry_PriorBackup.fromJSON(object.priorBackup) : undefined,
- retryInfo: isSet(object.retryInfo) ? TaskRunLogEntry_RetryInfo.fromJSON(object.retryInfo) : undefined,
- };
- },
-
- toJSON(message: TaskRunLogEntry): unknown {
- const obj: any = {};
- if (message.type !== TaskRunLogEntry_Type.TYPE_UNSPECIFIED) {
- obj.type = taskRunLogEntry_TypeToJSON(message.type);
- }
- if (message.logTime !== undefined) {
- obj.logTime = fromTimestamp(message.logTime).toISOString();
- }
- if (message.deployId !== "") {
- obj.deployId = message.deployId;
- }
- if (message.schemaDump !== undefined) {
- obj.schemaDump = TaskRunLogEntry_SchemaDump.toJSON(message.schemaDump);
- }
- if (message.commandExecute !== undefined) {
- obj.commandExecute = TaskRunLogEntry_CommandExecute.toJSON(message.commandExecute);
- }
- if (message.databaseSync !== undefined) {
- obj.databaseSync = TaskRunLogEntry_DatabaseSync.toJSON(message.databaseSync);
- }
- if (message.taskRunStatusUpdate !== undefined) {
- obj.taskRunStatusUpdate = TaskRunLogEntry_TaskRunStatusUpdate.toJSON(message.taskRunStatusUpdate);
- }
- if (message.transactionControl !== undefined) {
- obj.transactionControl = TaskRunLogEntry_TransactionControl.toJSON(message.transactionControl);
- }
- if (message.priorBackup !== undefined) {
- obj.priorBackup = TaskRunLogEntry_PriorBackup.toJSON(message.priorBackup);
- }
- if (message.retryInfo !== undefined) {
- obj.retryInfo = TaskRunLogEntry_RetryInfo.toJSON(message.retryInfo);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry>): TaskRunLogEntry {
- return TaskRunLogEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry>): TaskRunLogEntry {
- const message = createBaseTaskRunLogEntry();
- message.type = object.type ?? TaskRunLogEntry_Type.TYPE_UNSPECIFIED;
- message.logTime = (object.logTime !== undefined && object.logTime !== null)
- ? Timestamp.fromPartial(object.logTime)
- : undefined;
- message.deployId = object.deployId ?? "";
- message.schemaDump = (object.schemaDump !== undefined && object.schemaDump !== null)
- ? TaskRunLogEntry_SchemaDump.fromPartial(object.schemaDump)
- : undefined;
- message.commandExecute = (object.commandExecute !== undefined && object.commandExecute !== null)
- ? TaskRunLogEntry_CommandExecute.fromPartial(object.commandExecute)
- : undefined;
- message.databaseSync = (object.databaseSync !== undefined && object.databaseSync !== null)
- ? TaskRunLogEntry_DatabaseSync.fromPartial(object.databaseSync)
- : undefined;
- message.taskRunStatusUpdate = (object.taskRunStatusUpdate !== undefined && object.taskRunStatusUpdate !== null)
- ? TaskRunLogEntry_TaskRunStatusUpdate.fromPartial(object.taskRunStatusUpdate)
- : undefined;
- message.transactionControl = (object.transactionControl !== undefined && object.transactionControl !== null)
- ? TaskRunLogEntry_TransactionControl.fromPartial(object.transactionControl)
- : undefined;
- message.priorBackup = (object.priorBackup !== undefined && object.priorBackup !== null)
- ? TaskRunLogEntry_PriorBackup.fromPartial(object.priorBackup)
- : undefined;
- message.retryInfo = (object.retryInfo !== undefined && object.retryInfo !== null)
- ? TaskRunLogEntry_RetryInfo.fromPartial(object.retryInfo)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_SchemaDump(): TaskRunLogEntry_SchemaDump {
- return { startTime: undefined, endTime: undefined, error: "" };
-}
-
-export const TaskRunLogEntry_SchemaDump: MessageFns<TaskRunLogEntry_SchemaDump> = {
- encode(message: TaskRunLogEntry_SchemaDump, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.startTime !== undefined) {
- Timestamp.encode(message.startTime, writer.uint32(10).fork()).join();
- }
- if (message.endTime !== undefined) {
- Timestamp.encode(message.endTime, writer.uint32(18).fork()).join();
- }
- if (message.error !== "") {
- writer.uint32(26).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_SchemaDump {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_SchemaDump();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.startTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.endTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_SchemaDump {
- return {
- startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
- endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- };
- },
-
- toJSON(message: TaskRunLogEntry_SchemaDump): unknown {
- const obj: any = {};
- if (message.startTime !== undefined) {
- obj.startTime = fromTimestamp(message.startTime).toISOString();
- }
- if (message.endTime !== undefined) {
- obj.endTime = fromTimestamp(message.endTime).toISOString();
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_SchemaDump>): TaskRunLogEntry_SchemaDump {
- return TaskRunLogEntry_SchemaDump.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_SchemaDump>): TaskRunLogEntry_SchemaDump {
- const message = createBaseTaskRunLogEntry_SchemaDump();
- message.startTime = (object.startTime !== undefined && object.startTime !== null)
- ? Timestamp.fromPartial(object.startTime)
- : undefined;
- message.endTime = (object.endTime !== undefined && object.endTime !== null)
- ? Timestamp.fromPartial(object.endTime)
- : undefined;
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_CommandExecute(): TaskRunLogEntry_CommandExecute {
- return { logTime: undefined, commandIndexes: [], response: undefined };
-}
-
-export const TaskRunLogEntry_CommandExecute: MessageFns<TaskRunLogEntry_CommandExecute> = {
- encode(message: TaskRunLogEntry_CommandExecute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.logTime !== undefined) {
- Timestamp.encode(message.logTime, writer.uint32(10).fork()).join();
- }
- writer.uint32(18).fork();
- for (const v of message.commandIndexes) {
- writer.int32(v);
- }
- writer.join();
- if (message.response !== undefined) {
- TaskRunLogEntry_CommandExecute_CommandResponse.encode(message.response, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_CommandExecute {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_CommandExecute();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.logTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag === 16) {
- message.commandIndexes.push(reader.int32());
-
- continue;
- }
-
- if (tag === 18) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.commandIndexes.push(reader.int32());
- }
-
- continue;
- }
-
- break;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.response = TaskRunLogEntry_CommandExecute_CommandResponse.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_CommandExecute {
- return {
- logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
- commandIndexes: globalThis.Array.isArray(object?.commandIndexes)
- ? object.commandIndexes.map((e: any) => globalThis.Number(e))
- : [],
- response: isSet(object.response)
- ? TaskRunLogEntry_CommandExecute_CommandResponse.fromJSON(object.response)
- : undefined,
- };
- },
-
- toJSON(message: TaskRunLogEntry_CommandExecute): unknown {
- const obj: any = {};
- if (message.logTime !== undefined) {
- obj.logTime = fromTimestamp(message.logTime).toISOString();
- }
- if (message.commandIndexes?.length) {
- obj.commandIndexes = message.commandIndexes.map((e) => Math.round(e));
- }
- if (message.response !== undefined) {
- obj.response = TaskRunLogEntry_CommandExecute_CommandResponse.toJSON(message.response);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_CommandExecute>): TaskRunLogEntry_CommandExecute {
- return TaskRunLogEntry_CommandExecute.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_CommandExecute>): TaskRunLogEntry_CommandExecute {
- const message = createBaseTaskRunLogEntry_CommandExecute();
- message.logTime = (object.logTime !== undefined && object.logTime !== null)
- ? Timestamp.fromPartial(object.logTime)
- : undefined;
- message.commandIndexes = object.commandIndexes?.map((e) => e) || [];
- message.response = (object.response !== undefined && object.response !== null)
- ? TaskRunLogEntry_CommandExecute_CommandResponse.fromPartial(object.response)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_CommandExecute_CommandResponse(): TaskRunLogEntry_CommandExecute_CommandResponse {
- return { logTime: undefined, error: "", affectedRows: 0, allAffectedRows: [] };
-}
-
-export const TaskRunLogEntry_CommandExecute_CommandResponse: MessageFns<
- TaskRunLogEntry_CommandExecute_CommandResponse
-> = {
- encode(
- message: TaskRunLogEntry_CommandExecute_CommandResponse,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.logTime !== undefined) {
- Timestamp.encode(message.logTime, writer.uint32(10).fork()).join();
- }
- if (message.error !== "") {
- writer.uint32(18).string(message.error);
- }
- if (message.affectedRows !== 0) {
- writer.uint32(24).int32(message.affectedRows);
- }
- writer.uint32(34).fork();
- for (const v of message.allAffectedRows) {
- writer.int32(v);
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_CommandExecute_CommandResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_CommandExecute_CommandResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.logTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.affectedRows = reader.int32();
- continue;
- }
- case 4: {
- if (tag === 32) {
- message.allAffectedRows.push(reader.int32());
-
- continue;
- }
-
- if (tag === 34) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.allAffectedRows.push(reader.int32());
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_CommandExecute_CommandResponse {
- return {
- logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
- allAffectedRows: globalThis.Array.isArray(object?.allAffectedRows)
- ? object.allAffectedRows.map((e: any) => globalThis.Number(e))
- : [],
- };
- },
-
- toJSON(message: TaskRunLogEntry_CommandExecute_CommandResponse): unknown {
- const obj: any = {};
- if (message.logTime !== undefined) {
- obj.logTime = fromTimestamp(message.logTime).toISOString();
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- if (message.affectedRows !== 0) {
- obj.affectedRows = Math.round(message.affectedRows);
- }
- if (message.allAffectedRows?.length) {
- obj.allAffectedRows = message.allAffectedRows.map((e) => Math.round(e));
- }
- return obj;
- },
-
- create(
- base?: DeepPartial<TaskRunLogEntry_CommandExecute_CommandResponse>,
- ): TaskRunLogEntry_CommandExecute_CommandResponse {
- return TaskRunLogEntry_CommandExecute_CommandResponse.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<TaskRunLogEntry_CommandExecute_CommandResponse>,
- ): TaskRunLogEntry_CommandExecute_CommandResponse {
- const message = createBaseTaskRunLogEntry_CommandExecute_CommandResponse();
- message.logTime = (object.logTime !== undefined && object.logTime !== null)
- ? Timestamp.fromPartial(object.logTime)
- : undefined;
- message.error = object.error ?? "";
- message.affectedRows = object.affectedRows ?? 0;
- message.allAffectedRows = object.allAffectedRows?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_DatabaseSync(): TaskRunLogEntry_DatabaseSync {
- return { startTime: undefined, endTime: undefined, error: "" };
-}
-
-export const TaskRunLogEntry_DatabaseSync: MessageFns<TaskRunLogEntry_DatabaseSync> = {
- encode(message: TaskRunLogEntry_DatabaseSync, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.startTime !== undefined) {
- Timestamp.encode(message.startTime, writer.uint32(10).fork()).join();
- }
- if (message.endTime !== undefined) {
- Timestamp.encode(message.endTime, writer.uint32(18).fork()).join();
- }
- if (message.error !== "") {
- writer.uint32(26).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_DatabaseSync {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_DatabaseSync();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.startTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.endTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_DatabaseSync {
- return {
- startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
- endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- };
- },
-
- toJSON(message: TaskRunLogEntry_DatabaseSync): unknown {
- const obj: any = {};
- if (message.startTime !== undefined) {
- obj.startTime = fromTimestamp(message.startTime).toISOString();
- }
- if (message.endTime !== undefined) {
- obj.endTime = fromTimestamp(message.endTime).toISOString();
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_DatabaseSync>): TaskRunLogEntry_DatabaseSync {
- return TaskRunLogEntry_DatabaseSync.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_DatabaseSync>): TaskRunLogEntry_DatabaseSync {
- const message = createBaseTaskRunLogEntry_DatabaseSync();
- message.startTime = (object.startTime !== undefined && object.startTime !== null)
- ? Timestamp.fromPartial(object.startTime)
- : undefined;
- message.endTime = (object.endTime !== undefined && object.endTime !== null)
- ? Timestamp.fromPartial(object.endTime)
- : undefined;
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_TaskRunStatusUpdate(): TaskRunLogEntry_TaskRunStatusUpdate {
- return { status: TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED };
-}
-
-export const TaskRunLogEntry_TaskRunStatusUpdate: MessageFns<TaskRunLogEntry_TaskRunStatusUpdate> = {
- encode(message: TaskRunLogEntry_TaskRunStatusUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.status !== TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED) {
- writer.uint32(8).int32(taskRunLogEntry_TaskRunStatusUpdate_StatusToNumber(message.status));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_TaskRunStatusUpdate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_TaskRunStatusUpdate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.status = taskRunLogEntry_TaskRunStatusUpdate_StatusFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_TaskRunStatusUpdate {
- return {
- status: isSet(object.status)
- ? taskRunLogEntry_TaskRunStatusUpdate_StatusFromJSON(object.status)
- : TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED,
- };
- },
-
- toJSON(message: TaskRunLogEntry_TaskRunStatusUpdate): unknown {
- const obj: any = {};
- if (message.status !== TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED) {
- obj.status = taskRunLogEntry_TaskRunStatusUpdate_StatusToJSON(message.status);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_TaskRunStatusUpdate>): TaskRunLogEntry_TaskRunStatusUpdate {
- return TaskRunLogEntry_TaskRunStatusUpdate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_TaskRunStatusUpdate>): TaskRunLogEntry_TaskRunStatusUpdate {
- const message = createBaseTaskRunLogEntry_TaskRunStatusUpdate();
- message.status = object.status ?? TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_TransactionControl(): TaskRunLogEntry_TransactionControl {
- return { type: TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED, error: "" };
-}
-
-export const TaskRunLogEntry_TransactionControl: MessageFns<TaskRunLogEntry_TransactionControl> = {
- encode(message: TaskRunLogEntry_TransactionControl, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(taskRunLogEntry_TransactionControl_TypeToNumber(message.type));
- }
- if (message.error !== "") {
- writer.uint32(18).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_TransactionControl {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_TransactionControl();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = taskRunLogEntry_TransactionControl_TypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_TransactionControl {
- return {
- type: isSet(object.type)
- ? taskRunLogEntry_TransactionControl_TypeFromJSON(object.type)
- : TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED,
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- };
- },
-
- toJSON(message: TaskRunLogEntry_TransactionControl): unknown {
- const obj: any = {};
- if (message.type !== TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED) {
- obj.type = taskRunLogEntry_TransactionControl_TypeToJSON(message.type);
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_TransactionControl>): TaskRunLogEntry_TransactionControl {
- return TaskRunLogEntry_TransactionControl.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_TransactionControl>): TaskRunLogEntry_TransactionControl {
- const message = createBaseTaskRunLogEntry_TransactionControl();
- message.type = object.type ?? TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED;
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_PriorBackup(): TaskRunLogEntry_PriorBackup {
- return { startTime: undefined, endTime: undefined, priorBackupDetail: undefined, error: "" };
-}
-
-export const TaskRunLogEntry_PriorBackup: MessageFns<TaskRunLogEntry_PriorBackup> = {
- encode(message: TaskRunLogEntry_PriorBackup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.startTime !== undefined) {
- Timestamp.encode(message.startTime, writer.uint32(10).fork()).join();
- }
- if (message.endTime !== undefined) {
- Timestamp.encode(message.endTime, writer.uint32(18).fork()).join();
- }
- if (message.priorBackupDetail !== undefined) {
- TaskRun_PriorBackupDetail.encode(message.priorBackupDetail, writer.uint32(26).fork()).join();
- }
- if (message.error !== "") {
- writer.uint32(34).string(message.error);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_PriorBackup {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_PriorBackup();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.startTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.endTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.priorBackupDetail = TaskRun_PriorBackupDetail.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_PriorBackup {
- return {
- startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
- endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
- priorBackupDetail: isSet(object.priorBackupDetail)
- ? TaskRun_PriorBackupDetail.fromJSON(object.priorBackupDetail)
- : undefined,
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- };
- },
-
- toJSON(message: TaskRunLogEntry_PriorBackup): unknown {
- const obj: any = {};
- if (message.startTime !== undefined) {
- obj.startTime = fromTimestamp(message.startTime).toISOString();
- }
- if (message.endTime !== undefined) {
- obj.endTime = fromTimestamp(message.endTime).toISOString();
- }
- if (message.priorBackupDetail !== undefined) {
- obj.priorBackupDetail = TaskRun_PriorBackupDetail.toJSON(message.priorBackupDetail);
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_PriorBackup>): TaskRunLogEntry_PriorBackup {
- return TaskRunLogEntry_PriorBackup.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_PriorBackup>): TaskRunLogEntry_PriorBackup {
- const message = createBaseTaskRunLogEntry_PriorBackup();
- message.startTime = (object.startTime !== undefined && object.startTime !== null)
- ? Timestamp.fromPartial(object.startTime)
- : undefined;
- message.endTime = (object.endTime !== undefined && object.endTime !== null)
- ? Timestamp.fromPartial(object.endTime)
- : undefined;
- message.priorBackupDetail = (object.priorBackupDetail !== undefined && object.priorBackupDetail !== null)
- ? TaskRun_PriorBackupDetail.fromPartial(object.priorBackupDetail)
- : undefined;
- message.error = object.error ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunLogEntry_RetryInfo(): TaskRunLogEntry_RetryInfo {
- return { error: "", retryCount: 0, maximumRetries: 0 };
-}
-
-export const TaskRunLogEntry_RetryInfo: MessageFns<TaskRunLogEntry_RetryInfo> = {
- encode(message: TaskRunLogEntry_RetryInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.error !== "") {
- writer.uint32(10).string(message.error);
- }
- if (message.retryCount !== 0) {
- writer.uint32(16).int32(message.retryCount);
- }
- if (message.maximumRetries !== 0) {
- writer.uint32(24).int32(message.maximumRetries);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunLogEntry_RetryInfo {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunLogEntry_RetryInfo();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.retryCount = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.maximumRetries = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunLogEntry_RetryInfo {
- return {
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- retryCount: isSet(object.retryCount) ? globalThis.Number(object.retryCount) : 0,
- maximumRetries: isSet(object.maximumRetries) ? globalThis.Number(object.maximumRetries) : 0,
- };
- },
-
- toJSON(message: TaskRunLogEntry_RetryInfo): unknown {
- const obj: any = {};
- if (message.error !== "") {
- obj.error = message.error;
- }
- if (message.retryCount !== 0) {
- obj.retryCount = Math.round(message.retryCount);
- }
- if (message.maximumRetries !== 0) {
- obj.maximumRetries = Math.round(message.maximumRetries);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunLogEntry_RetryInfo>): TaskRunLogEntry_RetryInfo {
- return TaskRunLogEntry_RetryInfo.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunLogEntry_RetryInfo>): TaskRunLogEntry_RetryInfo {
- const message = createBaseTaskRunLogEntry_RetryInfo();
- message.error = object.error ?? "";
- message.retryCount = object.retryCount ?? 0;
- message.maximumRetries = object.maximumRetries ?? 0;
- return message;
- },
-};
-
-function createBaseGetTaskRunSessionRequest(): GetTaskRunSessionRequest {
- return { parent: "" };
-}
-
-export const GetTaskRunSessionRequest: MessageFns<GetTaskRunSessionRequest> = {
- encode(message: GetTaskRunSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetTaskRunSessionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetTaskRunSessionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetTaskRunSessionRequest {
- return { parent: isSet(object.parent) ? globalThis.String(object.parent) : "" };
- },
-
- toJSON(message: GetTaskRunSessionRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetTaskRunSessionRequest>): GetTaskRunSessionRequest {
- return GetTaskRunSessionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetTaskRunSessionRequest>): GetTaskRunSessionRequest {
- const message = createBaseGetTaskRunSessionRequest();
- message.parent = object.parent ?? "";
- return message;
- },
-};
-
-function createBaseTaskRunSession(): TaskRunSession {
- return { name: "", postgres: undefined };
-}
-
-export const TaskRunSession: MessageFns<TaskRunSession> = {
- encode(message: TaskRunSession, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.postgres !== undefined) {
- TaskRunSession_Postgres.encode(message.postgres, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunSession {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunSession();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.postgres = TaskRunSession_Postgres.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunSession {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- postgres: isSet(object.postgres) ? TaskRunSession_Postgres.fromJSON(object.postgres) : undefined,
- };
- },
-
- toJSON(message: TaskRunSession): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.postgres !== undefined) {
- obj.postgres = TaskRunSession_Postgres.toJSON(message.postgres);
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunSession>): TaskRunSession {
- return TaskRunSession.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunSession>): TaskRunSession {
- const message = createBaseTaskRunSession();
- message.name = object.name ?? "";
- message.postgres = (object.postgres !== undefined && object.postgres !== null)
- ? TaskRunSession_Postgres.fromPartial(object.postgres)
- : undefined;
- return message;
- },
-};
-
-function createBaseTaskRunSession_Postgres(): TaskRunSession_Postgres {
- return { session: undefined, blockingSessions: [], blockedSessions: [] };
-}
-
-export const TaskRunSession_Postgres: MessageFns<TaskRunSession_Postgres> = {
- encode(message: TaskRunSession_Postgres, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.session !== undefined) {
- TaskRunSession_Postgres_Session.encode(message.session, writer.uint32(10).fork()).join();
- }
- for (const v of message.blockingSessions) {
- TaskRunSession_Postgres_Session.encode(v!, writer.uint32(18).fork()).join();
- }
- for (const v of message.blockedSessions) {
- TaskRunSession_Postgres_Session.encode(v!, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunSession_Postgres {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunSession_Postgres();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.session = TaskRunSession_Postgres_Session.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.blockingSessions.push(TaskRunSession_Postgres_Session.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.blockedSessions.push(TaskRunSession_Postgres_Session.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunSession_Postgres {
- return {
- session: isSet(object.session) ? TaskRunSession_Postgres_Session.fromJSON(object.session) : undefined,
- blockingSessions: globalThis.Array.isArray(object?.blockingSessions)
- ? object.blockingSessions.map((e: any) => TaskRunSession_Postgres_Session.fromJSON(e))
- : [],
- blockedSessions: globalThis.Array.isArray(object?.blockedSessions)
- ? object.blockedSessions.map((e: any) => TaskRunSession_Postgres_Session.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: TaskRunSession_Postgres): unknown {
- const obj: any = {};
- if (message.session !== undefined) {
- obj.session = TaskRunSession_Postgres_Session.toJSON(message.session);
- }
- if (message.blockingSessions?.length) {
- obj.blockingSessions = message.blockingSessions.map((e) => TaskRunSession_Postgres_Session.toJSON(e));
- }
- if (message.blockedSessions?.length) {
- obj.blockedSessions = message.blockedSessions.map((e) => TaskRunSession_Postgres_Session.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunSession_Postgres>): TaskRunSession_Postgres {
- return TaskRunSession_Postgres.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunSession_Postgres>): TaskRunSession_Postgres {
- const message = createBaseTaskRunSession_Postgres();
- message.session = (object.session !== undefined && object.session !== null)
- ? TaskRunSession_Postgres_Session.fromPartial(object.session)
- : undefined;
- message.blockingSessions = object.blockingSessions?.map((e) => TaskRunSession_Postgres_Session.fromPartial(e)) ||
- [];
- message.blockedSessions = object.blockedSessions?.map((e) => TaskRunSession_Postgres_Session.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseTaskRunSession_Postgres_Session(): TaskRunSession_Postgres_Session {
- return {
- pid: "",
- blockedByPids: [],
- query: "",
- state: undefined,
- waitEventType: undefined,
- waitEvent: undefined,
- datname: undefined,
- usename: undefined,
- applicationName: "",
- clientAddr: undefined,
- clientPort: undefined,
- backendStart: undefined,
- xactStart: undefined,
- queryStart: undefined,
- };
-}
-
-export const TaskRunSession_Postgres_Session: MessageFns<TaskRunSession_Postgres_Session> = {
- encode(message: TaskRunSession_Postgres_Session, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pid !== "") {
- writer.uint32(10).string(message.pid);
- }
- for (const v of message.blockedByPids) {
- writer.uint32(18).string(v!);
- }
- if (message.query !== "") {
- writer.uint32(26).string(message.query);
- }
- if (message.state !== undefined) {
- writer.uint32(34).string(message.state);
- }
- if (message.waitEventType !== undefined) {
- writer.uint32(42).string(message.waitEventType);
- }
- if (message.waitEvent !== undefined) {
- writer.uint32(50).string(message.waitEvent);
- }
- if (message.datname !== undefined) {
- writer.uint32(58).string(message.datname);
- }
- if (message.usename !== undefined) {
- writer.uint32(66).string(message.usename);
- }
- if (message.applicationName !== "") {
- writer.uint32(74).string(message.applicationName);
- }
- if (message.clientAddr !== undefined) {
- writer.uint32(82).string(message.clientAddr);
- }
- if (message.clientPort !== undefined) {
- writer.uint32(90).string(message.clientPort);
- }
- if (message.backendStart !== undefined) {
- Timestamp.encode(message.backendStart, writer.uint32(98).fork()).join();
- }
- if (message.xactStart !== undefined) {
- Timestamp.encode(message.xactStart, writer.uint32(106).fork()).join();
- }
- if (message.queryStart !== undefined) {
- Timestamp.encode(message.queryStart, writer.uint32(114).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunSession_Postgres_Session {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseTaskRunSession_Postgres_Session();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.pid = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.blockedByPids.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.query = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.state = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.waitEventType = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.waitEvent = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.datname = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.usename = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.applicationName = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.clientAddr = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.clientPort = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.backendStart = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.xactStart = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.queryStart = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): TaskRunSession_Postgres_Session {
- return {
- pid: isSet(object.pid) ? globalThis.String(object.pid) : "",
- blockedByPids: globalThis.Array.isArray(object?.blockedByPids)
- ? object.blockedByPids.map((e: any) => globalThis.String(e))
- : [],
- query: isSet(object.query) ? globalThis.String(object.query) : "",
- state: isSet(object.state) ? globalThis.String(object.state) : undefined,
- waitEventType: isSet(object.waitEventType) ? globalThis.String(object.waitEventType) : undefined,
- waitEvent: isSet(object.waitEvent) ? globalThis.String(object.waitEvent) : undefined,
- datname: isSet(object.datname) ? globalThis.String(object.datname) : undefined,
- usename: isSet(object.usename) ? globalThis.String(object.usename) : undefined,
- applicationName: isSet(object.applicationName) ? globalThis.String(object.applicationName) : "",
- clientAddr: isSet(object.clientAddr) ? globalThis.String(object.clientAddr) : undefined,
- clientPort: isSet(object.clientPort) ? globalThis.String(object.clientPort) : undefined,
- backendStart: isSet(object.backendStart) ? fromJsonTimestamp(object.backendStart) : undefined,
- xactStart: isSet(object.xactStart) ? fromJsonTimestamp(object.xactStart) : undefined,
- queryStart: isSet(object.queryStart) ? fromJsonTimestamp(object.queryStart) : undefined,
- };
- },
-
- toJSON(message: TaskRunSession_Postgres_Session): unknown {
- const obj: any = {};
- if (message.pid !== "") {
- obj.pid = message.pid;
- }
- if (message.blockedByPids?.length) {
- obj.blockedByPids = message.blockedByPids;
- }
- if (message.query !== "") {
- obj.query = message.query;
- }
- if (message.state !== undefined) {
- obj.state = message.state;
- }
- if (message.waitEventType !== undefined) {
- obj.waitEventType = message.waitEventType;
- }
- if (message.waitEvent !== undefined) {
- obj.waitEvent = message.waitEvent;
- }
- if (message.datname !== undefined) {
- obj.datname = message.datname;
- }
- if (message.usename !== undefined) {
- obj.usename = message.usename;
- }
- if (message.applicationName !== "") {
- obj.applicationName = message.applicationName;
- }
- if (message.clientAddr !== undefined) {
- obj.clientAddr = message.clientAddr;
- }
- if (message.clientPort !== undefined) {
- obj.clientPort = message.clientPort;
- }
- if (message.backendStart !== undefined) {
- obj.backendStart = fromTimestamp(message.backendStart).toISOString();
- }
- if (message.xactStart !== undefined) {
- obj.xactStart = fromTimestamp(message.xactStart).toISOString();
- }
- if (message.queryStart !== undefined) {
- obj.queryStart = fromTimestamp(message.queryStart).toISOString();
- }
- return obj;
- },
-
- create(base?: DeepPartial<TaskRunSession_Postgres_Session>): TaskRunSession_Postgres_Session {
- return TaskRunSession_Postgres_Session.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<TaskRunSession_Postgres_Session>): TaskRunSession_Postgres_Session {
- const message = createBaseTaskRunSession_Postgres_Session();
- message.pid = object.pid ?? "";
- message.blockedByPids = object.blockedByPids?.map((e) => e) || [];
- message.query = object.query ?? "";
- message.state = object.state ?? undefined;
- message.waitEventType = object.waitEventType ?? undefined;
- message.waitEvent = object.waitEvent ?? undefined;
- message.datname = object.datname ?? undefined;
- message.usename = object.usename ?? undefined;
- message.applicationName = object.applicationName ?? "";
- message.clientAddr = object.clientAddr ?? undefined;
- message.clientPort = object.clientPort ?? undefined;
- message.backendStart = (object.backendStart !== undefined && object.backendStart !== null)
- ? Timestamp.fromPartial(object.backendStart)
- : undefined;
- message.xactStart = (object.xactStart !== undefined && object.xactStart !== null)
- ? Timestamp.fromPartial(object.xactStart)
- : undefined;
- message.queryStart = (object.queryStart !== undefined && object.queryStart !== null)
- ? Timestamp.fromPartial(object.queryStart)
- : undefined;
- return message;
- },
-};
-
-function createBasePreviewTaskRunRollbackRequest(): PreviewTaskRunRollbackRequest {
- return { name: "" };
-}
-
-export const PreviewTaskRunRollbackRequest: MessageFns<PreviewTaskRunRollbackRequest> = {
- encode(message: PreviewTaskRunRollbackRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PreviewTaskRunRollbackRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePreviewTaskRunRollbackRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PreviewTaskRunRollbackRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: PreviewTaskRunRollbackRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<PreviewTaskRunRollbackRequest>): PreviewTaskRunRollbackRequest {
- return PreviewTaskRunRollbackRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PreviewTaskRunRollbackRequest>): PreviewTaskRunRollbackRequest {
- const message = createBasePreviewTaskRunRollbackRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBasePreviewTaskRunRollbackResponse(): PreviewTaskRunRollbackResponse {
- return { statement: "" };
-}
-
-export const PreviewTaskRunRollbackResponse: MessageFns<PreviewTaskRunRollbackResponse> = {
- encode(message: PreviewTaskRunRollbackResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.statement !== "") {
- writer.uint32(10).string(message.statement);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PreviewTaskRunRollbackResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePreviewTaskRunRollbackResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PreviewTaskRunRollbackResponse {
- return { statement: isSet(object.statement) ? globalThis.String(object.statement) : "" };
- },
-
- toJSON(message: PreviewTaskRunRollbackResponse): unknown {
- const obj: any = {};
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- return obj;
- },
-
- create(base?: DeepPartial<PreviewTaskRunRollbackResponse>): PreviewTaskRunRollbackResponse {
- return PreviewTaskRunRollbackResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PreviewTaskRunRollbackResponse>): PreviewTaskRunRollbackResponse {
- const message = createBasePreviewTaskRunRollbackResponse();
- message.statement = object.statement ?? "";
- return message;
- },
-};
-
-export type RolloutServiceDefinition = typeof RolloutServiceDefinition;
-export const RolloutServiceDefinition = {
- name: "RolloutService",
- fullName: "bytebase.v1.RolloutService",
- methods: {
- /** Permissions required: bb.rollouts.get */
- getRollout: {
- name: "GetRollout",
- requestType: GetRolloutRequest,
- requestStream: false,
- responseType: Rollout,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 114, 111, 108, 108, 111, 117, 116, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.rollouts.list */
- listRollouts: {
- name: "ListRollouts",
- requestType: ListRolloutsRequest,
- requestStream: false,
- responseType: ListRolloutsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 114, 111, 108, 108, 111, 117, 116, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 18,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.rollouts.create */
- createRollout: {
- name: "CreateRollout",
- requestType: CreateRolloutRequest,
- requestStream: false,
- responseType: Rollout,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([14, 112, 97, 114, 101, 110, 116, 44, 114, 111, 108, 108, 111, 117, 116])],
- 800010: [
- new Uint8Array([18, 98, 98, 46, 114, 111, 108, 108, 111, 117, 116, 115, 46, 99, 114, 101, 97, 116, 101]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 43,
- 58,
- 7,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 34,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.rollouts.preview */
- previewRollout: {
- name: "PreviewRollout",
- requestType: PreviewRolloutRequest,
- requestStream: false,
- responseType: Rollout,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [
- new Uint8Array([
- 19,
- 98,
- 98,
- 46,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 46,
- 112,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 44,
- 58,
- 1,
- 42,
- 34,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 112,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 82,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.taskRuns.list */
- listTaskRuns: {
- name: "ListTaskRuns",
- requestType: ListTaskRunsRequest,
- requestStream: false,
- responseType: ListTaskRunsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 116, 97, 115, 107, 82, 117, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 62,
- 18,
- 60,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 125,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.taskRuns.list */
- getTaskRun: {
- name: "GetTaskRun",
- requestType: GetTaskRunRequest,
- requestStream: false,
- responseType: TaskRun,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 116, 97, 115, 107, 82, 117, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 62,
- 18,
- 60,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.taskRuns.list */
- getTaskRunLog: {
- name: "GetTaskRunLog",
- requestType: GetTaskRunLogRequest,
- requestStream: false,
- responseType: TaskRunLog,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 116, 97, 115, 107, 82, 117, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 68,
- 18,
- 66,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- 47,
- 42,
- 125,
- 47,
- 108,
- 111,
- 103,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.taskRuns.list */
- getTaskRunSession: {
- name: "GetTaskRunSession",
- requestType: GetTaskRunSessionRequest,
- requestStream: false,
- responseType: TaskRunSession,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 116, 97, 115, 107, 82, 117, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 72,
- 18,
- 70,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- 47,
- 42,
- 125,
- 47,
- 115,
- 101,
- 115,
- 115,
- 105,
- 111,
- 110,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- batchRunTasks: {
- name: "BatchRunTasks",
- requestType: BatchRunTasksRequest,
- requestStream: false,
- responseType: BatchRunTasksResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 63,
- 58,
- 1,
- 42,
- 34,
- 58,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 82,
- 117,
- 110,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- batchSkipTasks: {
- name: "BatchSkipTasks",
- requestType: BatchSkipTasksRequest,
- requestStream: false,
- responseType: BatchSkipTasksResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 64,
- 58,
- 1,
- 42,
- 34,
- 59,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 125,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 83,
- 107,
- 105,
- 112,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- batchCancelTaskRuns: {
- name: "BatchCancelTaskRuns",
- requestType: BatchCancelTaskRunsRequest,
- requestStream: false,
- responseType: BatchCancelTaskRunsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 77,
- 58,
- 1,
- 42,
- 34,
- 72,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 125,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 67,
- 97,
- 110,
- 99,
- 101,
- 108,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.taskRuns.list */
- previewTaskRunRollback: {
- name: "PreviewTaskRunRollback",
- requestType: PreviewTaskRunRollbackRequest,
- requestStream: false,
- responseType: PreviewTaskRunRollbackResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([16, 98, 98, 46, 116, 97, 115, 107, 82, 117, 110, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 81,
- 58,
- 1,
- 42,
- 34,
- 76,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 115,
- 47,
- 42,
- 47,
- 116,
- 97,
- 115,
- 107,
- 82,
- 117,
- 110,
- 115,
- 47,
- 42,
- 125,
- 58,
- 112,
- 114,
- 101,
- 118,
- 105,
- 101,
- 119,
- 82,
- 111,
- 108,
- 108,
- 98,
- 97,
- 99,
- 107,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
deleted file mode 100644
index 311fd41f8d..0000000000
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ /dev/null
@@ -1,5211 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/setting_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Duration } from "../google/protobuf/duration";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Expr } from "../google/type/expr";
-import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
-import { ColumnCatalog, TableCatalog } from "./database_catalog_service";
-import { ColumnMetadata, TableMetadata } from "./database_service";
-import { ApprovalTemplate } from "./issue_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum DatabaseChangeMode {
- DATABASE_CHANGE_MODE_UNSPECIFIED = "DATABASE_CHANGE_MODE_UNSPECIFIED",
- /**
- * PIPELINE - A more advanced database change process, including custom approval workflows and other advanced features.
- * Default to this mode.
- */
- PIPELINE = "PIPELINE",
- /** EDITOR - A simple database change process in SQL editor. Users can execute SQL directly. */
- EDITOR = "EDITOR",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function databaseChangeModeFromJSON(object: any): DatabaseChangeMode {
- switch (object) {
- case 0:
- case "DATABASE_CHANGE_MODE_UNSPECIFIED":
- return DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED;
- case 1:
- case "PIPELINE":
- return DatabaseChangeMode.PIPELINE;
- case 2:
- case "EDITOR":
- return DatabaseChangeMode.EDITOR;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DatabaseChangeMode.UNRECOGNIZED;
- }
-}
-
-export function databaseChangeModeToJSON(object: DatabaseChangeMode): string {
- switch (object) {
- case DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED:
- return "DATABASE_CHANGE_MODE_UNSPECIFIED";
- case DatabaseChangeMode.PIPELINE:
- return "PIPELINE";
- case DatabaseChangeMode.EDITOR:
- return "EDITOR";
- case DatabaseChangeMode.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function databaseChangeModeToNumber(object: DatabaseChangeMode): number {
- switch (object) {
- case DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED:
- return 0;
- case DatabaseChangeMode.PIPELINE:
- return 1;
- case DatabaseChangeMode.EDITOR:
- return 2;
- case DatabaseChangeMode.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface ListSettingsRequest {
- /**
- * Not used.
- * The maximum number of settings to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 settings will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `ListSettings` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListSettings` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface ListSettingsResponse {
- /** The settings from the specified request. */
- settings: Setting[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-/** The request message for getting a setting. */
-export interface GetSettingRequest {
- /** The resource name of the setting. */
- name: string;
-}
-
-/** The response message for getting a setting. */
-export interface GetSettingResponse {
- setting: Setting | undefined;
-}
-
-/** The request message for updating or creating a setting. */
-export interface UpdateSettingRequest {
- /** The setting to update. */
- setting:
- | Setting
- | undefined;
- /**
- * validate_only is a flag to indicate whether to validate the setting value,
- * server would not persist the setting value if it is true.
- */
- validateOnly: boolean;
- allowMissing: boolean;
- updateMask: string[] | undefined;
-}
-
-/** The schema of setting. */
-export interface Setting {
- /**
- * The resource name of the setting. Must be one of the following forms:
- *
- * - `setting/{setting}`
- * For example, "settings/bb.branding.logo"
- */
- name: string;
- /** The value of the setting. */
- value: Value | undefined;
-}
-
-export enum Setting_SettingName {
- SETTING_NAME_UNSPECIFIED = "SETTING_NAME_UNSPECIFIED",
- AUTH_SECRET = "AUTH_SECRET",
- BRANDING_LOGO = "BRANDING_LOGO",
- WORKSPACE_ID = "WORKSPACE_ID",
- WORKSPACE_PROFILE = "WORKSPACE_PROFILE",
- WORKSPACE_APPROVAL = "WORKSPACE_APPROVAL",
- WORKSPACE_EXTERNAL_APPROVAL = "WORKSPACE_EXTERNAL_APPROVAL",
- ENTERPRISE_LICENSE = "ENTERPRISE_LICENSE",
- APP_IM = "APP_IM",
- WATERMARK = "WATERMARK",
- AI = "AI",
- SCHEMA_TEMPLATE = "SCHEMA_TEMPLATE",
- DATA_CLASSIFICATION = "DATA_CLASSIFICATION",
- SEMANTIC_TYPES = "SEMANTIC_TYPES",
- SQL_RESULT_SIZE_LIMIT = "SQL_RESULT_SIZE_LIMIT",
- SCIM = "SCIM",
- PASSWORD_RESTRICTION = "PASSWORD_RESTRICTION",
- ENVIRONMENT = "ENVIRONMENT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function setting_SettingNameFromJSON(object: any): Setting_SettingName {
- switch (object) {
- case 0:
- case "SETTING_NAME_UNSPECIFIED":
- return Setting_SettingName.SETTING_NAME_UNSPECIFIED;
- case 1:
- case "AUTH_SECRET":
- return Setting_SettingName.AUTH_SECRET;
- case 2:
- case "BRANDING_LOGO":
- return Setting_SettingName.BRANDING_LOGO;
- case 3:
- case "WORKSPACE_ID":
- return Setting_SettingName.WORKSPACE_ID;
- case 4:
- case "WORKSPACE_PROFILE":
- return Setting_SettingName.WORKSPACE_PROFILE;
- case 5:
- case "WORKSPACE_APPROVAL":
- return Setting_SettingName.WORKSPACE_APPROVAL;
- case 6:
- case "WORKSPACE_EXTERNAL_APPROVAL":
- return Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL;
- case 7:
- case "ENTERPRISE_LICENSE":
- return Setting_SettingName.ENTERPRISE_LICENSE;
- case 8:
- case "APP_IM":
- return Setting_SettingName.APP_IM;
- case 9:
- case "WATERMARK":
- return Setting_SettingName.WATERMARK;
- case 10:
- case "AI":
- return Setting_SettingName.AI;
- case 13:
- case "SCHEMA_TEMPLATE":
- return Setting_SettingName.SCHEMA_TEMPLATE;
- case 14:
- case "DATA_CLASSIFICATION":
- return Setting_SettingName.DATA_CLASSIFICATION;
- case 15:
- case "SEMANTIC_TYPES":
- return Setting_SettingName.SEMANTIC_TYPES;
- case 16:
- case "SQL_RESULT_SIZE_LIMIT":
- return Setting_SettingName.SQL_RESULT_SIZE_LIMIT;
- case 17:
- case "SCIM":
- return Setting_SettingName.SCIM;
- case 18:
- case "PASSWORD_RESTRICTION":
- return Setting_SettingName.PASSWORD_RESTRICTION;
- case 19:
- case "ENVIRONMENT":
- return Setting_SettingName.ENVIRONMENT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Setting_SettingName.UNRECOGNIZED;
- }
-}
-
-export function setting_SettingNameToJSON(object: Setting_SettingName): string {
- switch (object) {
- case Setting_SettingName.SETTING_NAME_UNSPECIFIED:
- return "SETTING_NAME_UNSPECIFIED";
- case Setting_SettingName.AUTH_SECRET:
- return "AUTH_SECRET";
- case Setting_SettingName.BRANDING_LOGO:
- return "BRANDING_LOGO";
- case Setting_SettingName.WORKSPACE_ID:
- return "WORKSPACE_ID";
- case Setting_SettingName.WORKSPACE_PROFILE:
- return "WORKSPACE_PROFILE";
- case Setting_SettingName.WORKSPACE_APPROVAL:
- return "WORKSPACE_APPROVAL";
- case Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL:
- return "WORKSPACE_EXTERNAL_APPROVAL";
- case Setting_SettingName.ENTERPRISE_LICENSE:
- return "ENTERPRISE_LICENSE";
- case Setting_SettingName.APP_IM:
- return "APP_IM";
- case Setting_SettingName.WATERMARK:
- return "WATERMARK";
- case Setting_SettingName.AI:
- return "AI";
- case Setting_SettingName.SCHEMA_TEMPLATE:
- return "SCHEMA_TEMPLATE";
- case Setting_SettingName.DATA_CLASSIFICATION:
- return "DATA_CLASSIFICATION";
- case Setting_SettingName.SEMANTIC_TYPES:
- return "SEMANTIC_TYPES";
- case Setting_SettingName.SQL_RESULT_SIZE_LIMIT:
- return "SQL_RESULT_SIZE_LIMIT";
- case Setting_SettingName.SCIM:
- return "SCIM";
- case Setting_SettingName.PASSWORD_RESTRICTION:
- return "PASSWORD_RESTRICTION";
- case Setting_SettingName.ENVIRONMENT:
- return "ENVIRONMENT";
- case Setting_SettingName.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function setting_SettingNameToNumber(object: Setting_SettingName): number {
- switch (object) {
- case Setting_SettingName.SETTING_NAME_UNSPECIFIED:
- return 0;
- case Setting_SettingName.AUTH_SECRET:
- return 1;
- case Setting_SettingName.BRANDING_LOGO:
- return 2;
- case Setting_SettingName.WORKSPACE_ID:
- return 3;
- case Setting_SettingName.WORKSPACE_PROFILE:
- return 4;
- case Setting_SettingName.WORKSPACE_APPROVAL:
- return 5;
- case Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL:
- return 6;
- case Setting_SettingName.ENTERPRISE_LICENSE:
- return 7;
- case Setting_SettingName.APP_IM:
- return 8;
- case Setting_SettingName.WATERMARK:
- return 9;
- case Setting_SettingName.AI:
- return 10;
- case Setting_SettingName.SCHEMA_TEMPLATE:
- return 13;
- case Setting_SettingName.DATA_CLASSIFICATION:
- return 14;
- case Setting_SettingName.SEMANTIC_TYPES:
- return 15;
- case Setting_SettingName.SQL_RESULT_SIZE_LIMIT:
- return 16;
- case Setting_SettingName.SCIM:
- return 17;
- case Setting_SettingName.PASSWORD_RESTRICTION:
- return 18;
- case Setting_SettingName.ENVIRONMENT:
- return 19;
- case Setting_SettingName.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-/** The data in setting value. */
-export interface Value {
- /** Defines this value as being a string value. */
- stringValue?: string | undefined;
- appImSettingValue?:
- | AppIMSetting
- | undefined;
- /** reserved 4; // was AgentPluginSetting agent_plugin_setting_value */
- workspaceProfileSettingValue?: WorkspaceProfileSetting | undefined;
- workspaceApprovalSettingValue?: WorkspaceApprovalSetting | undefined;
- schemaTemplateSettingValue?: SchemaTemplateSetting | undefined;
- dataClassificationSettingValue?: DataClassificationSetting | undefined;
- semanticTypeSettingValue?: SemanticTypeSetting | undefined;
- scimSetting?: SCIMSetting | undefined;
- passwordRestrictionSetting?: PasswordRestrictionSetting | undefined;
- aiSetting?: AISetting | undefined;
- environmentSetting?: EnvironmentSetting | undefined;
- sqlQueryRestrictionSetting?: SQLQueryRestrictionSetting | undefined;
-}
-
-export interface AppIMSetting {
- slack: AppIMSetting_Slack | undefined;
- feishu: AppIMSetting_Feishu | undefined;
- wecom: AppIMSetting_Wecom | undefined;
- lark: AppIMSetting_Lark | undefined;
- dingtalk: AppIMSetting_DingTalk | undefined;
-}
-
-export interface AppIMSetting_Slack {
- enabled: boolean;
- token: string;
-}
-
-export interface AppIMSetting_Feishu {
- enabled: boolean;
- appId: string;
- appSecret: string;
-}
-
-export interface AppIMSetting_Wecom {
- enabled: boolean;
- corpId: string;
- agentId: string;
- secret: string;
-}
-
-export interface AppIMSetting_Lark {
- enabled: boolean;
- appId: string;
- appSecret: string;
-}
-
-export interface AppIMSetting_DingTalk {
- enabled: boolean;
- clientId: string;
- clientSecret: string;
- robotCode: string;
-}
-
-export interface WorkspaceProfileSetting {
- /** The external URL is used for sso authentication callback. */
- externalUrl: string;
- /** Disallow self-service signup, users can only be invited by the owner. */
- disallowSignup: boolean;
- /** Require 2FA for all users. */
- require2fa: boolean;
- /** The duration for token. */
- tokenDuration:
- | Duration
- | undefined;
- /** The setting of custom announcement */
- announcement:
- | Announcement
- | undefined;
- /** The max duration for role expired. */
- maximumRoleExpiration:
- | Duration
- | undefined;
- /** The workspace domain, e.g. bytebase.com. */
- domains: string[];
- /** Only user and group from the domains can be created and login. */
- enforceIdentityDomain: boolean;
- /** The workspace database change mode. */
- databaseChangeMode: DatabaseChangeMode;
- /** Whether to disallow password signin. (Except workspace admins) */
- disallowPasswordSignin: boolean;
-}
-
-export interface Announcement {
- /** The alert level of announcemnt */
- level: Announcement_AlertLevel;
- /** The text of announcemnt */
- text: string;
- /** The optional link, user can follow the link to check extra details */
- link: string;
-}
-
-/** We support three levels of AlertLevel: INFO, WARNING, and ERROR. */
-export enum Announcement_AlertLevel {
- 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 {
- switch (object) {
- case 0:
- case "ALERT_LEVEL_UNSPECIFIED":
- return Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED;
- case 1:
- case "ALERT_LEVEL_INFO":
- return Announcement_AlertLevel.ALERT_LEVEL_INFO;
- case 2:
- case "ALERT_LEVEL_WARNING":
- return Announcement_AlertLevel.ALERT_LEVEL_WARNING;
- case 3:
- case "ALERT_LEVEL_CRITICAL":
- return Announcement_AlertLevel.ALERT_LEVEL_CRITICAL;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Announcement_AlertLevel.UNRECOGNIZED;
- }
-}
-
-export function announcement_AlertLevelToJSON(object: Announcement_AlertLevel): string {
- switch (object) {
- case Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED:
- return "ALERT_LEVEL_UNSPECIFIED";
- case Announcement_AlertLevel.ALERT_LEVEL_INFO:
- return "ALERT_LEVEL_INFO";
- case Announcement_AlertLevel.ALERT_LEVEL_WARNING:
- return "ALERT_LEVEL_WARNING";
- case Announcement_AlertLevel.ALERT_LEVEL_CRITICAL:
- return "ALERT_LEVEL_CRITICAL";
- case Announcement_AlertLevel.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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[];
-}
-
-export interface WorkspaceApprovalSetting_Rule {
- template:
- | ApprovalTemplate
- | undefined;
- /**
- * The condition that is associated with the rule.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Support variables:
- * source: the risk source, check the Source enum in the Risk message for the values, support "==" operator.
- * level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support "==" operator.
- *
- * For examples:
- * (source == "DML" && level == 200) || (source == "DDL" && level == 300)
- */
- condition: Expr | undefined;
-}
-
-export interface SchemaTemplateSetting {
- fieldTemplates: SchemaTemplateSetting_FieldTemplate[];
- columnTypes: SchemaTemplateSetting_ColumnType[];
- tableTemplates: SchemaTemplateSetting_TableTemplate[];
-}
-
-export interface SchemaTemplateSetting_FieldTemplate {
- id: string;
- engine: Engine;
- category: string;
- column: ColumnMetadata | undefined;
- catalog: ColumnCatalog | undefined;
-}
-
-export interface SchemaTemplateSetting_ColumnType {
- engine: Engine;
- enabled: boolean;
- types: string[];
-}
-
-export interface SchemaTemplateSetting_TableTemplate {
- id: string;
- engine: Engine;
- category: string;
- table: TableMetadata | undefined;
- catalog: TableCatalog | undefined;
-}
-
-export interface DataClassificationSetting {
- configs: DataClassificationSetting_DataClassificationConfig[];
-}
-
-export interface DataClassificationSetting_DataClassificationConfig {
- /** id is the uuid for classification. Each project can chose one classification config. */
- id: string;
- title: string;
- /**
- * levels is user defined level list for classification.
- * The order for the level decides its priority.
- */
- levels: DataClassificationSetting_DataClassificationConfig_Level[];
- /**
- * classification is the id - DataClassification map.
- * The id should in [0-9]+-[0-9]+-[0-9]+ format.
- */
- classification: { [key: string]: DataClassificationSetting_DataClassificationConfig_DataClassification };
- /**
- * If true, we will only store the classification in the config.
- * Otherwise we will get the classification from table/column comment,
- * and write back to the schema metadata.
- */
- classificationFromConfig: boolean;
-}
-
-export interface DataClassificationSetting_DataClassificationConfig_Level {
- id: string;
- title: string;
- description: string;
-}
-
-export interface DataClassificationSetting_DataClassificationConfig_DataClassification {
- /** id is the classification id in [0-9]+-[0-9]+-[0-9]+ format. */
- id: string;
- title: string;
- description: string;
- levelId?: string | undefined;
-}
-
-export interface DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- key: string;
- value: DataClassificationSetting_DataClassificationConfig_DataClassification | undefined;
-}
-
-export interface SemanticTypeSetting {
- types: SemanticTypeSetting_SemanticType[];
-}
-
-export interface SemanticTypeSetting_SemanticType {
- /** id is the uuid for semantic type. */
- id: string;
- /** the title of the semantic type, it should not be empty. */
- title: string;
- /** the description of the semantic type, it can be empty. */
- description: string;
- algorithm: Algorithm | undefined;
-}
-
-export interface Algorithm {
- fullMask?: Algorithm_FullMask | undefined;
- rangeMask?: Algorithm_RangeMask | undefined;
- md5Mask?: Algorithm_MD5Mask | undefined;
- innerOuterMask?: Algorithm_InnerOuterMask | undefined;
-}
-
-export interface Algorithm_FullMask {
- /**
- * substitution is the string used to replace the original value, the
- * max length of the string is 16 bytes.
- */
- substitution: string;
-}
-
-export interface Algorithm_RangeMask {
- /**
- * We store it as a repeated field to face the fact that the original value may have multiple parts should be masked.
- * But frontend can be started with a single rule easily.
- */
- slices: Algorithm_RangeMask_Slice[];
-}
-
-export interface Algorithm_RangeMask_Slice {
- /** start is the start index of the original value, start from 0 and should be less than stop. */
- start: number;
- /** stop is the stop index of the original value, should be less than the length of the original value. */
- end: number;
- /** substitution is the string used to replace the OriginalValue[start:end). */
- substitution: string;
-}
-
-export interface Algorithm_MD5Mask {
- /** salt is the salt value to generate a different hash that with the word alone. */
- salt: string;
-}
-
-export interface Algorithm_InnerOuterMask {
- prefixLen: number;
- suffixLen: number;
- type: Algorithm_InnerOuterMask_MaskType;
- substitution: string;
-}
-
-export enum Algorithm_InnerOuterMask_MaskType {
- MASK_TYPE_UNSPECIFIED = "MASK_TYPE_UNSPECIFIED",
- INNER = "INNER",
- OUTER = "OUTER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function algorithm_InnerOuterMask_MaskTypeFromJSON(object: any): Algorithm_InnerOuterMask_MaskType {
- switch (object) {
- case 0:
- case "MASK_TYPE_UNSPECIFIED":
- return Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED;
- case 1:
- case "INNER":
- return Algorithm_InnerOuterMask_MaskType.INNER;
- case 2:
- case "OUTER":
- return Algorithm_InnerOuterMask_MaskType.OUTER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Algorithm_InnerOuterMask_MaskType.UNRECOGNIZED;
- }
-}
-
-export function algorithm_InnerOuterMask_MaskTypeToJSON(object: Algorithm_InnerOuterMask_MaskType): string {
- switch (object) {
- case Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED:
- return "MASK_TYPE_UNSPECIFIED";
- case Algorithm_InnerOuterMask_MaskType.INNER:
- return "INNER";
- case Algorithm_InnerOuterMask_MaskType.OUTER:
- return "OUTER";
- case Algorithm_InnerOuterMask_MaskType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function algorithm_InnerOuterMask_MaskTypeToNumber(object: Algorithm_InnerOuterMask_MaskType): number {
- switch (object) {
- case Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED:
- return 0;
- case Algorithm_InnerOuterMask_MaskType.INNER:
- return 1;
- case Algorithm_InnerOuterMask_MaskType.OUTER:
- return 2;
- case Algorithm_InnerOuterMask_MaskType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface SQLQueryRestrictionSetting {
- /**
- * The size limit in bytes.
- * The default value is 100MB, we will use the default value if the setting not exists, or the limit <= 0.
- */
- maximumResultSize: Long;
- /**
- * The return rows limit. If the value <= 0, will be treated as no limit.
- * The default value is -1.
- */
- maximumResultRows: number;
-}
-
-export interface SCIMSetting {
- token: string;
-}
-
-export interface PasswordRestrictionSetting {
- /** min_length is the minimum length for password, should no less than 8. */
- minLength: number;
- /** require_number requires the password must contains at least one number. */
- requireNumber: boolean;
- /** require_letter requires the password must contains at least one letter, regardless of upper case or lower case */
- requireLetter: boolean;
- /** require_uppercase_letter requires the password must contains at least one upper case letter. */
- requireUppercaseLetter: boolean;
- /** require_uppercase_letter requires the password must contains at least one special character. */
- requireSpecialCharacter: boolean;
- /** require_reset_password_for_first_login requires users to reset their password after the 1st login. */
- requireResetPasswordForFirstLogin: boolean;
- /** password_rotation requires users to reset their password after the duration. */
- passwordRotation: Duration | undefined;
-}
-
-export interface AISetting {
- enabled: boolean;
- provider: AISetting_Provider;
- endpoint: string;
- apiKey: string;
- model: string;
- version: string;
-}
-
-export enum AISetting_Provider {
- PROVIDER_UNSPECIFIED = "PROVIDER_UNSPECIFIED",
- OPEN_AI = "OPEN_AI",
- CLAUDE = "CLAUDE",
- GEMINI = "GEMINI",
- AZURE_OPENAI = "AZURE_OPENAI",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function aISetting_ProviderFromJSON(object: any): AISetting_Provider {
- switch (object) {
- case 0:
- case "PROVIDER_UNSPECIFIED":
- return AISetting_Provider.PROVIDER_UNSPECIFIED;
- case 1:
- case "OPEN_AI":
- return AISetting_Provider.OPEN_AI;
- case 2:
- case "CLAUDE":
- return AISetting_Provider.CLAUDE;
- case 3:
- case "GEMINI":
- return AISetting_Provider.GEMINI;
- case 4:
- case "AZURE_OPENAI":
- return AISetting_Provider.AZURE_OPENAI;
- case -1:
- case "UNRECOGNIZED":
- default:
- return AISetting_Provider.UNRECOGNIZED;
- }
-}
-
-export function aISetting_ProviderToJSON(object: AISetting_Provider): string {
- switch (object) {
- case AISetting_Provider.PROVIDER_UNSPECIFIED:
- return "PROVIDER_UNSPECIFIED";
- case AISetting_Provider.OPEN_AI:
- return "OPEN_AI";
- case AISetting_Provider.CLAUDE:
- return "CLAUDE";
- case AISetting_Provider.GEMINI:
- return "GEMINI";
- case AISetting_Provider.AZURE_OPENAI:
- return "AZURE_OPENAI";
- case AISetting_Provider.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function aISetting_ProviderToNumber(object: AISetting_Provider): number {
- switch (object) {
- case AISetting_Provider.PROVIDER_UNSPECIFIED:
- return 0;
- case AISetting_Provider.OPEN_AI:
- return 1;
- case AISetting_Provider.CLAUDE:
- return 2;
- case AISetting_Provider.GEMINI:
- return 3;
- case AISetting_Provider.AZURE_OPENAI:
- return 4;
- case AISetting_Provider.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface EnvironmentSetting {
- environments: EnvironmentSetting_Environment[];
-}
-
-export interface EnvironmentSetting_Environment {
- /**
- * The resource name of the environment.
- * Format: environments/{environment}.
- * Output only.
- */
- name: string;
- /**
- * The resource id of the environment.
- * This value should be 4-63 characters, and valid characters
- * are /[a-z][0-9]-/.
- */
- id: string;
- /** The display name of the environment. */
- title: string;
- tags: { [key: string]: string };
- color: string;
-}
-
-export interface EnvironmentSetting_Environment_TagsEntry {
- key: string;
- value: string;
-}
-
-function createBaseListSettingsRequest(): ListSettingsRequest {
- return { pageSize: 0, pageToken: "" };
-}
-
-export const ListSettingsRequest: MessageFns<ListSettingsRequest> = {
- encode(message: ListSettingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListSettingsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListSettingsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListSettingsRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListSettingsRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListSettingsRequest>): ListSettingsRequest {
- return ListSettingsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListSettingsRequest>): ListSettingsRequest {
- const message = createBaseListSettingsRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListSettingsResponse(): ListSettingsResponse {
- return { settings: [], nextPageToken: "" };
-}
-
-export const ListSettingsResponse: MessageFns<ListSettingsResponse> = {
- encode(message: ListSettingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.settings) {
- Setting.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListSettingsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListSettingsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.settings.push(Setting.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListSettingsResponse {
- return {
- settings: globalThis.Array.isArray(object?.settings) ? object.settings.map((e: any) => Setting.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListSettingsResponse): unknown {
- const obj: any = {};
- if (message.settings?.length) {
- obj.settings = message.settings.map((e) => Setting.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListSettingsResponse>): ListSettingsResponse {
- return ListSettingsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListSettingsResponse>): ListSettingsResponse {
- const message = createBaseListSettingsResponse();
- message.settings = object.settings?.map((e) => Setting.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseGetSettingRequest(): GetSettingRequest {
- return { name: "" };
-}
-
-export const GetSettingRequest: MessageFns<GetSettingRequest> = {
- encode(message: GetSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSettingRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSettingRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetSettingRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetSettingRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetSettingRequest>): GetSettingRequest {
- return GetSettingRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetSettingRequest>): GetSettingRequest {
- const message = createBaseGetSettingRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseGetSettingResponse(): GetSettingResponse {
- return { setting: undefined };
-}
-
-export const GetSettingResponse: MessageFns<GetSettingResponse> = {
- encode(message: GetSettingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.setting !== undefined) {
- Setting.encode(message.setting, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSettingResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSettingResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.setting = Setting.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetSettingResponse {
- return { setting: isSet(object.setting) ? Setting.fromJSON(object.setting) : undefined };
- },
-
- toJSON(message: GetSettingResponse): unknown {
- const obj: any = {};
- if (message.setting !== undefined) {
- obj.setting = Setting.toJSON(message.setting);
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetSettingResponse>): GetSettingResponse {
- return GetSettingResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetSettingResponse>): GetSettingResponse {
- const message = createBaseGetSettingResponse();
- message.setting = (object.setting !== undefined && object.setting !== null)
- ? Setting.fromPartial(object.setting)
- : undefined;
- return message;
- },
-};
-
-function createBaseUpdateSettingRequest(): UpdateSettingRequest {
- return { setting: undefined, validateOnly: false, allowMissing: false, updateMask: undefined };
-}
-
-export const UpdateSettingRequest: MessageFns<UpdateSettingRequest> = {
- encode(message: UpdateSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.setting !== undefined) {
- Setting.encode(message.setting, writer.uint32(10).fork()).join();
- }
- if (message.validateOnly !== false) {
- writer.uint32(16).bool(message.validateOnly);
- }
- if (message.allowMissing !== false) {
- writer.uint32(24).bool(message.allowMissing);
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateSettingRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateSettingRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.setting = Setting.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.validateOnly = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.allowMissing = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateSettingRequest {
- return {
- setting: isSet(object.setting) ? Setting.fromJSON(object.setting) : undefined,
- validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
- allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateSettingRequest): unknown {
- const obj: any = {};
- if (message.setting !== undefined) {
- obj.setting = Setting.toJSON(message.setting);
- }
- if (message.validateOnly !== false) {
- obj.validateOnly = message.validateOnly;
- }
- if (message.allowMissing !== false) {
- obj.allowMissing = message.allowMissing;
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateSettingRequest>): UpdateSettingRequest {
- return UpdateSettingRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateSettingRequest>): UpdateSettingRequest {
- const message = createBaseUpdateSettingRequest();
- message.setting = (object.setting !== undefined && object.setting !== null)
- ? Setting.fromPartial(object.setting)
- : undefined;
- message.validateOnly = object.validateOnly ?? false;
- message.allowMissing = object.allowMissing ?? false;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseSetting(): Setting {
- return { name: "", value: undefined };
-}
-
-export const Setting: MessageFns<Setting> = {
- encode(message: Setting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.value !== undefined) {
- Value.encode(message.value, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Setting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = Value.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Setting {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- value: isSet(object.value) ? Value.fromJSON(object.value) : undefined,
- };
- },
-
- toJSON(message: Setting): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.value !== undefined) {
- obj.value = Value.toJSON(message.value);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Setting>): Setting {
- return Setting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Setting>): Setting {
- const message = createBaseSetting();
- message.name = object.name ?? "";
- message.value = (object.value !== undefined && object.value !== null) ? Value.fromPartial(object.value) : undefined;
- return message;
- },
-};
-
-function createBaseValue(): Value {
- return {
- stringValue: undefined,
- appImSettingValue: undefined,
- workspaceProfileSettingValue: undefined,
- workspaceApprovalSettingValue: undefined,
- schemaTemplateSettingValue: undefined,
- dataClassificationSettingValue: undefined,
- semanticTypeSettingValue: undefined,
- scimSetting: undefined,
- passwordRestrictionSetting: undefined,
- aiSetting: undefined,
- environmentSetting: undefined,
- sqlQueryRestrictionSetting: undefined,
- };
-}
-
-export const Value: MessageFns<Value> = {
- encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.stringValue !== undefined) {
- writer.uint32(10).string(message.stringValue);
- }
- if (message.appImSettingValue !== undefined) {
- AppIMSetting.encode(message.appImSettingValue, writer.uint32(26).fork()).join();
- }
- if (message.workspaceProfileSettingValue !== undefined) {
- WorkspaceProfileSetting.encode(message.workspaceProfileSettingValue, writer.uint32(42).fork()).join();
- }
- if (message.workspaceApprovalSettingValue !== undefined) {
- WorkspaceApprovalSetting.encode(message.workspaceApprovalSettingValue, writer.uint32(50).fork()).join();
- }
- if (message.schemaTemplateSettingValue !== undefined) {
- SchemaTemplateSetting.encode(message.schemaTemplateSettingValue, writer.uint32(74).fork()).join();
- }
- if (message.dataClassificationSettingValue !== undefined) {
- DataClassificationSetting.encode(message.dataClassificationSettingValue, writer.uint32(82).fork()).join();
- }
- if (message.semanticTypeSettingValue !== undefined) {
- SemanticTypeSetting.encode(message.semanticTypeSettingValue, writer.uint32(90).fork()).join();
- }
- if (message.scimSetting !== undefined) {
- SCIMSetting.encode(message.scimSetting, writer.uint32(114).fork()).join();
- }
- if (message.passwordRestrictionSetting !== undefined) {
- PasswordRestrictionSetting.encode(message.passwordRestrictionSetting, writer.uint32(122).fork()).join();
- }
- if (message.aiSetting !== undefined) {
- AISetting.encode(message.aiSetting, writer.uint32(130).fork()).join();
- }
- if (message.environmentSetting !== undefined) {
- EnvironmentSetting.encode(message.environmentSetting, writer.uint32(138).fork()).join();
- }
- if (message.sqlQueryRestrictionSetting !== undefined) {
- SQLQueryRestrictionSetting.encode(message.sqlQueryRestrictionSetting, writer.uint32(146).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Value {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseValue();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.stringValue = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.appImSettingValue = AppIMSetting.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.workspaceProfileSettingValue = WorkspaceProfileSetting.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.workspaceApprovalSettingValue = WorkspaceApprovalSetting.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.schemaTemplateSettingValue = SchemaTemplateSetting.decode(reader, reader.uint32());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.dataClassificationSettingValue = DataClassificationSetting.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.semanticTypeSettingValue = SemanticTypeSetting.decode(reader, reader.uint32());
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.scimSetting = SCIMSetting.decode(reader, reader.uint32());
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.passwordRestrictionSetting = PasswordRestrictionSetting.decode(reader, reader.uint32());
- continue;
- }
- case 16: {
- if (tag !== 130) {
- break;
- }
-
- message.aiSetting = AISetting.decode(reader, reader.uint32());
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.environmentSetting = EnvironmentSetting.decode(reader, reader.uint32());
- continue;
- }
- case 18: {
- if (tag !== 146) {
- break;
- }
-
- message.sqlQueryRestrictionSetting = SQLQueryRestrictionSetting.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Value {
- return {
- stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
- appImSettingValue: isSet(object.appImSettingValue) ? AppIMSetting.fromJSON(object.appImSettingValue) : undefined,
- workspaceProfileSettingValue: isSet(object.workspaceProfileSettingValue)
- ? WorkspaceProfileSetting.fromJSON(object.workspaceProfileSettingValue)
- : undefined,
- workspaceApprovalSettingValue: isSet(object.workspaceApprovalSettingValue)
- ? WorkspaceApprovalSetting.fromJSON(object.workspaceApprovalSettingValue)
- : undefined,
- schemaTemplateSettingValue: isSet(object.schemaTemplateSettingValue)
- ? SchemaTemplateSetting.fromJSON(object.schemaTemplateSettingValue)
- : undefined,
- dataClassificationSettingValue: isSet(object.dataClassificationSettingValue)
- ? DataClassificationSetting.fromJSON(object.dataClassificationSettingValue)
- : undefined,
- semanticTypeSettingValue: isSet(object.semanticTypeSettingValue)
- ? SemanticTypeSetting.fromJSON(object.semanticTypeSettingValue)
- : undefined,
- scimSetting: isSet(object.scimSetting) ? SCIMSetting.fromJSON(object.scimSetting) : undefined,
- passwordRestrictionSetting: isSet(object.passwordRestrictionSetting)
- ? PasswordRestrictionSetting.fromJSON(object.passwordRestrictionSetting)
- : undefined,
- aiSetting: isSet(object.aiSetting) ? AISetting.fromJSON(object.aiSetting) : undefined,
- environmentSetting: isSet(object.environmentSetting)
- ? EnvironmentSetting.fromJSON(object.environmentSetting)
- : undefined,
- sqlQueryRestrictionSetting: isSet(object.sqlQueryRestrictionSetting)
- ? SQLQueryRestrictionSetting.fromJSON(object.sqlQueryRestrictionSetting)
- : undefined,
- };
- },
-
- toJSON(message: Value): unknown {
- const obj: any = {};
- if (message.stringValue !== undefined) {
- obj.stringValue = message.stringValue;
- }
- if (message.appImSettingValue !== undefined) {
- obj.appImSettingValue = AppIMSetting.toJSON(message.appImSettingValue);
- }
- if (message.workspaceProfileSettingValue !== undefined) {
- obj.workspaceProfileSettingValue = WorkspaceProfileSetting.toJSON(message.workspaceProfileSettingValue);
- }
- if (message.workspaceApprovalSettingValue !== undefined) {
- obj.workspaceApprovalSettingValue = WorkspaceApprovalSetting.toJSON(message.workspaceApprovalSettingValue);
- }
- if (message.schemaTemplateSettingValue !== undefined) {
- obj.schemaTemplateSettingValue = SchemaTemplateSetting.toJSON(message.schemaTemplateSettingValue);
- }
- if (message.dataClassificationSettingValue !== undefined) {
- obj.dataClassificationSettingValue = DataClassificationSetting.toJSON(message.dataClassificationSettingValue);
- }
- if (message.semanticTypeSettingValue !== undefined) {
- obj.semanticTypeSettingValue = SemanticTypeSetting.toJSON(message.semanticTypeSettingValue);
- }
- if (message.scimSetting !== undefined) {
- obj.scimSetting = SCIMSetting.toJSON(message.scimSetting);
- }
- if (message.passwordRestrictionSetting !== undefined) {
- obj.passwordRestrictionSetting = PasswordRestrictionSetting.toJSON(message.passwordRestrictionSetting);
- }
- if (message.aiSetting !== undefined) {
- obj.aiSetting = AISetting.toJSON(message.aiSetting);
- }
- if (message.environmentSetting !== undefined) {
- obj.environmentSetting = EnvironmentSetting.toJSON(message.environmentSetting);
- }
- if (message.sqlQueryRestrictionSetting !== undefined) {
- obj.sqlQueryRestrictionSetting = SQLQueryRestrictionSetting.toJSON(message.sqlQueryRestrictionSetting);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Value>): Value {
- return Value.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Value>): Value {
- const message = createBaseValue();
- message.stringValue = object.stringValue ?? undefined;
- message.appImSettingValue = (object.appImSettingValue !== undefined && object.appImSettingValue !== null)
- ? AppIMSetting.fromPartial(object.appImSettingValue)
- : undefined;
- message.workspaceProfileSettingValue =
- (object.workspaceProfileSettingValue !== undefined && object.workspaceProfileSettingValue !== null)
- ? WorkspaceProfileSetting.fromPartial(object.workspaceProfileSettingValue)
- : undefined;
- message.workspaceApprovalSettingValue =
- (object.workspaceApprovalSettingValue !== undefined && object.workspaceApprovalSettingValue !== null)
- ? WorkspaceApprovalSetting.fromPartial(object.workspaceApprovalSettingValue)
- : undefined;
- message.schemaTemplateSettingValue =
- (object.schemaTemplateSettingValue !== undefined && object.schemaTemplateSettingValue !== null)
- ? SchemaTemplateSetting.fromPartial(object.schemaTemplateSettingValue)
- : undefined;
- message.dataClassificationSettingValue =
- (object.dataClassificationSettingValue !== undefined && object.dataClassificationSettingValue !== null)
- ? DataClassificationSetting.fromPartial(object.dataClassificationSettingValue)
- : undefined;
- message.semanticTypeSettingValue =
- (object.semanticTypeSettingValue !== undefined && object.semanticTypeSettingValue !== null)
- ? SemanticTypeSetting.fromPartial(object.semanticTypeSettingValue)
- : undefined;
- message.scimSetting = (object.scimSetting !== undefined && object.scimSetting !== null)
- ? SCIMSetting.fromPartial(object.scimSetting)
- : undefined;
- message.passwordRestrictionSetting =
- (object.passwordRestrictionSetting !== undefined && object.passwordRestrictionSetting !== null)
- ? PasswordRestrictionSetting.fromPartial(object.passwordRestrictionSetting)
- : undefined;
- message.aiSetting = (object.aiSetting !== undefined && object.aiSetting !== null)
- ? AISetting.fromPartial(object.aiSetting)
- : undefined;
- message.environmentSetting = (object.environmentSetting !== undefined && object.environmentSetting !== null)
- ? EnvironmentSetting.fromPartial(object.environmentSetting)
- : undefined;
- message.sqlQueryRestrictionSetting =
- (object.sqlQueryRestrictionSetting !== undefined && object.sqlQueryRestrictionSetting !== null)
- ? SQLQueryRestrictionSetting.fromPartial(object.sqlQueryRestrictionSetting)
- : undefined;
- return message;
- },
-};
-
-function createBaseAppIMSetting(): AppIMSetting {
- return { slack: undefined, feishu: undefined, wecom: undefined, lark: undefined, dingtalk: undefined };
-}
-
-export const AppIMSetting: MessageFns<AppIMSetting> = {
- encode(message: AppIMSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.slack !== undefined) {
- AppIMSetting_Slack.encode(message.slack, writer.uint32(10).fork()).join();
- }
- if (message.feishu !== undefined) {
- AppIMSetting_Feishu.encode(message.feishu, writer.uint32(18).fork()).join();
- }
- if (message.wecom !== undefined) {
- AppIMSetting_Wecom.encode(message.wecom, writer.uint32(26).fork()).join();
- }
- if (message.lark !== undefined) {
- AppIMSetting_Lark.encode(message.lark, writer.uint32(34).fork()).join();
- }
- if (message.dingtalk !== undefined) {
- AppIMSetting_DingTalk.encode(message.dingtalk, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.slack = AppIMSetting_Slack.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.feishu = AppIMSetting_Feishu.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.wecom = AppIMSetting_Wecom.decode(reader, reader.uint32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.lark = AppIMSetting_Lark.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.dingtalk = AppIMSetting_DingTalk.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting {
- return {
- slack: isSet(object.slack) ? AppIMSetting_Slack.fromJSON(object.slack) : undefined,
- feishu: isSet(object.feishu) ? AppIMSetting_Feishu.fromJSON(object.feishu) : undefined,
- wecom: isSet(object.wecom) ? AppIMSetting_Wecom.fromJSON(object.wecom) : undefined,
- lark: isSet(object.lark) ? AppIMSetting_Lark.fromJSON(object.lark) : undefined,
- dingtalk: isSet(object.dingtalk) ? AppIMSetting_DingTalk.fromJSON(object.dingtalk) : undefined,
- };
- },
-
- toJSON(message: AppIMSetting): unknown {
- const obj: any = {};
- if (message.slack !== undefined) {
- obj.slack = AppIMSetting_Slack.toJSON(message.slack);
- }
- if (message.feishu !== undefined) {
- obj.feishu = AppIMSetting_Feishu.toJSON(message.feishu);
- }
- if (message.wecom !== undefined) {
- obj.wecom = AppIMSetting_Wecom.toJSON(message.wecom);
- }
- if (message.lark !== undefined) {
- obj.lark = AppIMSetting_Lark.toJSON(message.lark);
- }
- if (message.dingtalk !== undefined) {
- obj.dingtalk = AppIMSetting_DingTalk.toJSON(message.dingtalk);
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting>): AppIMSetting {
- return AppIMSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting>): AppIMSetting {
- const message = createBaseAppIMSetting();
- message.slack = (object.slack !== undefined && object.slack !== null)
- ? AppIMSetting_Slack.fromPartial(object.slack)
- : undefined;
- message.feishu = (object.feishu !== undefined && object.feishu !== null)
- ? AppIMSetting_Feishu.fromPartial(object.feishu)
- : undefined;
- message.wecom = (object.wecom !== undefined && object.wecom !== null)
- ? AppIMSetting_Wecom.fromPartial(object.wecom)
- : undefined;
- message.lark = (object.lark !== undefined && object.lark !== null)
- ? AppIMSetting_Lark.fromPartial(object.lark)
- : undefined;
- message.dingtalk = (object.dingtalk !== undefined && object.dingtalk !== null)
- ? AppIMSetting_DingTalk.fromPartial(object.dingtalk)
- : undefined;
- return message;
- },
-};
-
-function createBaseAppIMSetting_Slack(): AppIMSetting_Slack {
- return { enabled: false, token: "" };
-}
-
-export const AppIMSetting_Slack: MessageFns<AppIMSetting_Slack> = {
- encode(message: AppIMSetting_Slack, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.token !== "") {
- writer.uint32(18).string(message.token);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting_Slack {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting_Slack();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.token = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting_Slack {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- token: isSet(object.token) ? globalThis.String(object.token) : "",
- };
- },
-
- toJSON(message: AppIMSetting_Slack): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.token !== "") {
- obj.token = message.token;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting_Slack>): AppIMSetting_Slack {
- return AppIMSetting_Slack.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting_Slack>): AppIMSetting_Slack {
- const message = createBaseAppIMSetting_Slack();
- message.enabled = object.enabled ?? false;
- message.token = object.token ?? "";
- return message;
- },
-};
-
-function createBaseAppIMSetting_Feishu(): AppIMSetting_Feishu {
- return { enabled: false, appId: "", appSecret: "" };
-}
-
-export const AppIMSetting_Feishu: MessageFns<AppIMSetting_Feishu> = {
- encode(message: AppIMSetting_Feishu, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.appId !== "") {
- writer.uint32(18).string(message.appId);
- }
- if (message.appSecret !== "") {
- writer.uint32(26).string(message.appSecret);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting_Feishu {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting_Feishu();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.appId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.appSecret = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting_Feishu {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
- appSecret: isSet(object.appSecret) ? globalThis.String(object.appSecret) : "",
- };
- },
-
- toJSON(message: AppIMSetting_Feishu): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.appId !== "") {
- obj.appId = message.appId;
- }
- if (message.appSecret !== "") {
- obj.appSecret = message.appSecret;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting_Feishu>): AppIMSetting_Feishu {
- return AppIMSetting_Feishu.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting_Feishu>): AppIMSetting_Feishu {
- const message = createBaseAppIMSetting_Feishu();
- message.enabled = object.enabled ?? false;
- message.appId = object.appId ?? "";
- message.appSecret = object.appSecret ?? "";
- return message;
- },
-};
-
-function createBaseAppIMSetting_Wecom(): AppIMSetting_Wecom {
- return { enabled: false, corpId: "", agentId: "", secret: "" };
-}
-
-export const AppIMSetting_Wecom: MessageFns<AppIMSetting_Wecom> = {
- encode(message: AppIMSetting_Wecom, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.corpId !== "") {
- writer.uint32(18).string(message.corpId);
- }
- if (message.agentId !== "") {
- writer.uint32(26).string(message.agentId);
- }
- if (message.secret !== "") {
- writer.uint32(34).string(message.secret);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting_Wecom {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting_Wecom();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.corpId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.agentId = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.secret = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting_Wecom {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- corpId: isSet(object.corpId) ? globalThis.String(object.corpId) : "",
- agentId: isSet(object.agentId) ? globalThis.String(object.agentId) : "",
- secret: isSet(object.secret) ? globalThis.String(object.secret) : "",
- };
- },
-
- toJSON(message: AppIMSetting_Wecom): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.corpId !== "") {
- obj.corpId = message.corpId;
- }
- if (message.agentId !== "") {
- obj.agentId = message.agentId;
- }
- if (message.secret !== "") {
- obj.secret = message.secret;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting_Wecom>): AppIMSetting_Wecom {
- return AppIMSetting_Wecom.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting_Wecom>): AppIMSetting_Wecom {
- const message = createBaseAppIMSetting_Wecom();
- message.enabled = object.enabled ?? false;
- message.corpId = object.corpId ?? "";
- message.agentId = object.agentId ?? "";
- message.secret = object.secret ?? "";
- return message;
- },
-};
-
-function createBaseAppIMSetting_Lark(): AppIMSetting_Lark {
- return { enabled: false, appId: "", appSecret: "" };
-}
-
-export const AppIMSetting_Lark: MessageFns<AppIMSetting_Lark> = {
- encode(message: AppIMSetting_Lark, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.appId !== "") {
- writer.uint32(18).string(message.appId);
- }
- if (message.appSecret !== "") {
- writer.uint32(26).string(message.appSecret);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting_Lark {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting_Lark();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.appId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.appSecret = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting_Lark {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
- appSecret: isSet(object.appSecret) ? globalThis.String(object.appSecret) : "",
- };
- },
-
- toJSON(message: AppIMSetting_Lark): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.appId !== "") {
- obj.appId = message.appId;
- }
- if (message.appSecret !== "") {
- obj.appSecret = message.appSecret;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting_Lark>): AppIMSetting_Lark {
- return AppIMSetting_Lark.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting_Lark>): AppIMSetting_Lark {
- const message = createBaseAppIMSetting_Lark();
- message.enabled = object.enabled ?? false;
- message.appId = object.appId ?? "";
- message.appSecret = object.appSecret ?? "";
- return message;
- },
-};
-
-function createBaseAppIMSetting_DingTalk(): AppIMSetting_DingTalk {
- return { enabled: false, clientId: "", clientSecret: "", robotCode: "" };
-}
-
-export const AppIMSetting_DingTalk: MessageFns<AppIMSetting_DingTalk> = {
- encode(message: AppIMSetting_DingTalk, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.clientId !== "") {
- writer.uint32(18).string(message.clientId);
- }
- if (message.clientSecret !== "") {
- writer.uint32(26).string(message.clientSecret);
- }
- if (message.robotCode !== "") {
- writer.uint32(34).string(message.robotCode);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AppIMSetting_DingTalk {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAppIMSetting_DingTalk();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.clientId = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.clientSecret = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.robotCode = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AppIMSetting_DingTalk {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
- clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
- robotCode: isSet(object.robotCode) ? globalThis.String(object.robotCode) : "",
- };
- },
-
- toJSON(message: AppIMSetting_DingTalk): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.clientId !== "") {
- obj.clientId = message.clientId;
- }
- if (message.clientSecret !== "") {
- obj.clientSecret = message.clientSecret;
- }
- if (message.robotCode !== "") {
- obj.robotCode = message.robotCode;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AppIMSetting_DingTalk>): AppIMSetting_DingTalk {
- return AppIMSetting_DingTalk.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AppIMSetting_DingTalk>): AppIMSetting_DingTalk {
- const message = createBaseAppIMSetting_DingTalk();
- message.enabled = object.enabled ?? false;
- message.clientId = object.clientId ?? "";
- message.clientSecret = object.clientSecret ?? "";
- message.robotCode = object.robotCode ?? "";
- return message;
- },
-};
-
-function createBaseWorkspaceProfileSetting(): WorkspaceProfileSetting {
- return {
- externalUrl: "",
- disallowSignup: false,
- require2fa: false,
- tokenDuration: undefined,
- announcement: undefined,
- maximumRoleExpiration: undefined,
- domains: [],
- enforceIdentityDomain: false,
- databaseChangeMode: DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED,
- disallowPasswordSignin: false,
- };
-}
-
-export const WorkspaceProfileSetting: MessageFns<WorkspaceProfileSetting> = {
- encode(message: WorkspaceProfileSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.externalUrl !== "") {
- writer.uint32(10).string(message.externalUrl);
- }
- if (message.disallowSignup !== false) {
- writer.uint32(16).bool(message.disallowSignup);
- }
- if (message.require2fa !== false) {
- writer.uint32(24).bool(message.require2fa);
- }
- if (message.tokenDuration !== undefined) {
- Duration.encode(message.tokenDuration, writer.uint32(50).fork()).join();
- }
- if (message.announcement !== undefined) {
- Announcement.encode(message.announcement, writer.uint32(58).fork()).join();
- }
- if (message.maximumRoleExpiration !== undefined) {
- Duration.encode(message.maximumRoleExpiration, writer.uint32(66).fork()).join();
- }
- for (const v of message.domains) {
- writer.uint32(74).string(v!);
- }
- if (message.enforceIdentityDomain !== false) {
- writer.uint32(80).bool(message.enforceIdentityDomain);
- }
- if (message.databaseChangeMode !== DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED) {
- writer.uint32(88).int32(databaseChangeModeToNumber(message.databaseChangeMode));
- }
- if (message.disallowPasswordSignin !== false) {
- writer.uint32(96).bool(message.disallowPasswordSignin);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceProfileSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWorkspaceProfileSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.externalUrl = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.disallowSignup = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.require2fa = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.tokenDuration = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.announcement = Announcement.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.maximumRoleExpiration = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.domains.push(reader.string());
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.enforceIdentityDomain = reader.bool();
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.databaseChangeMode = databaseChangeModeFromJSON(reader.int32());
- continue;
- }
- case 12: {
- if (tag !== 96) {
- break;
- }
-
- message.disallowPasswordSignin = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): WorkspaceProfileSetting {
- return {
- externalUrl: isSet(object.externalUrl) ? globalThis.String(object.externalUrl) : "",
- disallowSignup: isSet(object.disallowSignup) ? globalThis.Boolean(object.disallowSignup) : false,
- require2fa: isSet(object.require2fa) ? globalThis.Boolean(object.require2fa) : false,
- tokenDuration: isSet(object.tokenDuration) ? Duration.fromJSON(object.tokenDuration) : undefined,
- announcement: isSet(object.announcement) ? Announcement.fromJSON(object.announcement) : undefined,
- maximumRoleExpiration: isSet(object.maximumRoleExpiration)
- ? Duration.fromJSON(object.maximumRoleExpiration)
- : undefined,
- domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e: any) => globalThis.String(e)) : [],
- enforceIdentityDomain: isSet(object.enforceIdentityDomain)
- ? globalThis.Boolean(object.enforceIdentityDomain)
- : false,
- databaseChangeMode: isSet(object.databaseChangeMode)
- ? databaseChangeModeFromJSON(object.databaseChangeMode)
- : DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED,
- disallowPasswordSignin: isSet(object.disallowPasswordSignin)
- ? globalThis.Boolean(object.disallowPasswordSignin)
- : false,
- };
- },
-
- toJSON(message: WorkspaceProfileSetting): unknown {
- const obj: any = {};
- if (message.externalUrl !== "") {
- obj.externalUrl = message.externalUrl;
- }
- if (message.disallowSignup !== false) {
- obj.disallowSignup = message.disallowSignup;
- }
- if (message.require2fa !== false) {
- obj.require2fa = message.require2fa;
- }
- if (message.tokenDuration !== undefined) {
- obj.tokenDuration = Duration.toJSON(message.tokenDuration);
- }
- if (message.announcement !== undefined) {
- obj.announcement = Announcement.toJSON(message.announcement);
- }
- if (message.maximumRoleExpiration !== undefined) {
- obj.maximumRoleExpiration = Duration.toJSON(message.maximumRoleExpiration);
- }
- if (message.domains?.length) {
- obj.domains = message.domains;
- }
- if (message.enforceIdentityDomain !== false) {
- obj.enforceIdentityDomain = message.enforceIdentityDomain;
- }
- if (message.databaseChangeMode !== DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED) {
- obj.databaseChangeMode = databaseChangeModeToJSON(message.databaseChangeMode);
- }
- if (message.disallowPasswordSignin !== false) {
- obj.disallowPasswordSignin = message.disallowPasswordSignin;
- }
- return obj;
- },
-
- create(base?: DeepPartial<WorkspaceProfileSetting>): WorkspaceProfileSetting {
- return WorkspaceProfileSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<WorkspaceProfileSetting>): WorkspaceProfileSetting {
- const message = createBaseWorkspaceProfileSetting();
- message.externalUrl = object.externalUrl ?? "";
- message.disallowSignup = object.disallowSignup ?? false;
- message.require2fa = object.require2fa ?? false;
- message.tokenDuration = (object.tokenDuration !== undefined && object.tokenDuration !== null)
- ? Duration.fromPartial(object.tokenDuration)
- : undefined;
- message.announcement = (object.announcement !== undefined && object.announcement !== null)
- ? Announcement.fromPartial(object.announcement)
- : undefined;
- message.maximumRoleExpiration =
- (object.maximumRoleExpiration !== undefined && object.maximumRoleExpiration !== null)
- ? Duration.fromPartial(object.maximumRoleExpiration)
- : undefined;
- message.domains = object.domains?.map((e) => e) || [];
- message.enforceIdentityDomain = object.enforceIdentityDomain ?? false;
- message.databaseChangeMode = object.databaseChangeMode ?? DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED;
- message.disallowPasswordSignin = object.disallowPasswordSignin ?? false;
- return message;
- },
-};
-
-function createBaseAnnouncement(): Announcement {
- return { level: Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED, text: "", link: "" };
-}
-
-export const Announcement: MessageFns<Announcement> = {
- encode(message: Announcement, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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);
- }
- if (message.link !== "") {
- writer.uint32(26).string(message.link);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Announcement {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAnnouncement();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.level = announcement_AlertLevelFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.text = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.link = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Announcement {
- return {
- level: isSet(object.level)
- ? announcement_AlertLevelFromJSON(object.level)
- : Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED,
- text: isSet(object.text) ? globalThis.String(object.text) : "",
- link: isSet(object.link) ? globalThis.String(object.link) : "",
- };
- },
-
- toJSON(message: Announcement): unknown {
- const obj: any = {};
- if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
- obj.level = announcement_AlertLevelToJSON(message.level);
- }
- if (message.text !== "") {
- obj.text = message.text;
- }
- if (message.link !== "") {
- obj.link = message.link;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Announcement>): Announcement {
- return Announcement.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Announcement>): Announcement {
- const message = createBaseAnnouncement();
- message.level = object.level ?? Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED;
- message.text = object.text ?? "";
- message.link = object.link ?? "";
- return message;
- },
-};
-
-function createBaseWorkspaceApprovalSetting(): WorkspaceApprovalSetting {
- return { rules: [] };
-}
-
-export const WorkspaceApprovalSetting: MessageFns<WorkspaceApprovalSetting> = {
- encode(message: WorkspaceApprovalSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.rules) {
- WorkspaceApprovalSetting_Rule.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceApprovalSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWorkspaceApprovalSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.rules.push(WorkspaceApprovalSetting_Rule.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): WorkspaceApprovalSetting {
- return {
- rules: globalThis.Array.isArray(object?.rules)
- ? object.rules.map((e: any) => WorkspaceApprovalSetting_Rule.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: WorkspaceApprovalSetting): unknown {
- const obj: any = {};
- if (message.rules?.length) {
- obj.rules = message.rules.map((e) => WorkspaceApprovalSetting_Rule.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<WorkspaceApprovalSetting>): WorkspaceApprovalSetting {
- return WorkspaceApprovalSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<WorkspaceApprovalSetting>): WorkspaceApprovalSetting {
- const message = createBaseWorkspaceApprovalSetting();
- message.rules = object.rules?.map((e) => WorkspaceApprovalSetting_Rule.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseWorkspaceApprovalSetting_Rule(): WorkspaceApprovalSetting_Rule {
- return { template: undefined, condition: undefined };
-}
-
-export const WorkspaceApprovalSetting_Rule: MessageFns<WorkspaceApprovalSetting_Rule> = {
- encode(message: WorkspaceApprovalSetting_Rule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.template !== undefined) {
- ApprovalTemplate.encode(message.template, writer.uint32(18).fork()).join();
- }
- if (message.condition !== undefined) {
- Expr.encode(message.condition, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceApprovalSetting_Rule {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWorkspaceApprovalSetting_Rule();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.template = ApprovalTemplate.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.condition = Expr.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): WorkspaceApprovalSetting_Rule {
- return {
- template: isSet(object.template) ? ApprovalTemplate.fromJSON(object.template) : undefined,
- condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- };
- },
-
- toJSON(message: WorkspaceApprovalSetting_Rule): unknown {
- const obj: any = {};
- if (message.template !== undefined) {
- obj.template = ApprovalTemplate.toJSON(message.template);
- }
- if (message.condition !== undefined) {
- obj.condition = Expr.toJSON(message.condition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<WorkspaceApprovalSetting_Rule>): WorkspaceApprovalSetting_Rule {
- return WorkspaceApprovalSetting_Rule.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<WorkspaceApprovalSetting_Rule>): WorkspaceApprovalSetting_Rule {
- const message = createBaseWorkspaceApprovalSetting_Rule();
- message.template = (object.template !== undefined && object.template !== null)
- ? ApprovalTemplate.fromPartial(object.template)
- : undefined;
- message.condition = (object.condition !== undefined && object.condition !== null)
- ? Expr.fromPartial(object.condition)
- : undefined;
- return message;
- },
-};
-
-function createBaseSchemaTemplateSetting(): SchemaTemplateSetting {
- return { fieldTemplates: [], columnTypes: [], tableTemplates: [] };
-}
-
-export const SchemaTemplateSetting: MessageFns<SchemaTemplateSetting> = {
- encode(message: SchemaTemplateSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.fieldTemplates) {
- SchemaTemplateSetting_FieldTemplate.encode(v!, writer.uint32(10).fork()).join();
- }
- for (const v of message.columnTypes) {
- SchemaTemplateSetting_ColumnType.encode(v!, writer.uint32(18).fork()).join();
- }
- for (const v of message.tableTemplates) {
- SchemaTemplateSetting_TableTemplate.encode(v!, writer.uint32(26).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaTemplateSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaTemplateSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.fieldTemplates.push(SchemaTemplateSetting_FieldTemplate.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.columnTypes.push(SchemaTemplateSetting_ColumnType.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.tableTemplates.push(SchemaTemplateSetting_TableTemplate.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaTemplateSetting {
- return {
- fieldTemplates: globalThis.Array.isArray(object?.fieldTemplates)
- ? object.fieldTemplates.map((e: any) => SchemaTemplateSetting_FieldTemplate.fromJSON(e))
- : [],
- columnTypes: globalThis.Array.isArray(object?.columnTypes)
- ? object.columnTypes.map((e: any) => SchemaTemplateSetting_ColumnType.fromJSON(e))
- : [],
- tableTemplates: globalThis.Array.isArray(object?.tableTemplates)
- ? object.tableTemplates.map((e: any) => SchemaTemplateSetting_TableTemplate.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: SchemaTemplateSetting): unknown {
- const obj: any = {};
- if (message.fieldTemplates?.length) {
- obj.fieldTemplates = message.fieldTemplates.map((e) => SchemaTemplateSetting_FieldTemplate.toJSON(e));
- }
- if (message.columnTypes?.length) {
- obj.columnTypes = message.columnTypes.map((e) => SchemaTemplateSetting_ColumnType.toJSON(e));
- }
- if (message.tableTemplates?.length) {
- obj.tableTemplates = message.tableTemplates.map((e) => SchemaTemplateSetting_TableTemplate.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaTemplateSetting>): SchemaTemplateSetting {
- return SchemaTemplateSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaTemplateSetting>): SchemaTemplateSetting {
- const message = createBaseSchemaTemplateSetting();
- message.fieldTemplates = object.fieldTemplates?.map((e) => SchemaTemplateSetting_FieldTemplate.fromPartial(e)) ||
- [];
- message.columnTypes = object.columnTypes?.map((e) => SchemaTemplateSetting_ColumnType.fromPartial(e)) || [];
- message.tableTemplates = object.tableTemplates?.map((e) => SchemaTemplateSetting_TableTemplate.fromPartial(e)) ||
- [];
- return message;
- },
-};
-
-function createBaseSchemaTemplateSetting_FieldTemplate(): SchemaTemplateSetting_FieldTemplate {
- return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", column: undefined, catalog: undefined };
-}
-
-export const SchemaTemplateSetting_FieldTemplate: MessageFns<SchemaTemplateSetting_FieldTemplate> = {
- encode(message: SchemaTemplateSetting_FieldTemplate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(16).int32(engineToNumber(message.engine));
- }
- if (message.category !== "") {
- writer.uint32(26).string(message.category);
- }
- if (message.column !== undefined) {
- ColumnMetadata.encode(message.column, writer.uint32(34).fork()).join();
- }
- if (message.catalog !== undefined) {
- ColumnCatalog.encode(message.catalog, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaTemplateSetting_FieldTemplate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaTemplateSetting_FieldTemplate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.category = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.column = ColumnMetadata.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.catalog = ColumnCatalog.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaTemplateSetting_FieldTemplate {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- category: isSet(object.category) ? globalThis.String(object.category) : "",
- column: isSet(object.column) ? ColumnMetadata.fromJSON(object.column) : undefined,
- catalog: isSet(object.catalog) ? ColumnCatalog.fromJSON(object.catalog) : undefined,
- };
- },
-
- toJSON(message: SchemaTemplateSetting_FieldTemplate): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.category !== "") {
- obj.category = message.category;
- }
- if (message.column !== undefined) {
- obj.column = ColumnMetadata.toJSON(message.column);
- }
- if (message.catalog !== undefined) {
- obj.catalog = ColumnCatalog.toJSON(message.catalog);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaTemplateSetting_FieldTemplate>): SchemaTemplateSetting_FieldTemplate {
- return SchemaTemplateSetting_FieldTemplate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaTemplateSetting_FieldTemplate>): SchemaTemplateSetting_FieldTemplate {
- const message = createBaseSchemaTemplateSetting_FieldTemplate();
- message.id = object.id ?? "";
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.category = object.category ?? "";
- message.column = (object.column !== undefined && object.column !== null)
- ? ColumnMetadata.fromPartial(object.column)
- : undefined;
- message.catalog = (object.catalog !== undefined && object.catalog !== null)
- ? ColumnCatalog.fromPartial(object.catalog)
- : undefined;
- return message;
- },
-};
-
-function createBaseSchemaTemplateSetting_ColumnType(): SchemaTemplateSetting_ColumnType {
- return { engine: Engine.ENGINE_UNSPECIFIED, enabled: false, types: [] };
-}
-
-export const SchemaTemplateSetting_ColumnType: MessageFns<SchemaTemplateSetting_ColumnType> = {
- encode(message: SchemaTemplateSetting_ColumnType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(8).int32(engineToNumber(message.engine));
- }
- if (message.enabled !== false) {
- writer.uint32(16).bool(message.enabled);
- }
- for (const v of message.types) {
- writer.uint32(26).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaTemplateSetting_ColumnType {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaTemplateSetting_ColumnType();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.types.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaTemplateSetting_ColumnType {
- return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- types: globalThis.Array.isArray(object?.types) ? object.types.map((e: any) => globalThis.String(e)) : [],
- };
- },
-
- toJSON(message: SchemaTemplateSetting_ColumnType): unknown {
- const obj: any = {};
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.types?.length) {
- obj.types = message.types;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaTemplateSetting_ColumnType>): SchemaTemplateSetting_ColumnType {
- return SchemaTemplateSetting_ColumnType.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaTemplateSetting_ColumnType>): SchemaTemplateSetting_ColumnType {
- const message = createBaseSchemaTemplateSetting_ColumnType();
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.enabled = object.enabled ?? false;
- message.types = object.types?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseSchemaTemplateSetting_TableTemplate(): SchemaTemplateSetting_TableTemplate {
- return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", table: undefined, catalog: undefined };
-}
-
-export const SchemaTemplateSetting_TableTemplate: MessageFns<SchemaTemplateSetting_TableTemplate> = {
- encode(message: SchemaTemplateSetting_TableTemplate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(16).int32(engineToNumber(message.engine));
- }
- if (message.category !== "") {
- writer.uint32(26).string(message.category);
- }
- if (message.table !== undefined) {
- TableMetadata.encode(message.table, writer.uint32(34).fork()).join();
- }
- if (message.catalog !== undefined) {
- TableCatalog.encode(message.catalog, writer.uint32(42).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SchemaTemplateSetting_TableTemplate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSchemaTemplateSetting_TableTemplate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.category = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.table = TableMetadata.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.catalog = TableCatalog.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SchemaTemplateSetting_TableTemplate {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- category: isSet(object.category) ? globalThis.String(object.category) : "",
- table: isSet(object.table) ? TableMetadata.fromJSON(object.table) : undefined,
- catalog: isSet(object.catalog) ? TableCatalog.fromJSON(object.catalog) : undefined,
- };
- },
-
- toJSON(message: SchemaTemplateSetting_TableTemplate): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.category !== "") {
- obj.category = message.category;
- }
- if (message.table !== undefined) {
- obj.table = TableMetadata.toJSON(message.table);
- }
- if (message.catalog !== undefined) {
- obj.catalog = TableCatalog.toJSON(message.catalog);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SchemaTemplateSetting_TableTemplate>): SchemaTemplateSetting_TableTemplate {
- return SchemaTemplateSetting_TableTemplate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SchemaTemplateSetting_TableTemplate>): SchemaTemplateSetting_TableTemplate {
- const message = createBaseSchemaTemplateSetting_TableTemplate();
- message.id = object.id ?? "";
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.category = object.category ?? "";
- message.table = (object.table !== undefined && object.table !== null)
- ? TableMetadata.fromPartial(object.table)
- : undefined;
- message.catalog = (object.catalog !== undefined && object.catalog !== null)
- ? TableCatalog.fromPartial(object.catalog)
- : undefined;
- return message;
- },
-};
-
-function createBaseDataClassificationSetting(): DataClassificationSetting {
- return { configs: [] };
-}
-
-export const DataClassificationSetting: MessageFns<DataClassificationSetting> = {
- encode(message: DataClassificationSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.configs) {
- DataClassificationSetting_DataClassificationConfig.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataClassificationSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataClassificationSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.configs.push(DataClassificationSetting_DataClassificationConfig.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataClassificationSetting {
- return {
- configs: globalThis.Array.isArray(object?.configs)
- ? object.configs.map((e: any) => DataClassificationSetting_DataClassificationConfig.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: DataClassificationSetting): unknown {
- const obj: any = {};
- if (message.configs?.length) {
- obj.configs = message.configs.map((e) => DataClassificationSetting_DataClassificationConfig.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataClassificationSetting>): DataClassificationSetting {
- return DataClassificationSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataClassificationSetting>): DataClassificationSetting {
- const message = createBaseDataClassificationSetting();
- message.configs = object.configs?.map((e) => DataClassificationSetting_DataClassificationConfig.fromPartial(e)) ||
- [];
- return message;
- },
-};
-
-function createBaseDataClassificationSetting_DataClassificationConfig(): DataClassificationSetting_DataClassificationConfig {
- return { id: "", title: "", levels: [], classification: {}, classificationFromConfig: false };
-}
-
-export const DataClassificationSetting_DataClassificationConfig: MessageFns<
- DataClassificationSetting_DataClassificationConfig
-> = {
- encode(
- message: DataClassificationSetting_DataClassificationConfig,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- for (const v of message.levels) {
- DataClassificationSetting_DataClassificationConfig_Level.encode(v!, writer.uint32(26).fork()).join();
- }
- Object.entries(message.classification).forEach(([key, value]) => {
- DataClassificationSetting_DataClassificationConfig_ClassificationEntry.encode(
- { key: key as any, value },
- writer.uint32(34).fork(),
- ).join();
- });
- if (message.classificationFromConfig !== false) {
- writer.uint32(40).bool(message.classificationFromConfig);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataClassificationSetting_DataClassificationConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataClassificationSetting_DataClassificationConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.levels.push(DataClassificationSetting_DataClassificationConfig_Level.decode(reader, reader.uint32()));
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- const entry4 = DataClassificationSetting_DataClassificationConfig_ClassificationEntry.decode(
- reader,
- reader.uint32(),
- );
- if (entry4.value !== undefined) {
- message.classification[entry4.key] = entry4.value;
- }
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.classificationFromConfig = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataClassificationSetting_DataClassificationConfig {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- levels: globalThis.Array.isArray(object?.levels)
- ? object.levels.map((e: any) => DataClassificationSetting_DataClassificationConfig_Level.fromJSON(e))
- : [],
- classification: isObject(object.classification)
- ? Object.entries(object.classification).reduce<
- { [key: string]: DataClassificationSetting_DataClassificationConfig_DataClassification }
- >((acc, [key, value]) => {
- acc[key] = DataClassificationSetting_DataClassificationConfig_DataClassification.fromJSON(value);
- return acc;
- }, {})
- : {},
- classificationFromConfig: isSet(object.classificationFromConfig)
- ? globalThis.Boolean(object.classificationFromConfig)
- : false,
- };
- },
-
- toJSON(message: DataClassificationSetting_DataClassificationConfig): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.levels?.length) {
- obj.levels = message.levels.map((e) => DataClassificationSetting_DataClassificationConfig_Level.toJSON(e));
- }
- if (message.classification) {
- const entries = Object.entries(message.classification);
- if (entries.length > 0) {
- obj.classification = {};
- entries.forEach(([k, v]) => {
- obj.classification[k] = DataClassificationSetting_DataClassificationConfig_DataClassification.toJSON(v);
- });
- }
- }
- if (message.classificationFromConfig !== false) {
- obj.classificationFromConfig = message.classificationFromConfig;
- }
- return obj;
- },
-
- create(
- base?: DeepPartial<DataClassificationSetting_DataClassificationConfig>,
- ): DataClassificationSetting_DataClassificationConfig {
- return DataClassificationSetting_DataClassificationConfig.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataClassificationSetting_DataClassificationConfig>,
- ): DataClassificationSetting_DataClassificationConfig {
- const message = createBaseDataClassificationSetting_DataClassificationConfig();
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.levels =
- object.levels?.map((e) => DataClassificationSetting_DataClassificationConfig_Level.fromPartial(e)) || [];
- message.classification = Object.entries(object.classification ?? {}).reduce<
- { [key: string]: DataClassificationSetting_DataClassificationConfig_DataClassification }
- >((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = DataClassificationSetting_DataClassificationConfig_DataClassification.fromPartial(value);
- }
- return acc;
- }, {});
- message.classificationFromConfig = object.classificationFromConfig ?? false;
- return message;
- },
-};
-
-function createBaseDataClassificationSetting_DataClassificationConfig_Level(): DataClassificationSetting_DataClassificationConfig_Level {
- return { id: "", title: "", description: "" };
-}
-
-export const DataClassificationSetting_DataClassificationConfig_Level: MessageFns<
- DataClassificationSetting_DataClassificationConfig_Level
-> = {
- encode(
- message: DataClassificationSetting_DataClassificationConfig_Level,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataClassificationSetting_DataClassificationConfig_Level {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataClassificationSetting_DataClassificationConfig_Level();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_Level {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- };
- },
-
- toJSON(message: DataClassificationSetting_DataClassificationConfig_Level): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- return obj;
- },
-
- create(
- base?: DeepPartial<DataClassificationSetting_DataClassificationConfig_Level>,
- ): DataClassificationSetting_DataClassificationConfig_Level {
- return DataClassificationSetting_DataClassificationConfig_Level.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataClassificationSetting_DataClassificationConfig_Level>,
- ): DataClassificationSetting_DataClassificationConfig_Level {
- const message = createBaseDataClassificationSetting_DataClassificationConfig_Level();
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- return message;
- },
-};
-
-function createBaseDataClassificationSetting_DataClassificationConfig_DataClassification(): DataClassificationSetting_DataClassificationConfig_DataClassification {
- return { id: "", title: "", description: "", levelId: undefined };
-}
-
-export const DataClassificationSetting_DataClassificationConfig_DataClassification: MessageFns<
- DataClassificationSetting_DataClassificationConfig_DataClassification
-> = {
- encode(
- message: DataClassificationSetting_DataClassificationConfig_DataClassification,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- if (message.levelId !== undefined) {
- writer.uint32(34).string(message.levelId);
- }
- return writer;
- },
-
- decode(
- input: BinaryReader | Uint8Array,
- length?: number,
- ): DataClassificationSetting_DataClassificationConfig_DataClassification {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataClassificationSetting_DataClassificationConfig_DataClassification();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.levelId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_DataClassification {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- levelId: isSet(object.levelId) ? globalThis.String(object.levelId) : undefined,
- };
- },
-
- toJSON(message: DataClassificationSetting_DataClassificationConfig_DataClassification): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.levelId !== undefined) {
- obj.levelId = message.levelId;
- }
- return obj;
- },
-
- create(
- base?: DeepPartial<DataClassificationSetting_DataClassificationConfig_DataClassification>,
- ): DataClassificationSetting_DataClassificationConfig_DataClassification {
- return DataClassificationSetting_DataClassificationConfig_DataClassification.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataClassificationSetting_DataClassificationConfig_DataClassification>,
- ): DataClassificationSetting_DataClassificationConfig_DataClassification {
- const message = createBaseDataClassificationSetting_DataClassificationConfig_DataClassification();
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.levelId = object.levelId ?? undefined;
- return message;
- },
-};
-
-function createBaseDataClassificationSetting_DataClassificationConfig_ClassificationEntry(): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- return { key: "", value: undefined };
-}
-
-export const DataClassificationSetting_DataClassificationConfig_ClassificationEntry: MessageFns<
- DataClassificationSetting_DataClassificationConfig_ClassificationEntry
-> = {
- encode(
- message: DataClassificationSetting_DataClassificationConfig_ClassificationEntry,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== undefined) {
- DataClassificationSetting_DataClassificationConfig_DataClassification.encode(
- message.value,
- writer.uint32(18).fork(),
- ).join();
- }
- return writer;
- },
-
- decode(
- input: BinaryReader | Uint8Array,
- length?: number,
- ): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataClassificationSetting_DataClassificationConfig_ClassificationEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = DataClassificationSetting_DataClassificationConfig_DataClassification.decode(
- reader,
- reader.uint32(),
- );
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value)
- ? DataClassificationSetting_DataClassificationConfig_DataClassification.fromJSON(object.value)
- : undefined,
- };
- },
-
- toJSON(message: DataClassificationSetting_DataClassificationConfig_ClassificationEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== undefined) {
- obj.value = DataClassificationSetting_DataClassificationConfig_DataClassification.toJSON(message.value);
- }
- return obj;
- },
-
- create(
- base?: DeepPartial<DataClassificationSetting_DataClassificationConfig_ClassificationEntry>,
- ): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- return DataClassificationSetting_DataClassificationConfig_ClassificationEntry.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataClassificationSetting_DataClassificationConfig_ClassificationEntry>,
- ): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
- const message = createBaseDataClassificationSetting_DataClassificationConfig_ClassificationEntry();
- message.key = object.key ?? "";
- message.value = (object.value !== undefined && object.value !== null)
- ? DataClassificationSetting_DataClassificationConfig_DataClassification.fromPartial(object.value)
- : undefined;
- return message;
- },
-};
-
-function createBaseSemanticTypeSetting(): SemanticTypeSetting {
- return { types: [] };
-}
-
-export const SemanticTypeSetting: MessageFns<SemanticTypeSetting> = {
- encode(message: SemanticTypeSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.types) {
- SemanticTypeSetting_SemanticType.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SemanticTypeSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSemanticTypeSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.types.push(SemanticTypeSetting_SemanticType.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SemanticTypeSetting {
- return {
- types: globalThis.Array.isArray(object?.types)
- ? object.types.map((e: any) => SemanticTypeSetting_SemanticType.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: SemanticTypeSetting): unknown {
- const obj: any = {};
- if (message.types?.length) {
- obj.types = message.types.map((e) => SemanticTypeSetting_SemanticType.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<SemanticTypeSetting>): SemanticTypeSetting {
- return SemanticTypeSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SemanticTypeSetting>): SemanticTypeSetting {
- const message = createBaseSemanticTypeSetting();
- message.types = object.types?.map((e) => SemanticTypeSetting_SemanticType.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseSemanticTypeSetting_SemanticType(): SemanticTypeSetting_SemanticType {
- return { id: "", title: "", description: "", algorithm: undefined };
-}
-
-export const SemanticTypeSetting_SemanticType: MessageFns<SemanticTypeSetting_SemanticType> = {
- encode(message: SemanticTypeSetting_SemanticType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.id !== "") {
- writer.uint32(10).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(18).string(message.title);
- }
- if (message.description !== "") {
- writer.uint32(26).string(message.description);
- }
- if (message.algorithm !== undefined) {
- Algorithm.encode(message.algorithm, writer.uint32(50).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SemanticTypeSetting_SemanticType {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSemanticTypeSetting_SemanticType();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.description = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.algorithm = Algorithm.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SemanticTypeSetting_SemanticType {
- return {
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- description: isSet(object.description) ? globalThis.String(object.description) : "",
- algorithm: isSet(object.algorithm) ? Algorithm.fromJSON(object.algorithm) : undefined,
- };
- },
-
- toJSON(message: SemanticTypeSetting_SemanticType): unknown {
- const obj: any = {};
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.description !== "") {
- obj.description = message.description;
- }
- if (message.algorithm !== undefined) {
- obj.algorithm = Algorithm.toJSON(message.algorithm);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SemanticTypeSetting_SemanticType>): SemanticTypeSetting_SemanticType {
- return SemanticTypeSetting_SemanticType.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SemanticTypeSetting_SemanticType>): SemanticTypeSetting_SemanticType {
- const message = createBaseSemanticTypeSetting_SemanticType();
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.description = object.description ?? "";
- message.algorithm = (object.algorithm !== undefined && object.algorithm !== null)
- ? Algorithm.fromPartial(object.algorithm)
- : undefined;
- return message;
- },
-};
-
-function createBaseAlgorithm(): Algorithm {
- return { fullMask: undefined, rangeMask: undefined, md5Mask: undefined, innerOuterMask: undefined };
-}
-
-export const Algorithm: MessageFns<Algorithm> = {
- encode(message: Algorithm, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.fullMask !== undefined) {
- Algorithm_FullMask.encode(message.fullMask, writer.uint32(42).fork()).join();
- }
- if (message.rangeMask !== undefined) {
- Algorithm_RangeMask.encode(message.rangeMask, writer.uint32(50).fork()).join();
- }
- if (message.md5Mask !== undefined) {
- Algorithm_MD5Mask.encode(message.md5Mask, writer.uint32(58).fork()).join();
- }
- if (message.innerOuterMask !== undefined) {
- Algorithm_InnerOuterMask.encode(message.innerOuterMask, writer.uint32(66).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.fullMask = Algorithm_FullMask.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.rangeMask = Algorithm_RangeMask.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.md5Mask = Algorithm_MD5Mask.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.innerOuterMask = Algorithm_InnerOuterMask.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm {
- return {
- fullMask: isSet(object.fullMask) ? Algorithm_FullMask.fromJSON(object.fullMask) : undefined,
- rangeMask: isSet(object.rangeMask) ? Algorithm_RangeMask.fromJSON(object.rangeMask) : undefined,
- md5Mask: isSet(object.md5Mask) ? Algorithm_MD5Mask.fromJSON(object.md5Mask) : undefined,
- innerOuterMask: isSet(object.innerOuterMask)
- ? Algorithm_InnerOuterMask.fromJSON(object.innerOuterMask)
- : undefined,
- };
- },
-
- toJSON(message: Algorithm): unknown {
- const obj: any = {};
- if (message.fullMask !== undefined) {
- obj.fullMask = Algorithm_FullMask.toJSON(message.fullMask);
- }
- if (message.rangeMask !== undefined) {
- obj.rangeMask = Algorithm_RangeMask.toJSON(message.rangeMask);
- }
- if (message.md5Mask !== undefined) {
- obj.md5Mask = Algorithm_MD5Mask.toJSON(message.md5Mask);
- }
- if (message.innerOuterMask !== undefined) {
- obj.innerOuterMask = Algorithm_InnerOuterMask.toJSON(message.innerOuterMask);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm>): Algorithm {
- return Algorithm.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm>): Algorithm {
- const message = createBaseAlgorithm();
- message.fullMask = (object.fullMask !== undefined && object.fullMask !== null)
- ? Algorithm_FullMask.fromPartial(object.fullMask)
- : undefined;
- message.rangeMask = (object.rangeMask !== undefined && object.rangeMask !== null)
- ? Algorithm_RangeMask.fromPartial(object.rangeMask)
- : undefined;
- message.md5Mask = (object.md5Mask !== undefined && object.md5Mask !== null)
- ? Algorithm_MD5Mask.fromPartial(object.md5Mask)
- : undefined;
- message.innerOuterMask = (object.innerOuterMask !== undefined && object.innerOuterMask !== null)
- ? Algorithm_InnerOuterMask.fromPartial(object.innerOuterMask)
- : undefined;
- return message;
- },
-};
-
-function createBaseAlgorithm_FullMask(): Algorithm_FullMask {
- return { substitution: "" };
-}
-
-export const Algorithm_FullMask: MessageFns<Algorithm_FullMask> = {
- encode(message: Algorithm_FullMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.substitution !== "") {
- writer.uint32(10).string(message.substitution);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm_FullMask {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm_FullMask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.substitution = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm_FullMask {
- return { substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "" };
- },
-
- toJSON(message: Algorithm_FullMask): unknown {
- const obj: any = {};
- if (message.substitution !== "") {
- obj.substitution = message.substitution;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm_FullMask>): Algorithm_FullMask {
- return Algorithm_FullMask.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm_FullMask>): Algorithm_FullMask {
- const message = createBaseAlgorithm_FullMask();
- message.substitution = object.substitution ?? "";
- return message;
- },
-};
-
-function createBaseAlgorithm_RangeMask(): Algorithm_RangeMask {
- return { slices: [] };
-}
-
-export const Algorithm_RangeMask: MessageFns<Algorithm_RangeMask> = {
- encode(message: Algorithm_RangeMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.slices) {
- Algorithm_RangeMask_Slice.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm_RangeMask {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm_RangeMask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.slices.push(Algorithm_RangeMask_Slice.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm_RangeMask {
- return {
- slices: globalThis.Array.isArray(object?.slices)
- ? object.slices.map((e: any) => Algorithm_RangeMask_Slice.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: Algorithm_RangeMask): unknown {
- const obj: any = {};
- if (message.slices?.length) {
- obj.slices = message.slices.map((e) => Algorithm_RangeMask_Slice.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm_RangeMask>): Algorithm_RangeMask {
- return Algorithm_RangeMask.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm_RangeMask>): Algorithm_RangeMask {
- const message = createBaseAlgorithm_RangeMask();
- message.slices = object.slices?.map((e) => Algorithm_RangeMask_Slice.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseAlgorithm_RangeMask_Slice(): Algorithm_RangeMask_Slice {
- return { start: 0, end: 0, substitution: "" };
-}
-
-export const Algorithm_RangeMask_Slice: MessageFns<Algorithm_RangeMask_Slice> = {
- encode(message: Algorithm_RangeMask_Slice, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.start !== 0) {
- writer.uint32(8).int32(message.start);
- }
- if (message.end !== 0) {
- writer.uint32(16).int32(message.end);
- }
- if (message.substitution !== "") {
- writer.uint32(26).string(message.substitution);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm_RangeMask_Slice {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm_RangeMask_Slice();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.start = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.end = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.substitution = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm_RangeMask_Slice {
- return {
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
- end: isSet(object.end) ? globalThis.Number(object.end) : 0,
- substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "",
- };
- },
-
- toJSON(message: Algorithm_RangeMask_Slice): unknown {
- const obj: any = {};
- if (message.start !== 0) {
- obj.start = Math.round(message.start);
- }
- if (message.end !== 0) {
- obj.end = Math.round(message.end);
- }
- if (message.substitution !== "") {
- obj.substitution = message.substitution;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm_RangeMask_Slice>): Algorithm_RangeMask_Slice {
- return Algorithm_RangeMask_Slice.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm_RangeMask_Slice>): Algorithm_RangeMask_Slice {
- const message = createBaseAlgorithm_RangeMask_Slice();
- message.start = object.start ?? 0;
- message.end = object.end ?? 0;
- message.substitution = object.substitution ?? "";
- return message;
- },
-};
-
-function createBaseAlgorithm_MD5Mask(): Algorithm_MD5Mask {
- return { salt: "" };
-}
-
-export const Algorithm_MD5Mask: MessageFns<Algorithm_MD5Mask> = {
- encode(message: Algorithm_MD5Mask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.salt !== "") {
- writer.uint32(10).string(message.salt);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm_MD5Mask {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm_MD5Mask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.salt = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm_MD5Mask {
- return { salt: isSet(object.salt) ? globalThis.String(object.salt) : "" };
- },
-
- toJSON(message: Algorithm_MD5Mask): unknown {
- const obj: any = {};
- if (message.salt !== "") {
- obj.salt = message.salt;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm_MD5Mask>): Algorithm_MD5Mask {
- return Algorithm_MD5Mask.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm_MD5Mask>): Algorithm_MD5Mask {
- const message = createBaseAlgorithm_MD5Mask();
- message.salt = object.salt ?? "";
- return message;
- },
-};
-
-function createBaseAlgorithm_InnerOuterMask(): Algorithm_InnerOuterMask {
- return {
- prefixLen: 0,
- suffixLen: 0,
- type: Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED,
- substitution: "",
- };
-}
-
-export const Algorithm_InnerOuterMask: MessageFns<Algorithm_InnerOuterMask> = {
- encode(message: Algorithm_InnerOuterMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.prefixLen !== 0) {
- writer.uint32(8).int32(message.prefixLen);
- }
- if (message.suffixLen !== 0) {
- writer.uint32(16).int32(message.suffixLen);
- }
- if (message.type !== Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(algorithm_InnerOuterMask_MaskTypeToNumber(message.type));
- }
- if (message.substitution !== "") {
- writer.uint32(34).string(message.substitution);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Algorithm_InnerOuterMask {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAlgorithm_InnerOuterMask();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.prefixLen = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.suffixLen = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.type = algorithm_InnerOuterMask_MaskTypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.substitution = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Algorithm_InnerOuterMask {
- return {
- prefixLen: isSet(object.prefixLen) ? globalThis.Number(object.prefixLen) : 0,
- suffixLen: isSet(object.suffixLen) ? globalThis.Number(object.suffixLen) : 0,
- type: isSet(object.type)
- ? algorithm_InnerOuterMask_MaskTypeFromJSON(object.type)
- : Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED,
- substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "",
- };
- },
-
- toJSON(message: Algorithm_InnerOuterMask): unknown {
- const obj: any = {};
- if (message.prefixLen !== 0) {
- obj.prefixLen = Math.round(message.prefixLen);
- }
- if (message.suffixLen !== 0) {
- obj.suffixLen = Math.round(message.suffixLen);
- }
- if (message.type !== Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED) {
- obj.type = algorithm_InnerOuterMask_MaskTypeToJSON(message.type);
- }
- if (message.substitution !== "") {
- obj.substitution = message.substitution;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Algorithm_InnerOuterMask>): Algorithm_InnerOuterMask {
- return Algorithm_InnerOuterMask.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Algorithm_InnerOuterMask>): Algorithm_InnerOuterMask {
- const message = createBaseAlgorithm_InnerOuterMask();
- message.prefixLen = object.prefixLen ?? 0;
- message.suffixLen = object.suffixLen ?? 0;
- message.type = object.type ?? Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED;
- message.substitution = object.substitution ?? "";
- return message;
- },
-};
-
-function createBaseSQLQueryRestrictionSetting(): SQLQueryRestrictionSetting {
- return { maximumResultSize: Long.ZERO, maximumResultRows: 0 };
-}
-
-export const SQLQueryRestrictionSetting: MessageFns<SQLQueryRestrictionSetting> = {
- encode(message: SQLQueryRestrictionSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (!message.maximumResultSize.equals(Long.ZERO)) {
- writer.uint32(8).int64(message.maximumResultSize.toString());
- }
- if (message.maximumResultRows !== 0) {
- writer.uint32(16).int32(message.maximumResultRows);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SQLQueryRestrictionSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSQLQueryRestrictionSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.maximumResultSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.maximumResultRows = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SQLQueryRestrictionSetting {
- return {
- maximumResultSize: isSet(object.maximumResultSize) ? Long.fromValue(object.maximumResultSize) : Long.ZERO,
- maximumResultRows: isSet(object.maximumResultRows) ? globalThis.Number(object.maximumResultRows) : 0,
- };
- },
-
- toJSON(message: SQLQueryRestrictionSetting): unknown {
- const obj: any = {};
- if (!message.maximumResultSize.equals(Long.ZERO)) {
- obj.maximumResultSize = (message.maximumResultSize || Long.ZERO).toString();
- }
- if (message.maximumResultRows !== 0) {
- obj.maximumResultRows = Math.round(message.maximumResultRows);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SQLQueryRestrictionSetting>): SQLQueryRestrictionSetting {
- return SQLQueryRestrictionSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SQLQueryRestrictionSetting>): SQLQueryRestrictionSetting {
- const message = createBaseSQLQueryRestrictionSetting();
- message.maximumResultSize = (object.maximumResultSize !== undefined && object.maximumResultSize !== null)
- ? Long.fromValue(object.maximumResultSize)
- : Long.ZERO;
- message.maximumResultRows = object.maximumResultRows ?? 0;
- return message;
- },
-};
-
-function createBaseSCIMSetting(): SCIMSetting {
- return { token: "" };
-}
-
-export const SCIMSetting: MessageFns<SCIMSetting> = {
- encode(message: SCIMSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.token !== "") {
- writer.uint32(10).string(message.token);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SCIMSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSCIMSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.token = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SCIMSetting {
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
- },
-
- toJSON(message: SCIMSetting): unknown {
- const obj: any = {};
- if (message.token !== "") {
- obj.token = message.token;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SCIMSetting>): SCIMSetting {
- return SCIMSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SCIMSetting>): SCIMSetting {
- const message = createBaseSCIMSetting();
- message.token = object.token ?? "";
- return message;
- },
-};
-
-function createBasePasswordRestrictionSetting(): PasswordRestrictionSetting {
- return {
- minLength: 0,
- requireNumber: false,
- requireLetter: false,
- requireUppercaseLetter: false,
- requireSpecialCharacter: false,
- requireResetPasswordForFirstLogin: false,
- passwordRotation: undefined,
- };
-}
-
-export const PasswordRestrictionSetting: MessageFns<PasswordRestrictionSetting> = {
- encode(message: PasswordRestrictionSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.minLength !== 0) {
- writer.uint32(8).int32(message.minLength);
- }
- if (message.requireNumber !== false) {
- writer.uint32(16).bool(message.requireNumber);
- }
- if (message.requireLetter !== false) {
- writer.uint32(24).bool(message.requireLetter);
- }
- if (message.requireUppercaseLetter !== false) {
- writer.uint32(32).bool(message.requireUppercaseLetter);
- }
- if (message.requireSpecialCharacter !== false) {
- writer.uint32(40).bool(message.requireSpecialCharacter);
- }
- if (message.requireResetPasswordForFirstLogin !== false) {
- writer.uint32(48).bool(message.requireResetPasswordForFirstLogin);
- }
- if (message.passwordRotation !== undefined) {
- Duration.encode(message.passwordRotation, writer.uint32(58).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PasswordRestrictionSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePasswordRestrictionSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.minLength = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.requireNumber = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.requireLetter = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.requireUppercaseLetter = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.requireSpecialCharacter = reader.bool();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.requireResetPasswordForFirstLogin = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.passwordRotation = Duration.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PasswordRestrictionSetting {
- return {
- minLength: isSet(object.minLength) ? globalThis.Number(object.minLength) : 0,
- requireNumber: isSet(object.requireNumber) ? globalThis.Boolean(object.requireNumber) : false,
- requireLetter: isSet(object.requireLetter) ? globalThis.Boolean(object.requireLetter) : false,
- requireUppercaseLetter: isSet(object.requireUppercaseLetter)
- ? globalThis.Boolean(object.requireUppercaseLetter)
- : false,
- requireSpecialCharacter: isSet(object.requireSpecialCharacter)
- ? globalThis.Boolean(object.requireSpecialCharacter)
- : false,
- requireResetPasswordForFirstLogin: isSet(object.requireResetPasswordForFirstLogin)
- ? globalThis.Boolean(object.requireResetPasswordForFirstLogin)
- : false,
- passwordRotation: isSet(object.passwordRotation) ? Duration.fromJSON(object.passwordRotation) : undefined,
- };
- },
-
- toJSON(message: PasswordRestrictionSetting): unknown {
- const obj: any = {};
- if (message.minLength !== 0) {
- obj.minLength = Math.round(message.minLength);
- }
- if (message.requireNumber !== false) {
- obj.requireNumber = message.requireNumber;
- }
- if (message.requireLetter !== false) {
- obj.requireLetter = message.requireLetter;
- }
- if (message.requireUppercaseLetter !== false) {
- obj.requireUppercaseLetter = message.requireUppercaseLetter;
- }
- if (message.requireSpecialCharacter !== false) {
- obj.requireSpecialCharacter = message.requireSpecialCharacter;
- }
- if (message.requireResetPasswordForFirstLogin !== false) {
- obj.requireResetPasswordForFirstLogin = message.requireResetPasswordForFirstLogin;
- }
- if (message.passwordRotation !== undefined) {
- obj.passwordRotation = Duration.toJSON(message.passwordRotation);
- }
- return obj;
- },
-
- create(base?: DeepPartial<PasswordRestrictionSetting>): PasswordRestrictionSetting {
- return PasswordRestrictionSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PasswordRestrictionSetting>): PasswordRestrictionSetting {
- const message = createBasePasswordRestrictionSetting();
- message.minLength = object.minLength ?? 0;
- message.requireNumber = object.requireNumber ?? false;
- message.requireLetter = object.requireLetter ?? false;
- message.requireUppercaseLetter = object.requireUppercaseLetter ?? false;
- message.requireSpecialCharacter = object.requireSpecialCharacter ?? false;
- message.requireResetPasswordForFirstLogin = object.requireResetPasswordForFirstLogin ?? false;
- message.passwordRotation = (object.passwordRotation !== undefined && object.passwordRotation !== null)
- ? Duration.fromPartial(object.passwordRotation)
- : undefined;
- return message;
- },
-};
-
-function createBaseAISetting(): AISetting {
- return {
- enabled: false,
- provider: AISetting_Provider.PROVIDER_UNSPECIFIED,
- endpoint: "",
- apiKey: "",
- model: "",
- version: "",
- };
-}
-
-export const AISetting: MessageFns<AISetting> = {
- encode(message: AISetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.enabled !== false) {
- writer.uint32(8).bool(message.enabled);
- }
- if (message.provider !== AISetting_Provider.PROVIDER_UNSPECIFIED) {
- writer.uint32(16).int32(aISetting_ProviderToNumber(message.provider));
- }
- if (message.endpoint !== "") {
- writer.uint32(26).string(message.endpoint);
- }
- if (message.apiKey !== "") {
- writer.uint32(34).string(message.apiKey);
- }
- if (message.model !== "") {
- writer.uint32(42).string(message.model);
- }
- if (message.version !== "") {
- writer.uint32(50).string(message.version);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AISetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAISetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.enabled = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.provider = aISetting_ProviderFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.endpoint = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.apiKey = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.model = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AISetting {
- return {
- enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
- provider: isSet(object.provider)
- ? aISetting_ProviderFromJSON(object.provider)
- : AISetting_Provider.PROVIDER_UNSPECIFIED,
- endpoint: isSet(object.endpoint) ? globalThis.String(object.endpoint) : "",
- apiKey: isSet(object.apiKey) ? globalThis.String(object.apiKey) : "",
- model: isSet(object.model) ? globalThis.String(object.model) : "",
- version: isSet(object.version) ? globalThis.String(object.version) : "",
- };
- },
-
- toJSON(message: AISetting): unknown {
- const obj: any = {};
- if (message.enabled !== false) {
- obj.enabled = message.enabled;
- }
- if (message.provider !== AISetting_Provider.PROVIDER_UNSPECIFIED) {
- obj.provider = aISetting_ProviderToJSON(message.provider);
- }
- if (message.endpoint !== "") {
- obj.endpoint = message.endpoint;
- }
- if (message.apiKey !== "") {
- obj.apiKey = message.apiKey;
- }
- if (message.model !== "") {
- obj.model = message.model;
- }
- if (message.version !== "") {
- obj.version = message.version;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AISetting>): AISetting {
- return AISetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AISetting>): AISetting {
- const message = createBaseAISetting();
- message.enabled = object.enabled ?? false;
- message.provider = object.provider ?? AISetting_Provider.PROVIDER_UNSPECIFIED;
- message.endpoint = object.endpoint ?? "";
- message.apiKey = object.apiKey ?? "";
- message.model = object.model ?? "";
- message.version = object.version ?? "";
- return message;
- },
-};
-
-function createBaseEnvironmentSetting(): EnvironmentSetting {
- return { environments: [] };
-}
-
-export const EnvironmentSetting: MessageFns<EnvironmentSetting> = {
- encode(message: EnvironmentSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.environments) {
- EnvironmentSetting_Environment.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): EnvironmentSetting {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEnvironmentSetting();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.environments.push(EnvironmentSetting_Environment.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): EnvironmentSetting {
- return {
- environments: globalThis.Array.isArray(object?.environments)
- ? object.environments.map((e: any) => EnvironmentSetting_Environment.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: EnvironmentSetting): unknown {
- const obj: any = {};
- if (message.environments?.length) {
- obj.environments = message.environments.map((e) => EnvironmentSetting_Environment.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<EnvironmentSetting>): EnvironmentSetting {
- return EnvironmentSetting.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<EnvironmentSetting>): EnvironmentSetting {
- const message = createBaseEnvironmentSetting();
- message.environments = object.environments?.map((e) => EnvironmentSetting_Environment.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseEnvironmentSetting_Environment(): EnvironmentSetting_Environment {
- return { name: "", id: "", title: "", tags: {}, color: "" };
-}
-
-export const EnvironmentSetting_Environment: MessageFns<EnvironmentSetting_Environment> = {
- encode(message: EnvironmentSetting_Environment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.id !== "") {
- writer.uint32(18).string(message.id);
- }
- if (message.title !== "") {
- writer.uint32(26).string(message.title);
- }
- Object.entries(message.tags).forEach(([key, value]) => {
- EnvironmentSetting_Environment_TagsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
- });
- if (message.color !== "") {
- writer.uint32(42).string(message.color);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): EnvironmentSetting_Environment {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEnvironmentSetting_Environment();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.id = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- const entry4 = EnvironmentSetting_Environment_TagsEntry.decode(reader, reader.uint32());
- if (entry4.value !== undefined) {
- message.tags[entry4.key] = entry4.value;
- }
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.color = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): EnvironmentSetting_Environment {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- id: isSet(object.id) ? globalThis.String(object.id) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- tags: isObject(object.tags)
- ? Object.entries(object.tags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- color: isSet(object.color) ? globalThis.String(object.color) : "",
- };
- },
-
- toJSON(message: EnvironmentSetting_Environment): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.id !== "") {
- obj.id = message.id;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.tags) {
- const entries = Object.entries(message.tags);
- if (entries.length > 0) {
- obj.tags = {};
- entries.forEach(([k, v]) => {
- obj.tags[k] = v;
- });
- }
- }
- if (message.color !== "") {
- obj.color = message.color;
- }
- return obj;
- },
-
- create(base?: DeepPartial<EnvironmentSetting_Environment>): EnvironmentSetting_Environment {
- return EnvironmentSetting_Environment.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<EnvironmentSetting_Environment>): EnvironmentSetting_Environment {
- const message = createBaseEnvironmentSetting_Environment();
- message.name = object.name ?? "";
- message.id = object.id ?? "";
- message.title = object.title ?? "";
- message.tags = Object.entries(object.tags ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
- message.color = object.color ?? "";
- return message;
- },
-};
-
-function createBaseEnvironmentSetting_Environment_TagsEntry(): EnvironmentSetting_Environment_TagsEntry {
- return { key: "", value: "" };
-}
-
-export const EnvironmentSetting_Environment_TagsEntry: MessageFns<EnvironmentSetting_Environment_TagsEntry> = {
- encode(message: EnvironmentSetting_Environment_TagsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): EnvironmentSetting_Environment_TagsEntry {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseEnvironmentSetting_Environment_TagsEntry();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.key = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): EnvironmentSetting_Environment_TagsEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: EnvironmentSetting_Environment_TagsEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<EnvironmentSetting_Environment_TagsEntry>): EnvironmentSetting_Environment_TagsEntry {
- return EnvironmentSetting_Environment_TagsEntry.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<EnvironmentSetting_Environment_TagsEntry>): EnvironmentSetting_Environment_TagsEntry {
- const message = createBaseEnvironmentSetting_Environment_TagsEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
-
-export type SettingServiceDefinition = typeof SettingServiceDefinition;
-export const SettingServiceDefinition = {
- name: "SettingService",
- fullName: "bytebase.v1.SettingService",
- methods: {
- /** Permissions required: bb.settings.list */
- listSettings: {
- name: "ListSettings",
- requestType: ListSettingsRequest,
- requestStream: false,
- responseType: ListSettingsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([16, 98, 98, 46, 115, 101, 116, 116, 105, 110, 103, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [new Uint8Array([14, 18, 12, 47, 118, 49, 47, 115, 101, 116, 116, 105, 110, 103, 115])],
- },
- },
- },
- /** Permissions required: bb.settings.get */
- getSetting: {
- name: "GetSetting",
- requestType: GetSettingRequest,
- requestStream: false,
- responseType: Setting,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([15, 98, 98, 46, 115, 101, 116, 116, 105, 110, 103, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 23,
- 18,
- 21,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 115,
- 101,
- 116,
- 116,
- 105,
- 110,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.settings.set */
- updateSetting: {
- name: "UpdateSetting",
- requestType: UpdateSettingRequest,
- requestStream: false,
- responseType: Setting,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([15, 98, 98, 46, 115, 101, 116, 116, 105, 110, 103, 115, 46, 115, 101, 116])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 40,
- 58,
- 7,
- 115,
- 101,
- 116,
- 116,
- 105,
- 110,
- 103,
- 50,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 115,
- 101,
- 116,
- 116,
- 105,
- 110,
- 103,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 115,
- 101,
- 116,
- 116,
- 105,
- 110,
- 103,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function isObject(value: any): boolean {
- return typeof value === "object" && value !== null;
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
deleted file mode 100644
index 27543302f3..0000000000
--- a/frontend/src/types/proto/v1/sheet_service.ts
+++ /dev/null
@@ -1,1177 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/sheet_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface CreateSheetRequest {
- /**
- * The parent resource where this sheet will be created.
- * Format: projects/{project}
- */
- parent: string;
- /** The sheet to create. */
- sheet: Sheet | undefined;
-}
-
-export interface BatchCreateSheetsRequest {
- /**
- * The parent resource where all sheets will be created.
- * Format: projects/{project}
- */
- parent: string;
- requests: CreateSheetRequest[];
-}
-
-export interface BatchCreateSheetsResponse {
- sheets: Sheet[];
-}
-
-export interface GetSheetRequest {
- /**
- * The name of the sheet to retrieve.
- * Format: projects/{project}/sheets/{sheet}
- */
- name: string;
- /** By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content. */
- raw: boolean;
-}
-
-export interface UpdateSheetRequest {
- /**
- * The sheet to update.
- *
- * The sheet's `name` field is used to identify the sheet to update.
- * Format: projects/{project}/sheets/{sheet}
- */
- sheet:
- | Sheet
- | undefined;
- /**
- * The list of fields to be updated.
- * Fields are specified relative to the sheet.
- * (e.g. `title`, `statement`; *not* `sheet.title` or `sheet.statement`)
- * Only support update the following fields for now:
- * - `title`
- * - `statement`
- */
- updateMask: string[] | undefined;
-}
-
-export interface Sheet {
- /**
- * The name of the sheet resource, generated by the server.
- * Canonical parent is project.
- * Format: projects/{project}/sheets/{sheet}
- */
- name: string;
- /** The title of the sheet. */
- title: string;
- /**
- * The creator of the Sheet.
- * Format: users/{email}
- */
- creator: string;
- /** The create time of the sheet. */
- createTime:
- | Timestamp
- | undefined;
- /**
- * The content of the sheet.
- * By default, it will be cut off, if it doesn't match the `content_size`, you can
- * set the `raw` to true in GetSheet request to retrieve the full content.
- */
- content: Uint8Array;
- /** content_size is the full size of the content, may not match the size of the `content` field. */
- contentSize: Long;
- payload:
- | SheetPayload
- | undefined;
- /** The SQL dialect. */
- engine: Engine;
-}
-
-export interface SheetPayload {
- type: SheetPayload_Type;
- /** The start and end position of each command in the sheet statement. */
- commands: SheetCommand[];
-}
-
-/** Type of the SheetPayload. */
-export enum SheetPayload_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- SCHEMA_DESIGN = "SCHEMA_DESIGN",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function sheetPayload_TypeFromJSON(object: any): SheetPayload_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return SheetPayload_Type.TYPE_UNSPECIFIED;
- case 1:
- case "SCHEMA_DESIGN":
- return SheetPayload_Type.SCHEMA_DESIGN;
- case -1:
- case "UNRECOGNIZED":
- default:
- return SheetPayload_Type.UNRECOGNIZED;
- }
-}
-
-export function sheetPayload_TypeToJSON(object: SheetPayload_Type): string {
- switch (object) {
- case SheetPayload_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case SheetPayload_Type.SCHEMA_DESIGN:
- return "SCHEMA_DESIGN";
- case SheetPayload_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- }
-}
-
-export interface SheetCommand {
- start: number;
- end: number;
-}
-
-function createBaseCreateSheetRequest(): CreateSheetRequest {
- return { parent: "", sheet: undefined };
-}
-
-export const CreateSheetRequest: MessageFns<CreateSheetRequest> = {
- encode(message: CreateSheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.sheet !== undefined) {
- Sheet.encode(message.sheet, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateSheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateSheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.sheet = Sheet.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateSheetRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
- };
- },
-
- toJSON(message: CreateSheetRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.sheet !== undefined) {
- obj.sheet = Sheet.toJSON(message.sheet);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateSheetRequest>): CreateSheetRequest {
- return CreateSheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateSheetRequest>): CreateSheetRequest {
- const message = createBaseCreateSheetRequest();
- message.parent = object.parent ?? "";
- message.sheet = (object.sheet !== undefined && object.sheet !== null) ? Sheet.fromPartial(object.sheet) : undefined;
- return message;
- },
-};
-
-function createBaseBatchCreateSheetsRequest(): BatchCreateSheetsRequest {
- return { parent: "", requests: [] };
-}
-
-export const BatchCreateSheetsRequest: MessageFns<BatchCreateSheetsRequest> = {
- encode(message: BatchCreateSheetsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- for (const v of message.requests) {
- CreateSheetRequest.encode(v!, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateSheetsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCreateSheetsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.requests.push(CreateSheetRequest.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCreateSheetsRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- requests: globalThis.Array.isArray(object?.requests)
- ? object.requests.map((e: any) => CreateSheetRequest.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: BatchCreateSheetsRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.requests?.length) {
- obj.requests = message.requests.map((e) => CreateSheetRequest.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCreateSheetsRequest>): BatchCreateSheetsRequest {
- return BatchCreateSheetsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCreateSheetsRequest>): BatchCreateSheetsRequest {
- const message = createBaseBatchCreateSheetsRequest();
- message.parent = object.parent ?? "";
- message.requests = object.requests?.map((e) => CreateSheetRequest.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseBatchCreateSheetsResponse(): BatchCreateSheetsResponse {
- return { sheets: [] };
-}
-
-export const BatchCreateSheetsResponse: MessageFns<BatchCreateSheetsResponse> = {
- encode(message: BatchCreateSheetsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.sheets) {
- Sheet.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateSheetsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchCreateSheetsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sheets.push(Sheet.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchCreateSheetsResponse {
- return { sheets: globalThis.Array.isArray(object?.sheets) ? object.sheets.map((e: any) => Sheet.fromJSON(e)) : [] };
- },
-
- toJSON(message: BatchCreateSheetsResponse): unknown {
- const obj: any = {};
- if (message.sheets?.length) {
- obj.sheets = message.sheets.map((e) => Sheet.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchCreateSheetsResponse>): BatchCreateSheetsResponse {
- return BatchCreateSheetsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchCreateSheetsResponse>): BatchCreateSheetsResponse {
- const message = createBaseBatchCreateSheetsResponse();
- message.sheets = object.sheets?.map((e) => Sheet.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseGetSheetRequest(): GetSheetRequest {
- return { name: "", raw: false };
-}
-
-export const GetSheetRequest: MessageFns<GetSheetRequest> = {
- encode(message: GetSheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.raw !== false) {
- writer.uint32(16).bool(message.raw);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.raw = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetSheetRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- raw: isSet(object.raw) ? globalThis.Boolean(object.raw) : false,
- };
- },
-
- toJSON(message: GetSheetRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.raw !== false) {
- obj.raw = message.raw;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetSheetRequest>): GetSheetRequest {
- return GetSheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetSheetRequest>): GetSheetRequest {
- const message = createBaseGetSheetRequest();
- message.name = object.name ?? "";
- message.raw = object.raw ?? false;
- return message;
- },
-};
-
-function createBaseUpdateSheetRequest(): UpdateSheetRequest {
- return { sheet: undefined, updateMask: undefined };
-}
-
-export const UpdateSheetRequest: MessageFns<UpdateSheetRequest> = {
- encode(message: UpdateSheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sheet !== undefined) {
- Sheet.encode(message.sheet, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateSheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateSheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sheet = Sheet.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateSheetRequest {
- return {
- sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateSheetRequest): unknown {
- const obj: any = {};
- if (message.sheet !== undefined) {
- obj.sheet = Sheet.toJSON(message.sheet);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateSheetRequest>): UpdateSheetRequest {
- return UpdateSheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateSheetRequest>): UpdateSheetRequest {
- const message = createBaseUpdateSheetRequest();
- message.sheet = (object.sheet !== undefined && object.sheet !== null) ? Sheet.fromPartial(object.sheet) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseSheet(): Sheet {
- return {
- name: "",
- title: "",
- creator: "",
- createTime: undefined,
- content: new Uint8Array(0),
- contentSize: Long.ZERO,
- payload: undefined,
- engine: Engine.ENGINE_UNSPECIFIED,
- };
-}
-
-export const Sheet: MessageFns<Sheet> = {
- encode(message: Sheet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.title !== "") {
- writer.uint32(26).string(message.title);
- }
- if (message.creator !== "") {
- writer.uint32(34).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(42).fork()).join();
- }
- if (message.content.length !== 0) {
- writer.uint32(58).bytes(message.content);
- }
- if (!message.contentSize.equals(Long.ZERO)) {
- writer.uint32(64).int64(message.contentSize.toString());
- }
- if (message.payload !== undefined) {
- SheetPayload.encode(message.payload, writer.uint32(106).fork()).join();
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(112).int32(engineToNumber(message.engine));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Sheet {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSheet();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.content = reader.bytes();
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.contentSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.payload = SheetPayload.decode(reader, reader.uint32());
- continue;
- }
- case 14: {
- if (tag !== 112) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Sheet {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
- contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
- payload: isSet(object.payload) ? SheetPayload.fromJSON(object.payload) : undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- };
- },
-
- toJSON(message: Sheet): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.content.length !== 0) {
- obj.content = base64FromBytes(message.content);
- }
- if (!message.contentSize.equals(Long.ZERO)) {
- obj.contentSize = (message.contentSize || Long.ZERO).toString();
- }
- if (message.payload !== undefined) {
- obj.payload = SheetPayload.toJSON(message.payload);
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Sheet>): Sheet {
- return Sheet.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Sheet>): Sheet {
- const message = createBaseSheet();
- message.name = object.name ?? "";
- message.title = object.title ?? "";
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.content = object.content ?? new Uint8Array(0);
- message.contentSize = (object.contentSize !== undefined && object.contentSize !== null)
- ? Long.fromValue(object.contentSize)
- : Long.ZERO;
- message.payload = (object.payload !== undefined && object.payload !== null)
- ? SheetPayload.fromPartial(object.payload)
- : undefined;
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseSheetPayload(): SheetPayload {
- return { type: SheetPayload_Type.TYPE_UNSPECIFIED, commands: [] };
-}
-
-export const SheetPayload: MessageFns<SheetPayload> = {
- encode(message: SheetPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== SheetPayload_Type.TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(sheetPayload_TypeToNumber(message.type));
- }
- for (const v of message.commands) {
- SheetCommand.encode(v!, writer.uint32(34).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SheetPayload {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSheetPayload();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = sheetPayload_TypeFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.commands.push(SheetCommand.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SheetPayload {
- return {
- type: isSet(object.type) ? sheetPayload_TypeFromJSON(object.type) : SheetPayload_Type.TYPE_UNSPECIFIED,
- commands: globalThis.Array.isArray(object?.commands)
- ? object.commands.map((e: any) => SheetCommand.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: SheetPayload): unknown {
- const obj: any = {};
- if (message.type !== SheetPayload_Type.TYPE_UNSPECIFIED) {
- obj.type = sheetPayload_TypeToJSON(message.type);
- }
- if (message.commands?.length) {
- obj.commands = message.commands.map((e) => SheetCommand.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<SheetPayload>): SheetPayload {
- return SheetPayload.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SheetPayload>): SheetPayload {
- const message = createBaseSheetPayload();
- message.type = object.type ?? SheetPayload_Type.TYPE_UNSPECIFIED;
- message.commands = object.commands?.map((e) => SheetCommand.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseSheetCommand(): SheetCommand {
- return { start: 0, end: 0 };
-}
-
-export const SheetCommand: MessageFns<SheetCommand> = {
- encode(message: SheetCommand, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.start !== 0) {
- writer.uint32(8).int32(message.start);
- }
- if (message.end !== 0) {
- writer.uint32(16).int32(message.end);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SheetCommand {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSheetCommand();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.start = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.end = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SheetCommand {
- return {
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
- end: isSet(object.end) ? globalThis.Number(object.end) : 0,
- };
- },
-
- toJSON(message: SheetCommand): unknown {
- const obj: any = {};
- if (message.start !== 0) {
- obj.start = Math.round(message.start);
- }
- if (message.end !== 0) {
- obj.end = Math.round(message.end);
- }
- return obj;
- },
-
- create(base?: DeepPartial<SheetCommand>): SheetCommand {
- return SheetCommand.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SheetCommand>): SheetCommand {
- const message = createBaseSheetCommand();
- message.start = object.start ?? 0;
- message.end = object.end ?? 0;
- return message;
- },
-};
-
-export type SheetServiceDefinition = typeof SheetServiceDefinition;
-export const SheetServiceDefinition = {
- name: "SheetService",
- fullName: "bytebase.v1.SheetService",
- methods: {
- /** Permissions required: bb.sheets.create */
- createSheet: {
- name: "CreateSheet",
- requestType: CreateSheetRequest,
- requestStream: false,
- responseType: Sheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([12, 112, 97, 114, 101, 110, 116, 44, 115, 104, 101, 101, 116])],
- 800010: [new Uint8Array([16, 98, 98, 46, 115, 104, 101, 101, 116, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 39,
- 58,
- 5,
- 115,
- 104,
- 101,
- 101,
- 116,
- 34,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.sheets.create */
- batchCreateSheets: {
- name: "BatchCreateSheets",
- requestType: BatchCreateSheetsRequest,
- requestStream: false,
- responseType: BatchCreateSheetsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 115, 104, 101, 101, 116, 115, 46, 99, 114, 101, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 47,
- 58,
- 1,
- 42,
- 34,
- 42,
- 47,
- 118,
- 49,
- 47,
- 123,
- 112,
- 97,
- 114,
- 101,
- 110,
- 116,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 67,
- 114,
- 101,
- 97,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.sheets.get */
- getSheet: {
- name: "GetSheet",
- requestType: GetSheetRequest,
- requestStream: false,
- responseType: Sheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800010: [new Uint8Array([13, 98, 98, 46, 115, 104, 101, 101, 116, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 18,
- 30,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.sheets.update */
- updateSheet: {
- name: "UpdateSheet",
- requestType: UpdateSheetRequest,
- requestStream: false,
- responseType: Sheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([17, 115, 104, 101, 101, 116, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800010: [new Uint8Array([16, 98, 98, 46, 115, 104, 101, 101, 116, 115, 46, 117, 112, 100, 97, 116, 101])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 45,
- 58,
- 5,
- 115,
- 104,
- 101,
- 101,
- 116,
- 50,
- 36,
- 47,
- 118,
- 49,
- 47,
- 123,
- 115,
- 104,
- 101,
- 101,
- 116,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
deleted file mode 100644
index 58ca485e0d..0000000000
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ /dev/null
@@ -1,4845 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/sql_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Duration } from "../google/protobuf/duration";
-import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber, Value } from "../google/protobuf/struct";
-import { Timestamp } from "../google/protobuf/timestamp";
-import {
- Engine,
- engineFromJSON,
- engineToJSON,
- engineToNumber,
- ExportFormat,
- exportFormatFromJSON,
- exportFormatToJSON,
- exportFormatToNumber,
- Position,
-} from "./common";
-import { DatabaseCatalog } from "./database_catalog_service";
-import { DatabaseMetadata } from "./database_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface AdminExecuteRequest {
- /**
- * The name is the instance name to execute the query against.
- * Format: instances/{instance}/databases/{databaseName}
- */
- name: string;
- /** The SQL statement to execute. */
- statement: string;
- /** The maximum number of rows to return. */
- limit: number;
- /**
- * The default schema to execute the statement. Equals to the current schema
- * in Oracle and search path in Postgres.
- */
- schema?:
- | string
- | undefined;
- /**
- * Container is the container name to execute the query against, used for
- * CosmosDB only.
- */
- container?: string | undefined;
-}
-
-export interface AdminExecuteResponse {
- /** The query results. */
- results: QueryResult[];
-}
-
-export interface QueryRequest {
- /**
- * The name is the instance name to execute the query against.
- * Format: instances/{instance}/databases/{databaseName}
- */
- name: string;
- /** The SQL statement to execute. */
- statement: string;
- /** The maximum number of rows to return. */
- limit: number;
- /**
- * The id of data source.
- * It is used for querying admin data source even if the instance has
- * read-only data sources. Or it can be used to query a specific read-only
- * data source.
- */
- dataSourceId: string;
- /** Explain the statement. */
- explain: boolean;
- /**
- * The default schema to search objects. Equals to the current schema in
- * Oracle and search path in Postgres.
- */
- schema?: string | undefined;
- queryOption:
- | QueryOption
- | undefined;
- /**
- * Container is the container name to execute the query against, used for
- * CosmosDB only.
- */
- container?: string | undefined;
-}
-
-export interface QueryResponse {
- /** The query results. */
- results: QueryResult[];
-}
-
-export interface QueryOption {
- redisRunCommandsOn: QueryOption_RedisRunCommandsOn;
-}
-
-export enum QueryOption_RedisRunCommandsOn {
- /** REDIS_RUN_COMMANDS_ON_UNSPECIFIED - UNSPECIFIED defaults to SINGLE_NODE. */
- REDIS_RUN_COMMANDS_ON_UNSPECIFIED = "REDIS_RUN_COMMANDS_ON_UNSPECIFIED",
- SINGLE_NODE = "SINGLE_NODE",
- ALL_NODES = "ALL_NODES",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function queryOption_RedisRunCommandsOnFromJSON(object: any): QueryOption_RedisRunCommandsOn {
- switch (object) {
- case 0:
- case "REDIS_RUN_COMMANDS_ON_UNSPECIFIED":
- return QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED;
- case 1:
- case "SINGLE_NODE":
- return QueryOption_RedisRunCommandsOn.SINGLE_NODE;
- case 2:
- case "ALL_NODES":
- return QueryOption_RedisRunCommandsOn.ALL_NODES;
- case -1:
- case "UNRECOGNIZED":
- default:
- return QueryOption_RedisRunCommandsOn.UNRECOGNIZED;
- }
-}
-
-export function queryOption_RedisRunCommandsOnToJSON(object: QueryOption_RedisRunCommandsOn): string {
- switch (object) {
- case QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED:
- return "REDIS_RUN_COMMANDS_ON_UNSPECIFIED";
- case QueryOption_RedisRunCommandsOn.SINGLE_NODE:
- return "SINGLE_NODE";
- case QueryOption_RedisRunCommandsOn.ALL_NODES:
- return "ALL_NODES";
- case QueryOption_RedisRunCommandsOn.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function queryOption_RedisRunCommandsOnToNumber(object: QueryOption_RedisRunCommandsOn): number {
- switch (object) {
- case QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED:
- return 0;
- case QueryOption_RedisRunCommandsOn.SINGLE_NODE:
- return 1;
- case QueryOption_RedisRunCommandsOn.ALL_NODES:
- return 2;
- case QueryOption_RedisRunCommandsOn.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface QueryResult {
- /** Column names of the query result. */
- columnNames: string[];
- /**
- * Column types of the query result.
- * The types come from the Golang SQL driver.
- */
- columnTypeNames: string[];
- /** Rows of the query result. */
- rows: QueryRow[];
- rowsCount: Long;
- /** Columns are masked or not. */
- masked: boolean[];
- /** Columns are sensitive or not. */
- sensitive: boolean[];
- /** The error message if the query failed. */
- error: string;
- /** The time it takes to execute the query. */
- latency:
- | Duration
- | undefined;
- /** The query statement for the result. */
- statement: string;
- postgresError?:
- | QueryResult_PostgresError
- | undefined;
- /** The query result is allowed to be exported or not. */
- allowExport: boolean;
- /**
- * Informational or debug messages returned by the database engine during query execution.
- * Examples include PostgreSQL's RAISE NOTICE, MSSQL's PRINT, or Oracle's DBMS_OUTPUT.PUT_LINE.
- */
- messages: QueryResult_Message[];
-}
-
-/**
- * refer https://www.postgresql.org/docs/11/protocol-error-fields.html
- * for field description.
- */
-export interface QueryResult_PostgresError {
- severity: string;
- code: string;
- message: string;
- detail: string;
- hint: string;
- position: number;
- internalPosition: number;
- internalQuery: string;
- where: string;
- schemaName: string;
- tableName: string;
- columnName: string;
- dataTypeName: string;
- constraintName: string;
- file: string;
- line: number;
- routine: string;
-}
-
-export interface QueryResult_Message {
- level: QueryResult_Message_Level;
- content: string;
-}
-
-export enum QueryResult_Message_Level {
- /** LEVEL_UNSPECIFIED - Unspecified. */
- LEVEL_UNSPECIFIED = "LEVEL_UNSPECIFIED",
- INFO = "INFO",
- WARNING = "WARNING",
- DEBUG = "DEBUG",
- LOG = "LOG",
- NOTICE = "NOTICE",
- EXCEPTION = "EXCEPTION",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function queryResult_Message_LevelFromJSON(object: any): QueryResult_Message_Level {
- switch (object) {
- case 0:
- case "LEVEL_UNSPECIFIED":
- return QueryResult_Message_Level.LEVEL_UNSPECIFIED;
- case 1:
- case "INFO":
- return QueryResult_Message_Level.INFO;
- case 2:
- case "WARNING":
- return QueryResult_Message_Level.WARNING;
- case 3:
- case "DEBUG":
- return QueryResult_Message_Level.DEBUG;
- case 4:
- case "LOG":
- return QueryResult_Message_Level.LOG;
- case 5:
- case "NOTICE":
- return QueryResult_Message_Level.NOTICE;
- case 6:
- case "EXCEPTION":
- return QueryResult_Message_Level.EXCEPTION;
- case -1:
- case "UNRECOGNIZED":
- default:
- return QueryResult_Message_Level.UNRECOGNIZED;
- }
-}
-
-export function queryResult_Message_LevelToJSON(object: QueryResult_Message_Level): string {
- switch (object) {
- case QueryResult_Message_Level.LEVEL_UNSPECIFIED:
- return "LEVEL_UNSPECIFIED";
- case QueryResult_Message_Level.INFO:
- return "INFO";
- case QueryResult_Message_Level.WARNING:
- return "WARNING";
- case QueryResult_Message_Level.DEBUG:
- return "DEBUG";
- case QueryResult_Message_Level.LOG:
- return "LOG";
- case QueryResult_Message_Level.NOTICE:
- return "NOTICE";
- case QueryResult_Message_Level.EXCEPTION:
- return "EXCEPTION";
- case QueryResult_Message_Level.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function queryResult_Message_LevelToNumber(object: QueryResult_Message_Level): number {
- switch (object) {
- case QueryResult_Message_Level.LEVEL_UNSPECIFIED:
- return 0;
- case QueryResult_Message_Level.INFO:
- return 1;
- case QueryResult_Message_Level.WARNING:
- return 2;
- case QueryResult_Message_Level.DEBUG:
- return 3;
- case QueryResult_Message_Level.LOG:
- return 4;
- case QueryResult_Message_Level.NOTICE:
- return 5;
- case QueryResult_Message_Level.EXCEPTION:
- return 6;
- case QueryResult_Message_Level.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface QueryRow {
- /** Row values of the query result. */
- values: RowValue[];
-}
-
-export interface RowValue {
- nullValue?: NullValue | undefined;
- boolValue?: boolean | undefined;
- bytesValue?: Uint8Array | undefined;
- doubleValue?: number | undefined;
- floatValue?: number | undefined;
- int32Value?: number | undefined;
- int64Value?: Long | undefined;
- stringValue?: string | undefined;
- uint32Value?: number | undefined;
- uint64Value?:
- | Long
- | undefined;
- /** value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only. */
- valueValue?:
- | any
- | undefined;
- /**
- * timestamp_value is used for the timestamp without time zone data type,
- * meaning it only includes the timestamp without any time zone or location
- * info. Although it may be expressed as a UTC value, it should be seen as a
- * timestamp missing location context.
- */
- timestampValue?:
- | RowValue_Timestamp
- | undefined;
- /**
- * timestamp_tz_value is used for the timestamptz data type, which
- * accurately represents the timestamp with location information.
- */
- timestampTzValue?: RowValue_TimestampTZ | undefined;
-}
-
-export interface RowValue_Timestamp {
- googleTimestamp:
- | Timestamp
- | undefined;
- /** The accuracy is the number of digits after the decimal point. */
- accuracy: number;
-}
-
-export interface RowValue_TimestampTZ {
- googleTimestamp:
- | Timestamp
- | undefined;
- /**
- * Zone is the time zone abbreviations in timezone database such as "PDT",
- * "PST". https://en.wikipedia.org/wiki/List_of_tz_database_time_zones We
- * retrieve the time zone information from the timestamptz field in the
- * database. A timestamp is in UTC or epoch time, and with zone info, we can
- * convert it to a local time string. Zone and offset are returned by
- * time.Time.Zone()
- */
- zone: string;
- /** The offset is in seconds east of UTC */
- offset: number;
- accuracy: number;
-}
-
-export interface Advice {
- /** The advice status. */
- status: Advice_Status;
- /** The advice code. */
- code: number;
- /** The advice title. */
- title: string;
- /** The advice content. */
- content: string;
- /**
- * The start_position is inclusive and the end_position is exclusive.
- * TODO: use range instead
- */
- startPosition: Position | undefined;
- endPosition: Position | undefined;
-}
-
-export enum Advice_Status {
- /** STATUS_UNSPECIFIED - Unspecified. */
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- SUCCESS = "SUCCESS",
- WARNING = "WARNING",
- ERROR = "ERROR",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function advice_StatusFromJSON(object: any): Advice_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return Advice_Status.STATUS_UNSPECIFIED;
- case 1:
- case "SUCCESS":
- return Advice_Status.SUCCESS;
- case 2:
- case "WARNING":
- return Advice_Status.WARNING;
- case 3:
- case "ERROR":
- return Advice_Status.ERROR;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Advice_Status.UNRECOGNIZED;
- }
-}
-
-export function advice_StatusToJSON(object: Advice_Status): string {
- switch (object) {
- case Advice_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case Advice_Status.SUCCESS:
- return "SUCCESS";
- case Advice_Status.WARNING:
- return "WARNING";
- case Advice_Status.ERROR:
- return "ERROR";
- case Advice_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * Format: instances/{instance}/databases/{databaseName}
- * Format: projects/{project}/issues/{issue} for data export issue.
- */
- name: string;
- /** The SQL statement to execute. */
- statement: string;
- /** The maximum number of rows to return. */
- limit: number;
- /** The export format. */
- format: ExportFormat;
- /**
- * The admin is used for workspace owner and DBA for exporting data from SQL
- * Editor Admin mode. The exported data is not masked.
- */
- admin: boolean;
- /** The zip password provide by users. */
- password: string;
- /**
- * The id of data source.
- * It is used for querying admin data source even if the instance has
- * read-only data sources. Or it can be used to query a specific read-only
- * data source.
- */
- dataSourceId: string;
-}
-
-export interface ExportResponse {
- /** The export file content. */
- content: Uint8Array;
-}
-
-export interface PrettyRequest {
- engine: Engine;
- /**
- * The SDL format SQL schema information that was dumped from a database
- * engine. This information will be sorted to match the order of statements in
- * the userSchema.
- */
- currentSchema: string;
- /**
- * The expected SDL schema. This schema will be checked for correctness and
- * normalized.
- */
- expectedSchema: string;
-}
-
-export interface PrettyResponse {
- /** The pretty-formatted version of current schema. */
- currentSchema: string;
- /** The expected SDL schema after normalizing. */
- expectedSchema: string;
-}
-
-export interface CheckRequest {
- /**
- * The database name to check against.
- * Format: instances/{instance}/databases/{database}
- */
- name: string;
- statement: string;
- changeType: CheckRequest_ChangeType;
-}
-
-export enum CheckRequest_ChangeType {
- CHANGE_TYPE_UNSPECIFIED = "CHANGE_TYPE_UNSPECIFIED",
- DDL = "DDL",
- DDL_GHOST = "DDL_GHOST",
- DML = "DML",
- SQL_EDITOR = "SQL_EDITOR",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function checkRequest_ChangeTypeFromJSON(object: any): CheckRequest_ChangeType {
- switch (object) {
- case 0:
- case "CHANGE_TYPE_UNSPECIFIED":
- return CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED;
- case 1:
- case "DDL":
- return CheckRequest_ChangeType.DDL;
- case 2:
- case "DDL_GHOST":
- return CheckRequest_ChangeType.DDL_GHOST;
- case 3:
- case "DML":
- return CheckRequest_ChangeType.DML;
- case 4:
- case "SQL_EDITOR":
- return CheckRequest_ChangeType.SQL_EDITOR;
- case -1:
- case "UNRECOGNIZED":
- default:
- return CheckRequest_ChangeType.UNRECOGNIZED;
- }
-}
-
-export function checkRequest_ChangeTypeToJSON(object: CheckRequest_ChangeType): string {
- switch (object) {
- case CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED:
- return "CHANGE_TYPE_UNSPECIFIED";
- case CheckRequest_ChangeType.DDL:
- return "DDL";
- case CheckRequest_ChangeType.DDL_GHOST:
- return "DDL_GHOST";
- case CheckRequest_ChangeType.DML:
- return "DML";
- case CheckRequest_ChangeType.SQL_EDITOR:
- return "SQL_EDITOR";
- case CheckRequest_ChangeType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.SQL_EDITOR:
- return 4;
- case CheckRequest_ChangeType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface CheckResponse {
- advices: Advice[];
- /** The count of affected rows of the statement on the target database. */
- affectedRows: number;
-}
-
-export interface ParseMyBatisMapperRequest {
- content: Uint8Array;
-}
-
-export interface ParseMyBatisMapperResponse {
- statements: string[];
-}
-
-export interface DiffMetadataRequest {
- /** The metadata of the source schema. */
- sourceMetadata:
- | DatabaseMetadata
- | undefined;
- /** The metadata of the target schema. */
- targetMetadata: DatabaseMetadata | undefined;
- sourceCatalog: DatabaseCatalog | undefined;
- targetCatalog:
- | DatabaseCatalog
- | undefined;
- /** The database engine of the schema. */
- engine: Engine;
- /**
- * If false, we will build the raw common by classification in database
- * config.
- */
- classificationFromConfig: boolean;
-}
-
-export interface DiffMetadataResponse {
- /** The diff of the metadata. */
- diff: string;
-}
-
-export interface SearchQueryHistoriesRequest {
- /**
- * The maximum number of histories to return.
- * The service may return fewer than this value.
- * If unspecified, at most 10 history entries will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListQueryHistory` call.
- * Provide this to retrieve the subsequent page.
- */
- pageToken: string;
- /**
- * Filter is the filter to apply on the search query history
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - project: the project full name in "projects/{id}" format, support "==" operator.
- * - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
- * - instance: the instance full name in "instances/{id}" format, support "==" operator.
- * - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
- * - statement: the SQL statemnt, support ".matches()" operator.
- *
- * For example:
- * project == "projects/{project}"
- * database == "instances/{instance}/databases/{database}"
- * instance == "instances/{instance}"
- * type == "QUERY"
- * type == "EXPORT"
- * statement.matches("select")
- * type == "QUERY" && statement.matches("select")
- */
- filter: string;
-}
-
-export interface SearchQueryHistoriesResponse {
- /** The list of history. */
- queryHistories: QueryHistory[];
- /**
- * A token to retrieve next page of history.
- * Pass this value in the page_token field in the subsequent call to
- * `ListQueryHistory` method to retrieve the next page of history.
- */
- nextPageToken: string;
-}
-
-export interface QueryHistory {
- /**
- * The name for the query history.
- * Format: queryHistories/{uid}
- */
- name: string;
- /**
- * The database name to execute the query.
- * Format: instances/{instance}/databases/{databaseName}
- */
- database: string;
- creator: string;
- createTime: Timestamp | undefined;
- statement: string;
- error?: string | undefined;
- duration: Duration | undefined;
- type: QueryHistory_Type;
-}
-
-export enum QueryHistory_Type {
- TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
- QUERY = "QUERY",
- EXPORT = "EXPORT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function queryHistory_TypeFromJSON(object: any): QueryHistory_Type {
- switch (object) {
- case 0:
- case "TYPE_UNSPECIFIED":
- return QueryHistory_Type.TYPE_UNSPECIFIED;
- case 1:
- case "QUERY":
- return QueryHistory_Type.QUERY;
- case 2:
- case "EXPORT":
- return QueryHistory_Type.EXPORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return QueryHistory_Type.UNRECOGNIZED;
- }
-}
-
-export function queryHistory_TypeToJSON(object: QueryHistory_Type): string {
- switch (object) {
- case QueryHistory_Type.TYPE_UNSPECIFIED:
- return "TYPE_UNSPECIFIED";
- case QueryHistory_Type.QUERY:
- return "QUERY";
- case QueryHistory_Type.EXPORT:
- return "EXPORT";
- case QueryHistory_Type.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- }
-}
-
-export interface AICompletionRequest {
- messages: AICompletionRequest_Message[];
-}
-
-export interface AICompletionRequest_Message {
- role: string;
- content: string;
-}
-
-export interface AICompletionResponse {
- /**
- * candidates is used for results with multiple choices and candidates. Used
- * for OpenAI and Gemini.
- */
- candidates: AICompletionResponse_Candidate[];
-}
-
-export interface AICompletionResponse_Candidate {
- content: AICompletionResponse_Candidate_Content | undefined;
-}
-
-export interface AICompletionResponse_Candidate_Content {
- /** parts is used for a result content with multiple parts. */
- parts: AICompletionResponse_Candidate_Content_Part[];
-}
-
-export interface AICompletionResponse_Candidate_Content_Part {
- text: string;
-}
-
-function createBaseAdminExecuteRequest(): AdminExecuteRequest {
- return { name: "", statement: "", limit: 0, schema: undefined, container: undefined };
-}
-
-export const AdminExecuteRequest: MessageFns<AdminExecuteRequest> = {
- encode(message: AdminExecuteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.statement !== "") {
- writer.uint32(26).string(message.statement);
- }
- if (message.limit !== 0) {
- writer.uint32(32).int32(message.limit);
- }
- if (message.schema !== undefined) {
- writer.uint32(50).string(message.schema);
- }
- if (message.container !== undefined) {
- writer.uint32(58).string(message.container);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AdminExecuteRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAdminExecuteRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.limit = reader.int32();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.container = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AdminExecuteRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
- schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
- container: isSet(object.container) ? globalThis.String(object.container) : undefined,
- };
- },
-
- toJSON(message: AdminExecuteRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.limit !== 0) {
- obj.limit = Math.round(message.limit);
- }
- if (message.schema !== undefined) {
- obj.schema = message.schema;
- }
- if (message.container !== undefined) {
- obj.container = message.container;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AdminExecuteRequest>): AdminExecuteRequest {
- return AdminExecuteRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AdminExecuteRequest>): AdminExecuteRequest {
- const message = createBaseAdminExecuteRequest();
- message.name = object.name ?? "";
- message.statement = object.statement ?? "";
- message.limit = object.limit ?? 0;
- message.schema = object.schema ?? undefined;
- message.container = object.container ?? undefined;
- return message;
- },
-};
-
-function createBaseAdminExecuteResponse(): AdminExecuteResponse {
- return { results: [] };
-}
-
-export const AdminExecuteResponse: MessageFns<AdminExecuteResponse> = {
- encode(message: AdminExecuteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.results) {
- QueryResult.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AdminExecuteResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAdminExecuteResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.results.push(QueryResult.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AdminExecuteResponse {
- return {
- results: globalThis.Array.isArray(object?.results) ? object.results.map((e: any) => QueryResult.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: AdminExecuteResponse): unknown {
- const obj: any = {};
- if (message.results?.length) {
- obj.results = message.results.map((e) => QueryResult.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<AdminExecuteResponse>): AdminExecuteResponse {
- return AdminExecuteResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AdminExecuteResponse>): AdminExecuteResponse {
- const message = createBaseAdminExecuteResponse();
- message.results = object.results?.map((e) => QueryResult.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseQueryRequest(): QueryRequest {
- return {
- name: "",
- statement: "",
- limit: 0,
- dataSourceId: "",
- explain: false,
- schema: undefined,
- queryOption: undefined,
- container: undefined,
- };
-}
-
-export const QueryRequest: MessageFns<QueryRequest> = {
- encode(message: QueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.statement !== "") {
- writer.uint32(26).string(message.statement);
- }
- if (message.limit !== 0) {
- writer.uint32(32).int32(message.limit);
- }
- if (message.dataSourceId !== "") {
- writer.uint32(50).string(message.dataSourceId);
- }
- if (message.explain !== false) {
- writer.uint32(56).bool(message.explain);
- }
- if (message.schema !== undefined) {
- writer.uint32(66).string(message.schema);
- }
- if (message.queryOption !== undefined) {
- QueryOption.encode(message.queryOption, writer.uint32(74).fork()).join();
- }
- if (message.container !== undefined) {
- writer.uint32(82).string(message.container);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.limit = reader.int32();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.dataSourceId = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.explain = reader.bool();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.schema = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.queryOption = QueryOption.decode(reader, reader.uint32());
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.container = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
- dataSourceId: isSet(object.dataSourceId) ? globalThis.String(object.dataSourceId) : "",
- explain: isSet(object.explain) ? globalThis.Boolean(object.explain) : false,
- schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
- queryOption: isSet(object.queryOption) ? QueryOption.fromJSON(object.queryOption) : undefined,
- container: isSet(object.container) ? globalThis.String(object.container) : undefined,
- };
- },
-
- toJSON(message: QueryRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.limit !== 0) {
- obj.limit = Math.round(message.limit);
- }
- if (message.dataSourceId !== "") {
- obj.dataSourceId = message.dataSourceId;
- }
- if (message.explain !== false) {
- obj.explain = message.explain;
- }
- if (message.schema !== undefined) {
- obj.schema = message.schema;
- }
- if (message.queryOption !== undefined) {
- obj.queryOption = QueryOption.toJSON(message.queryOption);
- }
- if (message.container !== undefined) {
- obj.container = message.container;
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryRequest>): QueryRequest {
- return QueryRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryRequest>): QueryRequest {
- const message = createBaseQueryRequest();
- message.name = object.name ?? "";
- message.statement = object.statement ?? "";
- message.limit = object.limit ?? 0;
- message.dataSourceId = object.dataSourceId ?? "";
- message.explain = object.explain ?? false;
- message.schema = object.schema ?? undefined;
- message.queryOption = (object.queryOption !== undefined && object.queryOption !== null)
- ? QueryOption.fromPartial(object.queryOption)
- : undefined;
- message.container = object.container ?? undefined;
- return message;
- },
-};
-
-function createBaseQueryResponse(): QueryResponse {
- return { results: [] };
-}
-
-export const QueryResponse: MessageFns<QueryResponse> = {
- encode(message: QueryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.results) {
- QueryResult.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.results.push(QueryResult.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryResponse {
- return {
- results: globalThis.Array.isArray(object?.results) ? object.results.map((e: any) => QueryResult.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: QueryResponse): unknown {
- const obj: any = {};
- if (message.results?.length) {
- obj.results = message.results.map((e) => QueryResult.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryResponse>): QueryResponse {
- return QueryResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryResponse>): QueryResponse {
- const message = createBaseQueryResponse();
- message.results = object.results?.map((e) => QueryResult.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseQueryOption(): QueryOption {
- return { redisRunCommandsOn: QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED };
-}
-
-export const QueryOption: MessageFns<QueryOption> = {
- encode(message: QueryOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.redisRunCommandsOn !== QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED) {
- writer.uint32(8).int32(queryOption_RedisRunCommandsOnToNumber(message.redisRunCommandsOn));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryOption {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryOption();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.redisRunCommandsOn = queryOption_RedisRunCommandsOnFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryOption {
- return {
- redisRunCommandsOn: isSet(object.redisRunCommandsOn)
- ? queryOption_RedisRunCommandsOnFromJSON(object.redisRunCommandsOn)
- : QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED,
- };
- },
-
- toJSON(message: QueryOption): unknown {
- const obj: any = {};
- if (message.redisRunCommandsOn !== QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED) {
- obj.redisRunCommandsOn = queryOption_RedisRunCommandsOnToJSON(message.redisRunCommandsOn);
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryOption>): QueryOption {
- return QueryOption.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryOption>): QueryOption {
- const message = createBaseQueryOption();
- message.redisRunCommandsOn = object.redisRunCommandsOn ??
- QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseQueryResult(): QueryResult {
- return {
- columnNames: [],
- columnTypeNames: [],
- rows: [],
- rowsCount: Long.ZERO,
- masked: [],
- sensitive: [],
- error: "",
- latency: undefined,
- statement: "",
- postgresError: undefined,
- allowExport: false,
- messages: [],
- };
-}
-
-export const QueryResult: MessageFns<QueryResult> = {
- encode(message: QueryResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.columnNames) {
- writer.uint32(10).string(v!);
- }
- for (const v of message.columnTypeNames) {
- writer.uint32(18).string(v!);
- }
- for (const v of message.rows) {
- QueryRow.encode(v!, writer.uint32(26).fork()).join();
- }
- if (!message.rowsCount.equals(Long.ZERO)) {
- writer.uint32(80).int64(message.rowsCount.toString());
- }
- writer.uint32(34).fork();
- for (const v of message.masked) {
- writer.bool(v);
- }
- writer.join();
- writer.uint32(42).fork();
- for (const v of message.sensitive) {
- writer.bool(v);
- }
- writer.join();
- if (message.error !== "") {
- writer.uint32(50).string(message.error);
- }
- if (message.latency !== undefined) {
- Duration.encode(message.latency, writer.uint32(58).fork()).join();
- }
- if (message.statement !== "") {
- writer.uint32(66).string(message.statement);
- }
- if (message.postgresError !== undefined) {
- QueryResult_PostgresError.encode(message.postgresError, writer.uint32(74).fork()).join();
- }
- if (message.allowExport !== false) {
- writer.uint32(88).bool(message.allowExport);
- }
- for (const v of message.messages) {
- QueryResult_Message.encode(v!, writer.uint32(98).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryResult {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryResult();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.columnNames.push(reader.string());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.columnTypeNames.push(reader.string());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.rows.push(QueryRow.decode(reader, reader.uint32()));
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.rowsCount = Long.fromString(reader.int64().toString());
- continue;
- }
- case 4: {
- if (tag === 32) {
- message.masked.push(reader.bool());
-
- continue;
- }
-
- if (tag === 34) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.masked.push(reader.bool());
- }
-
- continue;
- }
-
- break;
- }
- case 5: {
- if (tag === 40) {
- message.sensitive.push(reader.bool());
-
- continue;
- }
-
- if (tag === 42) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.sensitive.push(reader.bool());
- }
-
- continue;
- }
-
- break;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.latency = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.postgresError = QueryResult_PostgresError.decode(reader, reader.uint32());
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.allowExport = reader.bool();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.messages.push(QueryResult_Message.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryResult {
- return {
- columnNames: globalThis.Array.isArray(object?.columnNames)
- ? object.columnNames.map((e: any) => globalThis.String(e))
- : [],
- columnTypeNames: globalThis.Array.isArray(object?.columnTypeNames)
- ? object.columnTypeNames.map((e: any) => globalThis.String(e))
- : [],
- rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e: any) => QueryRow.fromJSON(e)) : [],
- rowsCount: isSet(object.rowsCount) ? Long.fromValue(object.rowsCount) : Long.ZERO,
- masked: globalThis.Array.isArray(object?.masked) ? object.masked.map((e: any) => globalThis.Boolean(e)) : [],
- sensitive: globalThis.Array.isArray(object?.sensitive)
- ? object.sensitive.map((e: any) => globalThis.Boolean(e))
- : [],
- error: isSet(object.error) ? globalThis.String(object.error) : "",
- latency: isSet(object.latency) ? Duration.fromJSON(object.latency) : undefined,
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- postgresError: isSet(object.postgresError) ? QueryResult_PostgresError.fromJSON(object.postgresError) : undefined,
- allowExport: isSet(object.allowExport) ? globalThis.Boolean(object.allowExport) : false,
- messages: globalThis.Array.isArray(object?.messages)
- ? object.messages.map((e: any) => QueryResult_Message.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: QueryResult): unknown {
- const obj: any = {};
- if (message.columnNames?.length) {
- obj.columnNames = message.columnNames;
- }
- if (message.columnTypeNames?.length) {
- obj.columnTypeNames = message.columnTypeNames;
- }
- if (message.rows?.length) {
- obj.rows = message.rows.map((e) => QueryRow.toJSON(e));
- }
- if (!message.rowsCount.equals(Long.ZERO)) {
- obj.rowsCount = (message.rowsCount || Long.ZERO).toString();
- }
- if (message.masked?.length) {
- obj.masked = message.masked;
- }
- if (message.sensitive?.length) {
- obj.sensitive = message.sensitive;
- }
- if (message.error !== "") {
- obj.error = message.error;
- }
- if (message.latency !== undefined) {
- obj.latency = Duration.toJSON(message.latency);
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.postgresError !== undefined) {
- obj.postgresError = QueryResult_PostgresError.toJSON(message.postgresError);
- }
- if (message.allowExport !== false) {
- obj.allowExport = message.allowExport;
- }
- if (message.messages?.length) {
- obj.messages = message.messages.map((e) => QueryResult_Message.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryResult>): QueryResult {
- return QueryResult.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryResult>): QueryResult {
- const message = createBaseQueryResult();
- message.columnNames = object.columnNames?.map((e) => e) || [];
- message.columnTypeNames = object.columnTypeNames?.map((e) => e) || [];
- message.rows = object.rows?.map((e) => QueryRow.fromPartial(e)) || [];
- message.rowsCount = (object.rowsCount !== undefined && object.rowsCount !== null)
- ? Long.fromValue(object.rowsCount)
- : Long.ZERO;
- message.masked = object.masked?.map((e) => e) || [];
- message.sensitive = object.sensitive?.map((e) => e) || [];
- message.error = object.error ?? "";
- message.latency = (object.latency !== undefined && object.latency !== null)
- ? Duration.fromPartial(object.latency)
- : undefined;
- message.statement = object.statement ?? "";
- message.postgresError = (object.postgresError !== undefined && object.postgresError !== null)
- ? QueryResult_PostgresError.fromPartial(object.postgresError)
- : undefined;
- message.allowExport = object.allowExport ?? false;
- message.messages = object.messages?.map((e) => QueryResult_Message.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseQueryResult_PostgresError(): QueryResult_PostgresError {
- return {
- severity: "",
- code: "",
- message: "",
- detail: "",
- hint: "",
- position: 0,
- internalPosition: 0,
- internalQuery: "",
- where: "",
- schemaName: "",
- tableName: "",
- columnName: "",
- dataTypeName: "",
- constraintName: "",
- file: "",
- line: 0,
- routine: "",
- };
-}
-
-export const QueryResult_PostgresError: MessageFns<QueryResult_PostgresError> = {
- encode(message: QueryResult_PostgresError, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.severity !== "") {
- writer.uint32(10).string(message.severity);
- }
- if (message.code !== "") {
- writer.uint32(18).string(message.code);
- }
- if (message.message !== "") {
- writer.uint32(26).string(message.message);
- }
- if (message.detail !== "") {
- writer.uint32(34).string(message.detail);
- }
- if (message.hint !== "") {
- writer.uint32(42).string(message.hint);
- }
- if (message.position !== 0) {
- writer.uint32(48).int32(message.position);
- }
- if (message.internalPosition !== 0) {
- writer.uint32(56).int32(message.internalPosition);
- }
- if (message.internalQuery !== "") {
- writer.uint32(66).string(message.internalQuery);
- }
- if (message.where !== "") {
- writer.uint32(74).string(message.where);
- }
- if (message.schemaName !== "") {
- writer.uint32(82).string(message.schemaName);
- }
- if (message.tableName !== "") {
- writer.uint32(90).string(message.tableName);
- }
- if (message.columnName !== "") {
- writer.uint32(98).string(message.columnName);
- }
- if (message.dataTypeName !== "") {
- writer.uint32(106).string(message.dataTypeName);
- }
- if (message.constraintName !== "") {
- writer.uint32(114).string(message.constraintName);
- }
- if (message.file !== "") {
- writer.uint32(122).string(message.file);
- }
- if (message.line !== 0) {
- writer.uint32(128).int32(message.line);
- }
- if (message.routine !== "") {
- writer.uint32(138).string(message.routine);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryResult_PostgresError {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryResult_PostgresError();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.severity = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.code = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.message = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.detail = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.hint = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.position = reader.int32();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.internalPosition = reader.int32();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.internalQuery = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.where = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.schemaName = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.tableName = reader.string();
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.columnName = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.dataTypeName = reader.string();
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
-
- message.constraintName = reader.string();
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
-
- message.file = reader.string();
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
-
- message.line = reader.int32();
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
-
- message.routine = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryResult_PostgresError {
- return {
- severity: isSet(object.severity) ? globalThis.String(object.severity) : "",
- code: isSet(object.code) ? globalThis.String(object.code) : "",
- message: isSet(object.message) ? globalThis.String(object.message) : "",
- detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
- hint: isSet(object.hint) ? globalThis.String(object.hint) : "",
- position: isSet(object.position) ? globalThis.Number(object.position) : 0,
- internalPosition: isSet(object.internalPosition) ? globalThis.Number(object.internalPosition) : 0,
- internalQuery: isSet(object.internalQuery) ? globalThis.String(object.internalQuery) : "",
- where: isSet(object.where) ? globalThis.String(object.where) : "",
- schemaName: isSet(object.schemaName) ? globalThis.String(object.schemaName) : "",
- tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",
- columnName: isSet(object.columnName) ? globalThis.String(object.columnName) : "",
- dataTypeName: isSet(object.dataTypeName) ? globalThis.String(object.dataTypeName) : "",
- constraintName: isSet(object.constraintName) ? globalThis.String(object.constraintName) : "",
- file: isSet(object.file) ? globalThis.String(object.file) : "",
- line: isSet(object.line) ? globalThis.Number(object.line) : 0,
- routine: isSet(object.routine) ? globalThis.String(object.routine) : "",
- };
- },
-
- toJSON(message: QueryResult_PostgresError): unknown {
- const obj: any = {};
- if (message.severity !== "") {
- obj.severity = message.severity;
- }
- if (message.code !== "") {
- obj.code = message.code;
- }
- if (message.message !== "") {
- obj.message = message.message;
- }
- if (message.detail !== "") {
- obj.detail = message.detail;
- }
- if (message.hint !== "") {
- obj.hint = message.hint;
- }
- if (message.position !== 0) {
- obj.position = Math.round(message.position);
- }
- if (message.internalPosition !== 0) {
- obj.internalPosition = Math.round(message.internalPosition);
- }
- if (message.internalQuery !== "") {
- obj.internalQuery = message.internalQuery;
- }
- if (message.where !== "") {
- obj.where = message.where;
- }
- if (message.schemaName !== "") {
- obj.schemaName = message.schemaName;
- }
- if (message.tableName !== "") {
- obj.tableName = message.tableName;
- }
- if (message.columnName !== "") {
- obj.columnName = message.columnName;
- }
- if (message.dataTypeName !== "") {
- obj.dataTypeName = message.dataTypeName;
- }
- if (message.constraintName !== "") {
- obj.constraintName = message.constraintName;
- }
- if (message.file !== "") {
- obj.file = message.file;
- }
- if (message.line !== 0) {
- obj.line = Math.round(message.line);
- }
- if (message.routine !== "") {
- obj.routine = message.routine;
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryResult_PostgresError>): QueryResult_PostgresError {
- return QueryResult_PostgresError.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryResult_PostgresError>): QueryResult_PostgresError {
- const message = createBaseQueryResult_PostgresError();
- message.severity = object.severity ?? "";
- message.code = object.code ?? "";
- message.message = object.message ?? "";
- message.detail = object.detail ?? "";
- message.hint = object.hint ?? "";
- message.position = object.position ?? 0;
- message.internalPosition = object.internalPosition ?? 0;
- message.internalQuery = object.internalQuery ?? "";
- message.where = object.where ?? "";
- message.schemaName = object.schemaName ?? "";
- message.tableName = object.tableName ?? "";
- message.columnName = object.columnName ?? "";
- message.dataTypeName = object.dataTypeName ?? "";
- message.constraintName = object.constraintName ?? "";
- message.file = object.file ?? "";
- message.line = object.line ?? 0;
- message.routine = object.routine ?? "";
- return message;
- },
-};
-
-function createBaseQueryResult_Message(): QueryResult_Message {
- return { level: QueryResult_Message_Level.LEVEL_UNSPECIFIED, content: "" };
-}
-
-export const QueryResult_Message: MessageFns<QueryResult_Message> = {
- encode(message: QueryResult_Message, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.level !== QueryResult_Message_Level.LEVEL_UNSPECIFIED) {
- writer.uint32(8).int32(queryResult_Message_LevelToNumber(message.level));
- }
- if (message.content !== "") {
- writer.uint32(18).string(message.content);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryResult_Message {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryResult_Message();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.level = queryResult_Message_LevelFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.content = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryResult_Message {
- return {
- level: isSet(object.level)
- ? queryResult_Message_LevelFromJSON(object.level)
- : QueryResult_Message_Level.LEVEL_UNSPECIFIED,
- content: isSet(object.content) ? globalThis.String(object.content) : "",
- };
- },
-
- toJSON(message: QueryResult_Message): unknown {
- const obj: any = {};
- if (message.level !== QueryResult_Message_Level.LEVEL_UNSPECIFIED) {
- obj.level = queryResult_Message_LevelToJSON(message.level);
- }
- if (message.content !== "") {
- obj.content = message.content;
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryResult_Message>): QueryResult_Message {
- return QueryResult_Message.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryResult_Message>): QueryResult_Message {
- const message = createBaseQueryResult_Message();
- message.level = object.level ?? QueryResult_Message_Level.LEVEL_UNSPECIFIED;
- message.content = object.content ?? "";
- return message;
- },
-};
-
-function createBaseQueryRow(): QueryRow {
- return { values: [] };
-}
-
-export const QueryRow: MessageFns<QueryRow> = {
- encode(message: QueryRow, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.values) {
- RowValue.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryRow {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryRow();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.values.push(RowValue.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryRow {
- return {
- values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => RowValue.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: QueryRow): unknown {
- const obj: any = {};
- if (message.values?.length) {
- obj.values = message.values.map((e) => RowValue.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryRow>): QueryRow {
- return QueryRow.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryRow>): QueryRow {
- const message = createBaseQueryRow();
- message.values = object.values?.map((e) => RowValue.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseRowValue(): RowValue {
- return {
- nullValue: undefined,
- boolValue: undefined,
- bytesValue: undefined,
- doubleValue: undefined,
- floatValue: undefined,
- int32Value: undefined,
- int64Value: undefined,
- stringValue: undefined,
- uint32Value: undefined,
- uint64Value: undefined,
- valueValue: undefined,
- timestampValue: undefined,
- timestampTzValue: undefined,
- };
-}
-
-export const RowValue: MessageFns<RowValue> = {
- encode(message: RowValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.nullValue !== undefined) {
- writer.uint32(8).int32(nullValueToNumber(message.nullValue));
- }
- if (message.boolValue !== undefined) {
- writer.uint32(16).bool(message.boolValue);
- }
- if (message.bytesValue !== undefined) {
- writer.uint32(26).bytes(message.bytesValue);
- }
- if (message.doubleValue !== undefined) {
- writer.uint32(33).double(message.doubleValue);
- }
- if (message.floatValue !== undefined) {
- writer.uint32(45).float(message.floatValue);
- }
- if (message.int32Value !== undefined) {
- writer.uint32(48).int32(message.int32Value);
- }
- if (message.int64Value !== undefined) {
- writer.uint32(56).int64(message.int64Value.toString());
- }
- if (message.stringValue !== undefined) {
- writer.uint32(66).string(message.stringValue);
- }
- if (message.uint32Value !== undefined) {
- writer.uint32(72).uint32(message.uint32Value);
- }
- if (message.uint64Value !== undefined) {
- writer.uint32(80).uint64(message.uint64Value.toString());
- }
- if (message.valueValue !== undefined) {
- Value.encode(Value.wrap(message.valueValue), writer.uint32(90).fork()).join();
- }
- if (message.timestampValue !== undefined) {
- RowValue_Timestamp.encode(message.timestampValue, writer.uint32(98).fork()).join();
- }
- if (message.timestampTzValue !== undefined) {
- RowValue_TimestampTZ.encode(message.timestampTzValue, writer.uint32(106).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RowValue {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRowValue();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.nullValue = nullValueFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.boolValue = reader.bool();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.bytesValue = reader.bytes();
- continue;
- }
- case 4: {
- if (tag !== 33) {
- break;
- }
-
- message.doubleValue = reader.double();
- continue;
- }
- case 5: {
- if (tag !== 45) {
- break;
- }
-
- message.floatValue = reader.float();
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.int32Value = reader.int32();
- continue;
- }
- case 7: {
- if (tag !== 56) {
- break;
- }
-
- message.int64Value = Long.fromString(reader.int64().toString());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.stringValue = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.uint32Value = reader.uint32();
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.uint64Value = Long.fromString(reader.uint64().toString(), true);
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.valueValue = Value.unwrap(Value.decode(reader, reader.uint32()));
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.timestampValue = RowValue_Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.timestampTzValue = RowValue_TimestampTZ.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RowValue {
- return {
- nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
- boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
- bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,
- doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : undefined,
- floatValue: isSet(object.floatValue) ? globalThis.Number(object.floatValue) : undefined,
- int32Value: isSet(object.int32Value) ? globalThis.Number(object.int32Value) : undefined,
- int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
- stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
- uint32Value: isSet(object.uint32Value) ? globalThis.Number(object.uint32Value) : undefined,
- uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
- valueValue: isSet(object?.valueValue) ? object.valueValue : undefined,
- timestampValue: isSet(object.timestampValue) ? RowValue_Timestamp.fromJSON(object.timestampValue) : undefined,
- timestampTzValue: isSet(object.timestampTzValue)
- ? RowValue_TimestampTZ.fromJSON(object.timestampTzValue)
- : undefined,
- };
- },
-
- toJSON(message: RowValue): unknown {
- const obj: any = {};
- if (message.nullValue !== undefined) {
- obj.nullValue = nullValueToJSON(message.nullValue);
- }
- if (message.boolValue !== undefined) {
- obj.boolValue = message.boolValue;
- }
- if (message.bytesValue !== undefined) {
- obj.bytesValue = base64FromBytes(message.bytesValue);
- }
- if (message.doubleValue !== undefined) {
- obj.doubleValue = message.doubleValue;
- }
- if (message.floatValue !== undefined) {
- obj.floatValue = message.floatValue;
- }
- if (message.int32Value !== undefined) {
- obj.int32Value = Math.round(message.int32Value);
- }
- if (message.int64Value !== undefined) {
- obj.int64Value = (message.int64Value || Long.ZERO).toString();
- }
- if (message.stringValue !== undefined) {
- obj.stringValue = message.stringValue;
- }
- if (message.uint32Value !== undefined) {
- obj.uint32Value = Math.round(message.uint32Value);
- }
- if (message.uint64Value !== undefined) {
- obj.uint64Value = (message.uint64Value || Long.UZERO).toString();
- }
- if (message.valueValue !== undefined) {
- obj.valueValue = message.valueValue;
- }
- if (message.timestampValue !== undefined) {
- obj.timestampValue = RowValue_Timestamp.toJSON(message.timestampValue);
- }
- if (message.timestampTzValue !== undefined) {
- obj.timestampTzValue = RowValue_TimestampTZ.toJSON(message.timestampTzValue);
- }
- return obj;
- },
-
- create(base?: DeepPartial<RowValue>): RowValue {
- return RowValue.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RowValue>): RowValue {
- const message = createBaseRowValue();
- message.nullValue = object.nullValue ?? undefined;
- message.boolValue = object.boolValue ?? undefined;
- message.bytesValue = object.bytesValue ?? undefined;
- message.doubleValue = object.doubleValue ?? undefined;
- message.floatValue = object.floatValue ?? undefined;
- message.int32Value = object.int32Value ?? undefined;
- message.int64Value = (object.int64Value !== undefined && object.int64Value !== null)
- ? Long.fromValue(object.int64Value)
- : undefined;
- message.stringValue = object.stringValue ?? undefined;
- message.uint32Value = object.uint32Value ?? undefined;
- message.uint64Value = (object.uint64Value !== undefined && object.uint64Value !== null)
- ? Long.fromValue(object.uint64Value)
- : undefined;
- message.valueValue = object.valueValue ?? undefined;
- message.timestampValue = (object.timestampValue !== undefined && object.timestampValue !== null)
- ? RowValue_Timestamp.fromPartial(object.timestampValue)
- : undefined;
- message.timestampTzValue = (object.timestampTzValue !== undefined && object.timestampTzValue !== null)
- ? RowValue_TimestampTZ.fromPartial(object.timestampTzValue)
- : undefined;
- return message;
- },
-};
-
-function createBaseRowValue_Timestamp(): RowValue_Timestamp {
- return { googleTimestamp: undefined, accuracy: 0 };
-}
-
-export const RowValue_Timestamp: MessageFns<RowValue_Timestamp> = {
- encode(message: RowValue_Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.googleTimestamp !== undefined) {
- Timestamp.encode(message.googleTimestamp, writer.uint32(10).fork()).join();
- }
- if (message.accuracy !== 0) {
- writer.uint32(16).int32(message.accuracy);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RowValue_Timestamp {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRowValue_Timestamp();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.googleTimestamp = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.accuracy = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RowValue_Timestamp {
- return {
- googleTimestamp: isSet(object.googleTimestamp) ? fromJsonTimestamp(object.googleTimestamp) : undefined,
- accuracy: isSet(object.accuracy) ? globalThis.Number(object.accuracy) : 0,
- };
- },
-
- toJSON(message: RowValue_Timestamp): unknown {
- const obj: any = {};
- if (message.googleTimestamp !== undefined) {
- obj.googleTimestamp = fromTimestamp(message.googleTimestamp).toISOString();
- }
- if (message.accuracy !== 0) {
- obj.accuracy = Math.round(message.accuracy);
- }
- return obj;
- },
-
- create(base?: DeepPartial<RowValue_Timestamp>): RowValue_Timestamp {
- return RowValue_Timestamp.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RowValue_Timestamp>): RowValue_Timestamp {
- const message = createBaseRowValue_Timestamp();
- message.googleTimestamp = (object.googleTimestamp !== undefined && object.googleTimestamp !== null)
- ? Timestamp.fromPartial(object.googleTimestamp)
- : undefined;
- message.accuracy = object.accuracy ?? 0;
- return message;
- },
-};
-
-function createBaseRowValue_TimestampTZ(): RowValue_TimestampTZ {
- return { googleTimestamp: undefined, zone: "", offset: 0, accuracy: 0 };
-}
-
-export const RowValue_TimestampTZ: MessageFns<RowValue_TimestampTZ> = {
- encode(message: RowValue_TimestampTZ, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.googleTimestamp !== undefined) {
- Timestamp.encode(message.googleTimestamp, writer.uint32(10).fork()).join();
- }
- if (message.zone !== "") {
- writer.uint32(18).string(message.zone);
- }
- if (message.offset !== 0) {
- writer.uint32(24).int32(message.offset);
- }
- if (message.accuracy !== 0) {
- writer.uint32(32).int32(message.accuracy);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): RowValue_TimestampTZ {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseRowValue_TimestampTZ();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.googleTimestamp = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.zone = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.offset = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.accuracy = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): RowValue_TimestampTZ {
- return {
- googleTimestamp: isSet(object.googleTimestamp) ? fromJsonTimestamp(object.googleTimestamp) : undefined,
- zone: isSet(object.zone) ? globalThis.String(object.zone) : "",
- offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
- accuracy: isSet(object.accuracy) ? globalThis.Number(object.accuracy) : 0,
- };
- },
-
- toJSON(message: RowValue_TimestampTZ): unknown {
- const obj: any = {};
- if (message.googleTimestamp !== undefined) {
- obj.googleTimestamp = fromTimestamp(message.googleTimestamp).toISOString();
- }
- if (message.zone !== "") {
- obj.zone = message.zone;
- }
- if (message.offset !== 0) {
- obj.offset = Math.round(message.offset);
- }
- if (message.accuracy !== 0) {
- obj.accuracy = Math.round(message.accuracy);
- }
- return obj;
- },
-
- create(base?: DeepPartial<RowValue_TimestampTZ>): RowValue_TimestampTZ {
- return RowValue_TimestampTZ.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<RowValue_TimestampTZ>): RowValue_TimestampTZ {
- const message = createBaseRowValue_TimestampTZ();
- message.googleTimestamp = (object.googleTimestamp !== undefined && object.googleTimestamp !== null)
- ? Timestamp.fromPartial(object.googleTimestamp)
- : undefined;
- message.zone = object.zone ?? "";
- message.offset = object.offset ?? 0;
- message.accuracy = object.accuracy ?? 0;
- return message;
- },
-};
-
-function createBaseAdvice(): Advice {
- return {
- status: Advice_Status.STATUS_UNSPECIFIED,
- code: 0,
- title: "",
- content: "",
- startPosition: undefined,
- endPosition: undefined,
- };
-}
-
-export const Advice: MessageFns<Advice> = {
- encode(message: Advice, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- 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);
- }
- if (message.title !== "") {
- writer.uint32(26).string(message.title);
- }
- if (message.content !== "") {
- writer.uint32(34).string(message.content);
- }
- if (message.startPosition !== undefined) {
- Position.encode(message.startPosition, writer.uint32(66).fork()).join();
- }
- if (message.endPosition !== undefined) {
- Position.encode(message.endPosition, writer.uint32(74).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Advice {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAdvice();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.status = advice_StatusFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.code = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.content = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.startPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.endPosition = Position.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Advice {
- return {
- status: isSet(object.status) ? advice_StatusFromJSON(object.status) : Advice_Status.STATUS_UNSPECIFIED,
- code: isSet(object.code) ? globalThis.Number(object.code) : 0,
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- content: isSet(object.content) ? globalThis.String(object.content) : "",
- startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
- endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
- };
- },
-
- toJSON(message: Advice): unknown {
- const obj: any = {};
- if (message.status !== Advice_Status.STATUS_UNSPECIFIED) {
- obj.status = advice_StatusToJSON(message.status);
- }
- if (message.code !== 0) {
- obj.code = Math.round(message.code);
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.content !== "") {
- obj.content = message.content;
- }
- if (message.startPosition !== undefined) {
- obj.startPosition = Position.toJSON(message.startPosition);
- }
- if (message.endPosition !== undefined) {
- obj.endPosition = Position.toJSON(message.endPosition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<Advice>): Advice {
- return Advice.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Advice>): Advice {
- const message = createBaseAdvice();
- message.status = object.status ?? Advice_Status.STATUS_UNSPECIFIED;
- message.code = object.code ?? 0;
- message.title = object.title ?? "";
- message.content = object.content ?? "";
- message.startPosition = (object.startPosition !== undefined && object.startPosition !== null)
- ? Position.fromPartial(object.startPosition)
- : undefined;
- message.endPosition = (object.endPosition !== undefined && object.endPosition !== null)
- ? Position.fromPartial(object.endPosition)
- : undefined;
- return message;
- },
-};
-
-function createBaseExportRequest(): ExportRequest {
- return {
- name: "",
- statement: "",
- limit: 0,
- format: ExportFormat.FORMAT_UNSPECIFIED,
- admin: false,
- password: "",
- dataSourceId: "",
- };
-}
-
-export const ExportRequest: MessageFns<ExportRequest> = {
- encode(message: ExportRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.statement !== "") {
- writer.uint32(26).string(message.statement);
- }
- if (message.limit !== 0) {
- writer.uint32(32).int32(message.limit);
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- writer.uint32(40).int32(exportFormatToNumber(message.format));
- }
- if (message.admin !== false) {
- writer.uint32(48).bool(message.admin);
- }
- if (message.password !== "") {
- writer.uint32(58).string(message.password);
- }
- if (message.dataSourceId !== "") {
- writer.uint32(66).string(message.dataSourceId);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExportRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExportRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.limit = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.format = exportFormatFromJSON(reader.int32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.admin = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.dataSourceId = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExportRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
- admin: isSet(object.admin) ? globalThis.Boolean(object.admin) : false,
- password: isSet(object.password) ? globalThis.String(object.password) : "",
- dataSourceId: isSet(object.dataSourceId) ? globalThis.String(object.dataSourceId) : "",
- };
- },
-
- toJSON(message: ExportRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.limit !== 0) {
- obj.limit = Math.round(message.limit);
- }
- if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
- obj.format = exportFormatToJSON(message.format);
- }
- if (message.admin !== false) {
- obj.admin = message.admin;
- }
- if (message.password !== "") {
- obj.password = message.password;
- }
- if (message.dataSourceId !== "") {
- obj.dataSourceId = message.dataSourceId;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExportRequest>): ExportRequest {
- return ExportRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExportRequest>): ExportRequest {
- const message = createBaseExportRequest();
- message.name = object.name ?? "";
- message.statement = object.statement ?? "";
- message.limit = object.limit ?? 0;
- message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
- message.admin = object.admin ?? false;
- message.password = object.password ?? "";
- message.dataSourceId = object.dataSourceId ?? "";
- return message;
- },
-};
-
-function createBaseExportResponse(): ExportResponse {
- return { content: new Uint8Array(0) };
-}
-
-export const ExportResponse: MessageFns<ExportResponse> = {
- encode(message: ExportResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.content.length !== 0) {
- writer.uint32(10).bytes(message.content);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ExportResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExportResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.content = reader.bytes();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExportResponse {
- return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0) };
- },
-
- toJSON(message: ExportResponse): unknown {
- const obj: any = {};
- if (message.content.length !== 0) {
- obj.content = base64FromBytes(message.content);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExportResponse>): ExportResponse {
- return ExportResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExportResponse>): ExportResponse {
- const message = createBaseExportResponse();
- message.content = object.content ?? new Uint8Array(0);
- return message;
- },
-};
-
-function createBasePrettyRequest(): PrettyRequest {
- return { engine: Engine.ENGINE_UNSPECIFIED, currentSchema: "", expectedSchema: "" };
-}
-
-export const PrettyRequest: MessageFns<PrettyRequest> = {
- encode(message: PrettyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(8).int32(engineToNumber(message.engine));
- }
- if (message.currentSchema !== "") {
- writer.uint32(18).string(message.currentSchema);
- }
- if (message.expectedSchema !== "") {
- writer.uint32(26).string(message.expectedSchema);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PrettyRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePrettyRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.currentSchema = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.expectedSchema = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PrettyRequest {
- return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- currentSchema: isSet(object.currentSchema) ? globalThis.String(object.currentSchema) : "",
- expectedSchema: isSet(object.expectedSchema) ? globalThis.String(object.expectedSchema) : "",
- };
- },
-
- toJSON(message: PrettyRequest): unknown {
- const obj: any = {};
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.currentSchema !== "") {
- obj.currentSchema = message.currentSchema;
- }
- if (message.expectedSchema !== "") {
- obj.expectedSchema = message.expectedSchema;
- }
- return obj;
- },
-
- create(base?: DeepPartial<PrettyRequest>): PrettyRequest {
- return PrettyRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PrettyRequest>): PrettyRequest {
- const message = createBasePrettyRequest();
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.currentSchema = object.currentSchema ?? "";
- message.expectedSchema = object.expectedSchema ?? "";
- return message;
- },
-};
-
-function createBasePrettyResponse(): PrettyResponse {
- return { currentSchema: "", expectedSchema: "" };
-}
-
-export const PrettyResponse: MessageFns<PrettyResponse> = {
- encode(message: PrettyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.currentSchema !== "") {
- writer.uint32(10).string(message.currentSchema);
- }
- if (message.expectedSchema !== "") {
- writer.uint32(18).string(message.expectedSchema);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PrettyResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePrettyResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.currentSchema = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.expectedSchema = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PrettyResponse {
- return {
- currentSchema: isSet(object.currentSchema) ? globalThis.String(object.currentSchema) : "",
- expectedSchema: isSet(object.expectedSchema) ? globalThis.String(object.expectedSchema) : "",
- };
- },
-
- toJSON(message: PrettyResponse): unknown {
- const obj: any = {};
- if (message.currentSchema !== "") {
- obj.currentSchema = message.currentSchema;
- }
- if (message.expectedSchema !== "") {
- obj.expectedSchema = message.expectedSchema;
- }
- return obj;
- },
-
- create(base?: DeepPartial<PrettyResponse>): PrettyResponse {
- return PrettyResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PrettyResponse>): PrettyResponse {
- const message = createBasePrettyResponse();
- message.currentSchema = object.currentSchema ?? "";
- message.expectedSchema = object.expectedSchema ?? "";
- return message;
- },
-};
-
-function createBaseCheckRequest(): CheckRequest {
- return { name: "", statement: "", changeType: CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED };
-}
-
-export const CheckRequest: MessageFns<CheckRequest> = {
- encode(message: CheckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(18).string(message.name);
- }
- if (message.statement !== "") {
- writer.uint32(10).string(message.statement);
- }
- if (message.changeType !== CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
- writer.uint32(32).int32(checkRequest_ChangeTypeToNumber(message.changeType));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.changeType = checkRequest_ChangeTypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckRequest {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- changeType: isSet(object.changeType)
- ? checkRequest_ChangeTypeFromJSON(object.changeType)
- : CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: CheckRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.changeType !== CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
- obj.changeType = checkRequest_ChangeTypeToJSON(message.changeType);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckRequest>): CheckRequest {
- return CheckRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckRequest>): CheckRequest {
- const message = createBaseCheckRequest();
- message.name = object.name ?? "";
- message.statement = object.statement ?? "";
- message.changeType = object.changeType ?? CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseCheckResponse(): CheckResponse {
- return { advices: [], affectedRows: 0 };
-}
-
-export const CheckResponse: MessageFns<CheckResponse> = {
- encode(message: CheckResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.advices) {
- Advice.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.affectedRows !== 0) {
- writer.uint32(16).int32(message.affectedRows);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CheckResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCheckResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.advices.push(Advice.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.affectedRows = reader.int32();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CheckResponse {
- return {
- advices: globalThis.Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [],
- affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
- };
- },
-
- toJSON(message: CheckResponse): unknown {
- const obj: any = {};
- if (message.advices?.length) {
- obj.advices = message.advices.map((e) => Advice.toJSON(e));
- }
- if (message.affectedRows !== 0) {
- obj.affectedRows = Math.round(message.affectedRows);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CheckResponse>): CheckResponse {
- return CheckResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CheckResponse>): CheckResponse {
- const message = createBaseCheckResponse();
- message.advices = object.advices?.map((e) => Advice.fromPartial(e)) || [];
- message.affectedRows = object.affectedRows ?? 0;
- return message;
- },
-};
-
-function createBaseParseMyBatisMapperRequest(): ParseMyBatisMapperRequest {
- return { content: new Uint8Array(0) };
-}
-
-export const ParseMyBatisMapperRequest: MessageFns<ParseMyBatisMapperRequest> = {
- encode(message: ParseMyBatisMapperRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.content.length !== 0) {
- writer.uint32(10).bytes(message.content);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ParseMyBatisMapperRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseParseMyBatisMapperRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.content = reader.bytes();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ParseMyBatisMapperRequest {
- return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0) };
- },
-
- toJSON(message: ParseMyBatisMapperRequest): unknown {
- const obj: any = {};
- if (message.content.length !== 0) {
- obj.content = base64FromBytes(message.content);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ParseMyBatisMapperRequest>): ParseMyBatisMapperRequest {
- return ParseMyBatisMapperRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ParseMyBatisMapperRequest>): ParseMyBatisMapperRequest {
- const message = createBaseParseMyBatisMapperRequest();
- message.content = object.content ?? new Uint8Array(0);
- return message;
- },
-};
-
-function createBaseParseMyBatisMapperResponse(): ParseMyBatisMapperResponse {
- return { statements: [] };
-}
-
-export const ParseMyBatisMapperResponse: MessageFns<ParseMyBatisMapperResponse> = {
- encode(message: ParseMyBatisMapperResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.statements) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ParseMyBatisMapperResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseParseMyBatisMapperResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.statements.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ParseMyBatisMapperResponse {
- return {
- statements: globalThis.Array.isArray(object?.statements)
- ? object.statements.map((e: any) => globalThis.String(e))
- : [],
- };
- },
-
- toJSON(message: ParseMyBatisMapperResponse): unknown {
- const obj: any = {};
- if (message.statements?.length) {
- obj.statements = message.statements;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ParseMyBatisMapperResponse>): ParseMyBatisMapperResponse {
- return ParseMyBatisMapperResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ParseMyBatisMapperResponse>): ParseMyBatisMapperResponse {
- const message = createBaseParseMyBatisMapperResponse();
- message.statements = object.statements?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseDiffMetadataRequest(): DiffMetadataRequest {
- return {
- sourceMetadata: undefined,
- targetMetadata: undefined,
- sourceCatalog: undefined,
- targetCatalog: undefined,
- engine: Engine.ENGINE_UNSPECIFIED,
- classificationFromConfig: false,
- };
-}
-
-export const DiffMetadataRequest: MessageFns<DiffMetadataRequest> = {
- encode(message: DiffMetadataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.sourceMetadata !== undefined) {
- DatabaseMetadata.encode(message.sourceMetadata, writer.uint32(10).fork()).join();
- }
- if (message.targetMetadata !== undefined) {
- DatabaseMetadata.encode(message.targetMetadata, writer.uint32(18).fork()).join();
- }
- if (message.sourceCatalog !== undefined) {
- DatabaseCatalog.encode(message.sourceCatalog, writer.uint32(42).fork()).join();
- }
- if (message.targetCatalog !== undefined) {
- DatabaseCatalog.encode(message.targetCatalog, writer.uint32(50).fork()).join();
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- writer.uint32(24).int32(engineToNumber(message.engine));
- }
- if (message.classificationFromConfig !== false) {
- writer.uint32(32).bool(message.classificationFromConfig);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DiffMetadataRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDiffMetadataRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.sourceMetadata = DatabaseMetadata.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.targetMetadata = DatabaseMetadata.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.sourceCatalog = DatabaseCatalog.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.targetCatalog = DatabaseCatalog.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.engine = engineFromJSON(reader.int32());
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.classificationFromConfig = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DiffMetadataRequest {
- return {
- sourceMetadata: isSet(object.sourceMetadata) ? DatabaseMetadata.fromJSON(object.sourceMetadata) : undefined,
- targetMetadata: isSet(object.targetMetadata) ? DatabaseMetadata.fromJSON(object.targetMetadata) : undefined,
- sourceCatalog: isSet(object.sourceCatalog) ? DatabaseCatalog.fromJSON(object.sourceCatalog) : undefined,
- targetCatalog: isSet(object.targetCatalog) ? DatabaseCatalog.fromJSON(object.targetCatalog) : undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
- classificationFromConfig: isSet(object.classificationFromConfig)
- ? globalThis.Boolean(object.classificationFromConfig)
- : false,
- };
- },
-
- toJSON(message: DiffMetadataRequest): unknown {
- const obj: any = {};
- if (message.sourceMetadata !== undefined) {
- obj.sourceMetadata = DatabaseMetadata.toJSON(message.sourceMetadata);
- }
- if (message.targetMetadata !== undefined) {
- obj.targetMetadata = DatabaseMetadata.toJSON(message.targetMetadata);
- }
- if (message.sourceCatalog !== undefined) {
- obj.sourceCatalog = DatabaseCatalog.toJSON(message.sourceCatalog);
- }
- if (message.targetCatalog !== undefined) {
- obj.targetCatalog = DatabaseCatalog.toJSON(message.targetCatalog);
- }
- if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
- obj.engine = engineToJSON(message.engine);
- }
- if (message.classificationFromConfig !== false) {
- obj.classificationFromConfig = message.classificationFromConfig;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DiffMetadataRequest>): DiffMetadataRequest {
- return DiffMetadataRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DiffMetadataRequest>): DiffMetadataRequest {
- const message = createBaseDiffMetadataRequest();
- message.sourceMetadata = (object.sourceMetadata !== undefined && object.sourceMetadata !== null)
- ? DatabaseMetadata.fromPartial(object.sourceMetadata)
- : undefined;
- message.targetMetadata = (object.targetMetadata !== undefined && object.targetMetadata !== null)
- ? DatabaseMetadata.fromPartial(object.targetMetadata)
- : undefined;
- message.sourceCatalog = (object.sourceCatalog !== undefined && object.sourceCatalog !== null)
- ? DatabaseCatalog.fromPartial(object.sourceCatalog)
- : undefined;
- message.targetCatalog = (object.targetCatalog !== undefined && object.targetCatalog !== null)
- ? DatabaseCatalog.fromPartial(object.targetCatalog)
- : undefined;
- message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
- message.classificationFromConfig = object.classificationFromConfig ?? false;
- return message;
- },
-};
-
-function createBaseDiffMetadataResponse(): DiffMetadataResponse {
- return { diff: "" };
-}
-
-export const DiffMetadataResponse: MessageFns<DiffMetadataResponse> = {
- encode(message: DiffMetadataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.diff !== "") {
- writer.uint32(10).string(message.diff);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DiffMetadataResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDiffMetadataResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.diff = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DiffMetadataResponse {
- return { diff: isSet(object.diff) ? globalThis.String(object.diff) : "" };
- },
-
- toJSON(message: DiffMetadataResponse): unknown {
- const obj: any = {};
- if (message.diff !== "") {
- obj.diff = message.diff;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DiffMetadataResponse>): DiffMetadataResponse {
- return DiffMetadataResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DiffMetadataResponse>): DiffMetadataResponse {
- const message = createBaseDiffMetadataResponse();
- message.diff = object.diff ?? "";
- return message;
- },
-};
-
-function createBaseSearchQueryHistoriesRequest(): SearchQueryHistoriesRequest {
- return { pageSize: 0, pageToken: "", filter: "" };
-}
-
-export const SearchQueryHistoriesRequest: MessageFns<SearchQueryHistoriesRequest> = {
- encode(message: SearchQueryHistoriesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- if (message.filter !== "") {
- writer.uint32(26).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchQueryHistoriesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchQueryHistoriesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchQueryHistoriesRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: SearchQueryHistoriesRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchQueryHistoriesRequest>): SearchQueryHistoriesRequest {
- return SearchQueryHistoriesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchQueryHistoriesRequest>): SearchQueryHistoriesRequest {
- const message = createBaseSearchQueryHistoriesRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseSearchQueryHistoriesResponse(): SearchQueryHistoriesResponse {
- return { queryHistories: [], nextPageToken: "" };
-}
-
-export const SearchQueryHistoriesResponse: MessageFns<SearchQueryHistoriesResponse> = {
- encode(message: SearchQueryHistoriesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.queryHistories) {
- QueryHistory.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchQueryHistoriesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchQueryHistoriesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.queryHistories.push(QueryHistory.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchQueryHistoriesResponse {
- return {
- queryHistories: globalThis.Array.isArray(object?.queryHistories)
- ? object.queryHistories.map((e: any) => QueryHistory.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchQueryHistoriesResponse): unknown {
- const obj: any = {};
- if (message.queryHistories?.length) {
- obj.queryHistories = message.queryHistories.map((e) => QueryHistory.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchQueryHistoriesResponse>): SearchQueryHistoriesResponse {
- return SearchQueryHistoriesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchQueryHistoriesResponse>): SearchQueryHistoriesResponse {
- const message = createBaseSearchQueryHistoriesResponse();
- message.queryHistories = object.queryHistories?.map((e) => QueryHistory.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseQueryHistory(): QueryHistory {
- return {
- name: "",
- database: "",
- creator: "",
- createTime: undefined,
- statement: "",
- error: undefined,
- duration: undefined,
- type: QueryHistory_Type.TYPE_UNSPECIFIED,
- };
-}
-
-export const QueryHistory: MessageFns<QueryHistory> = {
- encode(message: QueryHistory, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.database !== "") {
- writer.uint32(18).string(message.database);
- }
- if (message.creator !== "") {
- writer.uint32(26).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(34).fork()).join();
- }
- if (message.statement !== "") {
- writer.uint32(42).string(message.statement);
- }
- if (message.error !== undefined) {
- writer.uint32(50).string(message.error);
- }
- if (message.duration !== undefined) {
- Duration.encode(message.duration, writer.uint32(58).fork()).join();
- }
- if (message.type !== QueryHistory_Type.TYPE_UNSPECIFIED) {
- writer.uint32(64).int32(queryHistory_TypeToNumber(message.type));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): QueryHistory {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseQueryHistory();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.statement = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.error = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.duration = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 64) {
- break;
- }
-
- message.type = queryHistory_TypeFromJSON(reader.int32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): QueryHistory {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
- error: isSet(object.error) ? globalThis.String(object.error) : undefined,
- duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined,
- type: isSet(object.type) ? queryHistory_TypeFromJSON(object.type) : QueryHistory_Type.TYPE_UNSPECIFIED,
- };
- },
-
- toJSON(message: QueryHistory): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.statement !== "") {
- obj.statement = message.statement;
- }
- if (message.error !== undefined) {
- obj.error = message.error;
- }
- if (message.duration !== undefined) {
- obj.duration = Duration.toJSON(message.duration);
- }
- if (message.type !== QueryHistory_Type.TYPE_UNSPECIFIED) {
- obj.type = queryHistory_TypeToJSON(message.type);
- }
- return obj;
- },
-
- create(base?: DeepPartial<QueryHistory>): QueryHistory {
- return QueryHistory.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<QueryHistory>): QueryHistory {
- const message = createBaseQueryHistory();
- message.name = object.name ?? "";
- message.database = object.database ?? "";
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.statement = object.statement ?? "";
- message.error = object.error ?? undefined;
- message.duration = (object.duration !== undefined && object.duration !== null)
- ? Duration.fromPartial(object.duration)
- : undefined;
- message.type = object.type ?? QueryHistory_Type.TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseAICompletionRequest(): AICompletionRequest {
- return { messages: [] };
-}
-
-export const AICompletionRequest: MessageFns<AICompletionRequest> = {
- encode(message: AICompletionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.messages) {
- AICompletionRequest_Message.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.messages.push(AICompletionRequest_Message.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionRequest {
- return {
- messages: globalThis.Array.isArray(object?.messages)
- ? object.messages.map((e: any) => AICompletionRequest_Message.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: AICompletionRequest): unknown {
- const obj: any = {};
- if (message.messages?.length) {
- obj.messages = message.messages.map((e) => AICompletionRequest_Message.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionRequest>): AICompletionRequest {
- return AICompletionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AICompletionRequest>): AICompletionRequest {
- const message = createBaseAICompletionRequest();
- message.messages = object.messages?.map((e) => AICompletionRequest_Message.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseAICompletionRequest_Message(): AICompletionRequest_Message {
- return { role: "", content: "" };
-}
-
-export const AICompletionRequest_Message: MessageFns<AICompletionRequest_Message> = {
- encode(message: AICompletionRequest_Message, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.role !== "") {
- writer.uint32(10).string(message.role);
- }
- if (message.content !== "") {
- writer.uint32(18).string(message.content);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionRequest_Message {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionRequest_Message();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.role = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.content = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionRequest_Message {
- return {
- role: isSet(object.role) ? globalThis.String(object.role) : "",
- content: isSet(object.content) ? globalThis.String(object.content) : "",
- };
- },
-
- toJSON(message: AICompletionRequest_Message): unknown {
- const obj: any = {};
- if (message.role !== "") {
- obj.role = message.role;
- }
- if (message.content !== "") {
- obj.content = message.content;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionRequest_Message>): AICompletionRequest_Message {
- return AICompletionRequest_Message.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AICompletionRequest_Message>): AICompletionRequest_Message {
- const message = createBaseAICompletionRequest_Message();
- message.role = object.role ?? "";
- message.content = object.content ?? "";
- return message;
- },
-};
-
-function createBaseAICompletionResponse(): AICompletionResponse {
- return { candidates: [] };
-}
-
-export const AICompletionResponse: MessageFns<AICompletionResponse> = {
- encode(message: AICompletionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.candidates) {
- AICompletionResponse_Candidate.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.candidates.push(AICompletionResponse_Candidate.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionResponse {
- return {
- candidates: globalThis.Array.isArray(object?.candidates)
- ? object.candidates.map((e: any) => AICompletionResponse_Candidate.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: AICompletionResponse): unknown {
- const obj: any = {};
- if (message.candidates?.length) {
- obj.candidates = message.candidates.map((e) => AICompletionResponse_Candidate.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionResponse>): AICompletionResponse {
- return AICompletionResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AICompletionResponse>): AICompletionResponse {
- const message = createBaseAICompletionResponse();
- message.candidates = object.candidates?.map((e) => AICompletionResponse_Candidate.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseAICompletionResponse_Candidate(): AICompletionResponse_Candidate {
- return { content: undefined };
-}
-
-export const AICompletionResponse_Candidate: MessageFns<AICompletionResponse_Candidate> = {
- encode(message: AICompletionResponse_Candidate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.content !== undefined) {
- AICompletionResponse_Candidate_Content.encode(message.content, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionResponse_Candidate {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionResponse_Candidate();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.content = AICompletionResponse_Candidate_Content.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionResponse_Candidate {
- return {
- content: isSet(object.content) ? AICompletionResponse_Candidate_Content.fromJSON(object.content) : undefined,
- };
- },
-
- toJSON(message: AICompletionResponse_Candidate): unknown {
- const obj: any = {};
- if (message.content !== undefined) {
- obj.content = AICompletionResponse_Candidate_Content.toJSON(message.content);
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionResponse_Candidate>): AICompletionResponse_Candidate {
- return AICompletionResponse_Candidate.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AICompletionResponse_Candidate>): AICompletionResponse_Candidate {
- const message = createBaseAICompletionResponse_Candidate();
- message.content = (object.content !== undefined && object.content !== null)
- ? AICompletionResponse_Candidate_Content.fromPartial(object.content)
- : undefined;
- return message;
- },
-};
-
-function createBaseAICompletionResponse_Candidate_Content(): AICompletionResponse_Candidate_Content {
- return { parts: [] };
-}
-
-export const AICompletionResponse_Candidate_Content: MessageFns<AICompletionResponse_Candidate_Content> = {
- encode(message: AICompletionResponse_Candidate_Content, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.parts) {
- AICompletionResponse_Candidate_Content_Part.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionResponse_Candidate_Content {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionResponse_Candidate_Content();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parts.push(AICompletionResponse_Candidate_Content_Part.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionResponse_Candidate_Content {
- return {
- parts: globalThis.Array.isArray(object?.parts)
- ? object.parts.map((e: any) => AICompletionResponse_Candidate_Content_Part.fromJSON(e))
- : [],
- };
- },
-
- toJSON(message: AICompletionResponse_Candidate_Content): unknown {
- const obj: any = {};
- if (message.parts?.length) {
- obj.parts = message.parts.map((e) => AICompletionResponse_Candidate_Content_Part.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionResponse_Candidate_Content>): AICompletionResponse_Candidate_Content {
- return AICompletionResponse_Candidate_Content.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<AICompletionResponse_Candidate_Content>): AICompletionResponse_Candidate_Content {
- const message = createBaseAICompletionResponse_Candidate_Content();
- message.parts = object.parts?.map((e) => AICompletionResponse_Candidate_Content_Part.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseAICompletionResponse_Candidate_Content_Part(): AICompletionResponse_Candidate_Content_Part {
- return { text: "" };
-}
-
-export const AICompletionResponse_Candidate_Content_Part: MessageFns<AICompletionResponse_Candidate_Content_Part> = {
- encode(
- message: AICompletionResponse_Candidate_Content_Part,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.text !== "") {
- writer.uint32(10).string(message.text);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): AICompletionResponse_Candidate_Content_Part {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAICompletionResponse_Candidate_Content_Part();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.text = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): AICompletionResponse_Candidate_Content_Part {
- return { text: isSet(object.text) ? globalThis.String(object.text) : "" };
- },
-
- toJSON(message: AICompletionResponse_Candidate_Content_Part): unknown {
- const obj: any = {};
- if (message.text !== "") {
- obj.text = message.text;
- }
- return obj;
- },
-
- create(base?: DeepPartial<AICompletionResponse_Candidate_Content_Part>): AICompletionResponse_Candidate_Content_Part {
- return AICompletionResponse_Candidate_Content_Part.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<AICompletionResponse_Candidate_Content_Part>,
- ): AICompletionResponse_Candidate_Content_Part {
- const message = createBaseAICompletionResponse_Candidate_Content_Part();
- message.text = object.text ?? "";
- return message;
- },
-};
-
-export type SQLServiceDefinition = typeof SQLServiceDefinition;
-export const SQLServiceDefinition = {
- name: "SQLService",
- fullName: "bytebase.v1.SQLService",
- methods: {
- /** Permissions required: bb.databases.get */
- query: {
- name: "Query",
- requestType: QueryRequest,
- requestStream: false,
- responseType: QueryResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 80,
- 58,
- 1,
- 42,
- 90,
- 33,
- 58,
- 1,
- 42,
- 34,
- 28,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 113,
- 117,
- 101,
- 114,
- 121,
- 34,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 113,
- 117,
- 101,
- 114,
- 121,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.sql.admin */
- adminExecute: {
- name: "AdminExecute",
- requestType: AdminExecuteRequest,
- requestStream: true,
- responseType: AdminExecuteResponse,
- responseStream: true,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([12, 98, 98, 46, 115, 113, 108, 46, 97, 100, 109, 105, 110])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([18, 18, 16, 47, 118, 49, 58, 97, 100, 109, 105, 110, 69, 120, 101, 99, 117, 116, 101]),
- ],
- },
- },
- },
- /**
- * SearchQueryHistories searches query histories for the caller.
- * Permissions required: None
- */
- searchQueryHistories: {
- name: "SearchQueryHistories",
- requestType: SearchQueryHistoriesRequest,
- requestStream: false,
- responseType: SearchQueryHistoriesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 30,
- 58,
- 1,
- 42,
- 34,
- 25,
- 47,
- 118,
- 49,
- 47,
- 113,
- 117,
- 101,
- 114,
- 121,
- 72,
- 105,
- 115,
- 116,
- 111,
- 114,
- 105,
- 101,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.get */
- export: {
- name: "Export",
- requestType: ExportRequest,
- requestStream: false,
- responseType: ExportResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [new Uint8Array([16, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 183,
- 1,
- 58,
- 1,
- 42,
- 90,
- 34,
- 58,
- 1,
- 42,
- 34,
- 29,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- 90,
- 44,
- 58,
- 1,
- 42,
- 34,
- 39,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 125,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- 90,
- 53,
- 58,
- 1,
- 42,
- 34,
- 48,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 112,
- 114,
- 111,
- 106,
- 101,
- 99,
- 116,
- 115,
- 47,
- 42,
- 47,
- 114,
- 111,
- 108,
- 108,
- 111,
- 117,
- 116,
- 115,
- 47,
- 42,
- 47,
- 115,
- 116,
- 97,
- 103,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- 34,
- 41,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 115,
- 116,
- 97,
- 110,
- 99,
- 101,
- 115,
- 47,
- 42,
- 47,
- 100,
- 97,
- 116,
- 97,
- 98,
- 97,
- 115,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 101,
- 120,
- 112,
- 111,
- 114,
- 116,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.databases.check */
- check: {
- name: "Check",
- requestType: CheckRequest,
- requestStream: false,
- responseType: CheckResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([18, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 99, 104, 101, 99, 107]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([18, 58, 1, 42, 34, 13, 47, 118, 49, 47, 115, 113, 108, 47, 99, 104, 101, 99, 107]),
- ],
- },
- },
- },
- /** Permissions required: None */
- pretty: {
- name: "Pretty",
- requestType: PrettyRequest,
- requestStream: false,
- responseType: PrettyResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([19, 58, 1, 42, 34, 14, 47, 118, 49, 47, 115, 113, 108, 47, 112, 114, 101, 116, 116, 121]),
- ],
- },
- },
- },
- /** Permissions required: None */
- diffMetadata: {
- name: "DiffMetadata",
- requestType: DiffMetadataRequest,
- requestStream: false,
- responseType: DiffMetadataResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 34,
- 58,
- 1,
- 42,
- 34,
- 29,
- 47,
- 118,
- 49,
- 47,
- 115,
- 99,
- 104,
- 101,
- 109,
- 97,
- 68,
- 101,
- 115,
- 105,
- 103,
- 110,
- 58,
- 100,
- 105,
- 102,
- 102,
- 77,
- 101,
- 116,
- 97,
- 100,
- 97,
- 116,
- 97,
- ]),
- ],
- },
- },
- },
- /** Permissions required: None */
- aICompletion: {
- name: "AICompletion",
- requestType: AICompletionRequest,
- requestStream: false,
- responseType: AICompletionResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 25,
- 58,
- 1,
- 42,
- 34,
- 20,
- 47,
- 118,
- 49,
- 47,
- 115,
- 113,
- 108,
- 47,
- 97,
- 105,
- 67,
- 111,
- 109,
- 112,
- 108,
- 101,
- 116,
- 105,
- 111,
- 110,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
deleted file mode 100644
index d81c188070..0000000000
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ /dev/null
@@ -1,1333 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/subscription_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Timestamp } from "../google/protobuf/timestamp";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum PlanType {
- PLAN_TYPE_UNSPECIFIED = "PLAN_TYPE_UNSPECIFIED",
- FREE = "FREE",
- TEAM = "TEAM",
- ENTERPRISE = "ENTERPRISE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function planTypeFromJSON(object: any): PlanType {
- switch (object) {
- case 0:
- case "PLAN_TYPE_UNSPECIFIED":
- return PlanType.PLAN_TYPE_UNSPECIFIED;
- case 1:
- case "FREE":
- return PlanType.FREE;
- case 2:
- case "TEAM":
- return PlanType.TEAM;
- case 3:
- case "ENTERPRISE":
- return PlanType.ENTERPRISE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PlanType.UNRECOGNIZED;
- }
-}
-
-export function planTypeToJSON(object: PlanType): string {
- switch (object) {
- case PlanType.PLAN_TYPE_UNSPECIFIED:
- return "PLAN_TYPE_UNSPECIFIED";
- case PlanType.FREE:
- return "FREE";
- case PlanType.TEAM:
- return "TEAM";
- case PlanType.ENTERPRISE:
- return "ENTERPRISE";
- case PlanType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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;
- }
-}
-
-/** PlanFeature represents the available features in Bytebase */
-export enum PlanFeature {
- FEATURE_UNSPECIFIED = "FEATURE_UNSPECIFIED",
- /** FEATURE_DATABASE_CHANGE - Database Change Management */
- FEATURE_DATABASE_CHANGE = "FEATURE_DATABASE_CHANGE",
- FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL = "FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL",
- FEATURE_DECLARATIVE_SCHEMA_MIGRATION = "FEATURE_DECLARATIVE_SCHEMA_MIGRATION",
- FEATURE_COMPARE_AND_SYNC_SCHEMA = "FEATURE_COMPARE_AND_SYNC_SCHEMA",
- FEATURE_ONLINE_SCHEMA_CHANGE = "FEATURE_ONLINE_SCHEMA_CHANGE",
- FEATURE_PRE_DEPLOYMENT_SQL_REVIEW = "FEATURE_PRE_DEPLOYMENT_SQL_REVIEW",
- FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES = "FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES",
- FEATURE_ONE_CLICK_DATA_ROLLBACK = "FEATURE_ONE_CLICK_DATA_ROLLBACK",
- FEATURE_MULTI_DATABASE_BATCH_CHANGES = "FEATURE_MULTI_DATABASE_BATCH_CHANGES",
- FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT = "FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT",
- FEATURE_SCHEDULED_ROLLOUT_TIME = "FEATURE_SCHEDULED_ROLLOUT_TIME",
- FEATURE_DATABASE_CHANGELOG = "FEATURE_DATABASE_CHANGELOG",
- FEATURE_SCHEMA_DRIFT_DETECTION = "FEATURE_SCHEMA_DRIFT_DETECTION",
- FEATURE_CHANGELIST = "FEATURE_CHANGELIST",
- FEATURE_SCHEMA_TEMPLATE = "FEATURE_SCHEMA_TEMPLATE",
- FEATURE_ROLLOUT_POLICY = "FEATURE_ROLLOUT_POLICY",
- /** FEATURE_WEB_BASED_SQL_EDITOR - SQL Editor & Development */
- FEATURE_WEB_BASED_SQL_EDITOR = "FEATURE_WEB_BASED_SQL_EDITOR",
- FEATURE_SQL_EDITOR_ADMIN_MODE = "FEATURE_SQL_EDITOR_ADMIN_MODE",
- FEATURE_NATURAL_LANGUAGE_TO_SQL = "FEATURE_NATURAL_LANGUAGE_TO_SQL",
- FEATURE_AI_QUERY_EXPLANATION = "FEATURE_AI_QUERY_EXPLANATION",
- FEATURE_AI_QUERY_SUGGESTIONS = "FEATURE_AI_QUERY_SUGGESTIONS",
- FEATURE_AUTO_COMPLETE = "FEATURE_AUTO_COMPLETE",
- FEATURE_SCHEMA_DIAGRAM = "FEATURE_SCHEMA_DIAGRAM",
- FEATURE_SCHEMA_EDITOR = "FEATURE_SCHEMA_EDITOR",
- FEATURE_DATA_EXPORT = "FEATURE_DATA_EXPORT",
- FEATURE_DATA_OFFLINE_EXPORT = "FEATURE_DATA_OFFLINE_EXPORT",
- FEATURE_QUERY_HISTORY = "FEATURE_QUERY_HISTORY",
- FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS = "FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS",
- FEATURE_BATCH_QUERY = "FEATURE_BATCH_QUERY",
- FEATURE_INSTANCE_READ_ONLY_CONNECTION = "FEATURE_INSTANCE_READ_ONLY_CONNECTION",
- FEATURE_QUERY_POLICY = "FEATURE_QUERY_POLICY",
- FEATURE_RESTRICT_COPYING_DATA = "FEATURE_RESTRICT_COPYING_DATA",
- /** FEATURE_IAM - Security & Compliance */
- FEATURE_IAM = "FEATURE_IAM",
- FEATURE_INSTANCE_SSL_CONNECTION = "FEATURE_INSTANCE_SSL_CONNECTION",
- FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL = "FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL",
- FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION = "FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION",
- FEATURE_GOOGLE_AND_GITHUB_SSO = "FEATURE_GOOGLE_AND_GITHUB_SSO",
- FEATURE_USER_GROUPS = "FEATURE_USER_GROUPS",
- FEATURE_DISALLOW_SELF_SERVICE_SIGNUP = "FEATURE_DISALLOW_SELF_SERVICE_SIGNUP",
- FEATURE_DATABASE_SECRET_VARIABLES = "FEATURE_DATABASE_SECRET_VARIABLES",
- FEATURE_CUSTOM_INSTANCE_SYNC_TIME = "FEATURE_CUSTOM_INSTANCE_SYNC_TIME",
- FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT = "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT",
- FEATURE_RISK_ASSESSMENT = "FEATURE_RISK_ASSESSMENT",
- FEATURE_APPROVAL_WORKFLOW = "FEATURE_APPROVAL_WORKFLOW",
- FEATURE_AUDIT_LOG = "FEATURE_AUDIT_LOG",
- FEATURE_ENTERPRISE_SSO = "FEATURE_ENTERPRISE_SSO",
- FEATURE_TWO_FA = "FEATURE_TWO_FA",
- FEATURE_PASSWORD_RESTRICTIONS = "FEATURE_PASSWORD_RESTRICTIONS",
- FEATURE_DISALLOW_PASSWORD_SIGNIN = "FEATURE_DISALLOW_PASSWORD_SIGNIN",
- FEATURE_CUSTOM_ROLES = "FEATURE_CUSTOM_ROLES",
- FEATURE_REQUEST_ROLE_WORKFLOW = "FEATURE_REQUEST_ROLE_WORKFLOW",
- FEATURE_DATA_MASKING = "FEATURE_DATA_MASKING",
- FEATURE_DATA_CLASSIFICATION = "FEATURE_DATA_CLASSIFICATION",
- FEATURE_SCIM = "FEATURE_SCIM",
- FEATURE_DIRECTORY_SYNC = "FEATURE_DIRECTORY_SYNC",
- FEATURE_SIGN_IN_FREQUENCY_CONTROL = "FEATURE_SIGN_IN_FREQUENCY_CONTROL",
- FEATURE_EXTERNAL_SECRET_MANAGER = "FEATURE_EXTERNAL_SECRET_MANAGER",
- FEATURE_USER_EMAIL_DOMAIN_RESTRICTION = "FEATURE_USER_EMAIL_DOMAIN_RESTRICTION",
- /** FEATURE_PROJECT_MANAGEMENT - Administration & Support */
- FEATURE_PROJECT_MANAGEMENT = "FEATURE_PROJECT_MANAGEMENT",
- FEATURE_ENVIRONMENT_MANAGEMENT = "FEATURE_ENVIRONMENT_MANAGEMENT",
- FEATURE_IM_NOTIFICATIONS = "FEATURE_IM_NOTIFICATIONS",
- FEATURE_TERRAFORM_PROVIDER = "FEATURE_TERRAFORM_PROVIDER",
- FEATURE_DATABASE_GROUPS = "FEATURE_DATABASE_GROUPS",
- FEATURE_ENVIRONMENT_TIERS = "FEATURE_ENVIRONMENT_TIERS",
- FEATURE_DASHBOARD_ANNOUNCEMENT = "FEATURE_DASHBOARD_ANNOUNCEMENT",
- FEATURE_API_INTEGRATION_GUIDANCE = "FEATURE_API_INTEGRATION_GUIDANCE",
- FEATURE_CUSTOM_LOGO = "FEATURE_CUSTOM_LOGO",
- FEATURE_WATERMARK = "FEATURE_WATERMARK",
- FEATURE_ROADMAP_PRIORITIZATION = "FEATURE_ROADMAP_PRIORITIZATION",
- FEATURE_CUSTOM_MSA = "FEATURE_CUSTOM_MSA",
- FEATURE_COMMUNITY_SUPPORT = "FEATURE_COMMUNITY_SUPPORT",
- FEATURE_EMAIL_SUPPORT = "FEATURE_EMAIL_SUPPORT",
- FEATURE_DEDICATED_SUPPORT_WITH_SLA = "FEATURE_DEDICATED_SUPPORT_WITH_SLA",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function planFeatureFromJSON(object: any): PlanFeature {
- switch (object) {
- case 0:
- case "FEATURE_UNSPECIFIED":
- return PlanFeature.FEATURE_UNSPECIFIED;
- case 1:
- case "FEATURE_DATABASE_CHANGE":
- return PlanFeature.FEATURE_DATABASE_CHANGE;
- case 2:
- case "FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL":
- return PlanFeature.FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL;
- case 3:
- case "FEATURE_DECLARATIVE_SCHEMA_MIGRATION":
- return PlanFeature.FEATURE_DECLARATIVE_SCHEMA_MIGRATION;
- case 4:
- case "FEATURE_COMPARE_AND_SYNC_SCHEMA":
- return PlanFeature.FEATURE_COMPARE_AND_SYNC_SCHEMA;
- case 5:
- case "FEATURE_ONLINE_SCHEMA_CHANGE":
- return PlanFeature.FEATURE_ONLINE_SCHEMA_CHANGE;
- case 6:
- case "FEATURE_PRE_DEPLOYMENT_SQL_REVIEW":
- return PlanFeature.FEATURE_PRE_DEPLOYMENT_SQL_REVIEW;
- case 7:
- case "FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES":
- return PlanFeature.FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES;
- case 8:
- case "FEATURE_ONE_CLICK_DATA_ROLLBACK":
- return PlanFeature.FEATURE_ONE_CLICK_DATA_ROLLBACK;
- case 9:
- case "FEATURE_MULTI_DATABASE_BATCH_CHANGES":
- return PlanFeature.FEATURE_MULTI_DATABASE_BATCH_CHANGES;
- case 10:
- case "FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT":
- return PlanFeature.FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT;
- case 11:
- case "FEATURE_SCHEDULED_ROLLOUT_TIME":
- return PlanFeature.FEATURE_SCHEDULED_ROLLOUT_TIME;
- case 12:
- case "FEATURE_DATABASE_CHANGELOG":
- return PlanFeature.FEATURE_DATABASE_CHANGELOG;
- case 13:
- case "FEATURE_SCHEMA_DRIFT_DETECTION":
- return PlanFeature.FEATURE_SCHEMA_DRIFT_DETECTION;
- case 14:
- case "FEATURE_CHANGELIST":
- return PlanFeature.FEATURE_CHANGELIST;
- case 15:
- case "FEATURE_SCHEMA_TEMPLATE":
- return PlanFeature.FEATURE_SCHEMA_TEMPLATE;
- case 16:
- case "FEATURE_ROLLOUT_POLICY":
- return PlanFeature.FEATURE_ROLLOUT_POLICY;
- case 17:
- case "FEATURE_WEB_BASED_SQL_EDITOR":
- return PlanFeature.FEATURE_WEB_BASED_SQL_EDITOR;
- case 18:
- case "FEATURE_SQL_EDITOR_ADMIN_MODE":
- return PlanFeature.FEATURE_SQL_EDITOR_ADMIN_MODE;
- case 19:
- case "FEATURE_NATURAL_LANGUAGE_TO_SQL":
- return PlanFeature.FEATURE_NATURAL_LANGUAGE_TO_SQL;
- case 20:
- case "FEATURE_AI_QUERY_EXPLANATION":
- return PlanFeature.FEATURE_AI_QUERY_EXPLANATION;
- case 21:
- case "FEATURE_AI_QUERY_SUGGESTIONS":
- return PlanFeature.FEATURE_AI_QUERY_SUGGESTIONS;
- case 22:
- case "FEATURE_AUTO_COMPLETE":
- return PlanFeature.FEATURE_AUTO_COMPLETE;
- case 23:
- case "FEATURE_SCHEMA_DIAGRAM":
- return PlanFeature.FEATURE_SCHEMA_DIAGRAM;
- case 24:
- case "FEATURE_SCHEMA_EDITOR":
- return PlanFeature.FEATURE_SCHEMA_EDITOR;
- case 25:
- case "FEATURE_DATA_EXPORT":
- return PlanFeature.FEATURE_DATA_EXPORT;
- case 26:
- case "FEATURE_DATA_OFFLINE_EXPORT":
- return PlanFeature.FEATURE_DATA_OFFLINE_EXPORT;
- case 27:
- case "FEATURE_QUERY_HISTORY":
- return PlanFeature.FEATURE_QUERY_HISTORY;
- case 28:
- case "FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS":
- return PlanFeature.FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS;
- case 29:
- case "FEATURE_BATCH_QUERY":
- return PlanFeature.FEATURE_BATCH_QUERY;
- case 30:
- case "FEATURE_INSTANCE_READ_ONLY_CONNECTION":
- return PlanFeature.FEATURE_INSTANCE_READ_ONLY_CONNECTION;
- case 31:
- case "FEATURE_QUERY_POLICY":
- return PlanFeature.FEATURE_QUERY_POLICY;
- case 32:
- case "FEATURE_RESTRICT_COPYING_DATA":
- return PlanFeature.FEATURE_RESTRICT_COPYING_DATA;
- case 33:
- case "FEATURE_IAM":
- return PlanFeature.FEATURE_IAM;
- case 34:
- case "FEATURE_INSTANCE_SSL_CONNECTION":
- return PlanFeature.FEATURE_INSTANCE_SSL_CONNECTION;
- case 35:
- case "FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL":
- return PlanFeature.FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL;
- case 36:
- case "FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION":
- return PlanFeature.FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION;
- case 37:
- case "FEATURE_GOOGLE_AND_GITHUB_SSO":
- return PlanFeature.FEATURE_GOOGLE_AND_GITHUB_SSO;
- case 38:
- case "FEATURE_USER_GROUPS":
- return PlanFeature.FEATURE_USER_GROUPS;
- case 39:
- case "FEATURE_DISALLOW_SELF_SERVICE_SIGNUP":
- return PlanFeature.FEATURE_DISALLOW_SELF_SERVICE_SIGNUP;
- case 40:
- case "FEATURE_DATABASE_SECRET_VARIABLES":
- return PlanFeature.FEATURE_DATABASE_SECRET_VARIABLES;
- case 41:
- case "FEATURE_CUSTOM_INSTANCE_SYNC_TIME":
- return PlanFeature.FEATURE_CUSTOM_INSTANCE_SYNC_TIME;
- case 42:
- case "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT":
- return PlanFeature.FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT;
- case 43:
- case "FEATURE_RISK_ASSESSMENT":
- return PlanFeature.FEATURE_RISK_ASSESSMENT;
- case 44:
- case "FEATURE_APPROVAL_WORKFLOW":
- return PlanFeature.FEATURE_APPROVAL_WORKFLOW;
- case 45:
- case "FEATURE_AUDIT_LOG":
- return PlanFeature.FEATURE_AUDIT_LOG;
- case 46:
- case "FEATURE_ENTERPRISE_SSO":
- return PlanFeature.FEATURE_ENTERPRISE_SSO;
- case 47:
- case "FEATURE_TWO_FA":
- return PlanFeature.FEATURE_TWO_FA;
- case 48:
- case "FEATURE_PASSWORD_RESTRICTIONS":
- return PlanFeature.FEATURE_PASSWORD_RESTRICTIONS;
- case 49:
- case "FEATURE_DISALLOW_PASSWORD_SIGNIN":
- return PlanFeature.FEATURE_DISALLOW_PASSWORD_SIGNIN;
- case 50:
- case "FEATURE_CUSTOM_ROLES":
- return PlanFeature.FEATURE_CUSTOM_ROLES;
- case 51:
- case "FEATURE_REQUEST_ROLE_WORKFLOW":
- return PlanFeature.FEATURE_REQUEST_ROLE_WORKFLOW;
- case 52:
- case "FEATURE_DATA_MASKING":
- return PlanFeature.FEATURE_DATA_MASKING;
- case 53:
- case "FEATURE_DATA_CLASSIFICATION":
- return PlanFeature.FEATURE_DATA_CLASSIFICATION;
- case 54:
- case "FEATURE_SCIM":
- return PlanFeature.FEATURE_SCIM;
- case 55:
- case "FEATURE_DIRECTORY_SYNC":
- return PlanFeature.FEATURE_DIRECTORY_SYNC;
- case 56:
- case "FEATURE_SIGN_IN_FREQUENCY_CONTROL":
- return PlanFeature.FEATURE_SIGN_IN_FREQUENCY_CONTROL;
- case 57:
- case "FEATURE_EXTERNAL_SECRET_MANAGER":
- return PlanFeature.FEATURE_EXTERNAL_SECRET_MANAGER;
- case 58:
- case "FEATURE_USER_EMAIL_DOMAIN_RESTRICTION":
- return PlanFeature.FEATURE_USER_EMAIL_DOMAIN_RESTRICTION;
- case 59:
- case "FEATURE_PROJECT_MANAGEMENT":
- return PlanFeature.FEATURE_PROJECT_MANAGEMENT;
- case 60:
- case "FEATURE_ENVIRONMENT_MANAGEMENT":
- return PlanFeature.FEATURE_ENVIRONMENT_MANAGEMENT;
- case 61:
- case "FEATURE_IM_NOTIFICATIONS":
- return PlanFeature.FEATURE_IM_NOTIFICATIONS;
- case 62:
- case "FEATURE_TERRAFORM_PROVIDER":
- return PlanFeature.FEATURE_TERRAFORM_PROVIDER;
- case 63:
- case "FEATURE_DATABASE_GROUPS":
- return PlanFeature.FEATURE_DATABASE_GROUPS;
- case 64:
- case "FEATURE_ENVIRONMENT_TIERS":
- return PlanFeature.FEATURE_ENVIRONMENT_TIERS;
- case 65:
- case "FEATURE_DASHBOARD_ANNOUNCEMENT":
- return PlanFeature.FEATURE_DASHBOARD_ANNOUNCEMENT;
- case 66:
- case "FEATURE_API_INTEGRATION_GUIDANCE":
- return PlanFeature.FEATURE_API_INTEGRATION_GUIDANCE;
- case 67:
- case "FEATURE_CUSTOM_LOGO":
- return PlanFeature.FEATURE_CUSTOM_LOGO;
- case 68:
- case "FEATURE_WATERMARK":
- return PlanFeature.FEATURE_WATERMARK;
- case 69:
- case "FEATURE_ROADMAP_PRIORITIZATION":
- return PlanFeature.FEATURE_ROADMAP_PRIORITIZATION;
- case 70:
- case "FEATURE_CUSTOM_MSA":
- return PlanFeature.FEATURE_CUSTOM_MSA;
- case 71:
- case "FEATURE_COMMUNITY_SUPPORT":
- return PlanFeature.FEATURE_COMMUNITY_SUPPORT;
- case 72:
- case "FEATURE_EMAIL_SUPPORT":
- return PlanFeature.FEATURE_EMAIL_SUPPORT;
- case 73:
- case "FEATURE_DEDICATED_SUPPORT_WITH_SLA":
- return PlanFeature.FEATURE_DEDICATED_SUPPORT_WITH_SLA;
- case -1:
- case "UNRECOGNIZED":
- default:
- return PlanFeature.UNRECOGNIZED;
- }
-}
-
-export function planFeatureToJSON(object: PlanFeature): string {
- switch (object) {
- case PlanFeature.FEATURE_UNSPECIFIED:
- return "FEATURE_UNSPECIFIED";
- case PlanFeature.FEATURE_DATABASE_CHANGE:
- return "FEATURE_DATABASE_CHANGE";
- case PlanFeature.FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL:
- return "FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL";
- case PlanFeature.FEATURE_DECLARATIVE_SCHEMA_MIGRATION:
- return "FEATURE_DECLARATIVE_SCHEMA_MIGRATION";
- case PlanFeature.FEATURE_COMPARE_AND_SYNC_SCHEMA:
- return "FEATURE_COMPARE_AND_SYNC_SCHEMA";
- case PlanFeature.FEATURE_ONLINE_SCHEMA_CHANGE:
- return "FEATURE_ONLINE_SCHEMA_CHANGE";
- case PlanFeature.FEATURE_PRE_DEPLOYMENT_SQL_REVIEW:
- return "FEATURE_PRE_DEPLOYMENT_SQL_REVIEW";
- case PlanFeature.FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES:
- return "FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES";
- case PlanFeature.FEATURE_ONE_CLICK_DATA_ROLLBACK:
- return "FEATURE_ONE_CLICK_DATA_ROLLBACK";
- case PlanFeature.FEATURE_MULTI_DATABASE_BATCH_CHANGES:
- return "FEATURE_MULTI_DATABASE_BATCH_CHANGES";
- case PlanFeature.FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT:
- return "FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT";
- case PlanFeature.FEATURE_SCHEDULED_ROLLOUT_TIME:
- return "FEATURE_SCHEDULED_ROLLOUT_TIME";
- case PlanFeature.FEATURE_DATABASE_CHANGELOG:
- return "FEATURE_DATABASE_CHANGELOG";
- case PlanFeature.FEATURE_SCHEMA_DRIFT_DETECTION:
- return "FEATURE_SCHEMA_DRIFT_DETECTION";
- case PlanFeature.FEATURE_CHANGELIST:
- return "FEATURE_CHANGELIST";
- case PlanFeature.FEATURE_SCHEMA_TEMPLATE:
- return "FEATURE_SCHEMA_TEMPLATE";
- case PlanFeature.FEATURE_ROLLOUT_POLICY:
- return "FEATURE_ROLLOUT_POLICY";
- case PlanFeature.FEATURE_WEB_BASED_SQL_EDITOR:
- return "FEATURE_WEB_BASED_SQL_EDITOR";
- case PlanFeature.FEATURE_SQL_EDITOR_ADMIN_MODE:
- return "FEATURE_SQL_EDITOR_ADMIN_MODE";
- case PlanFeature.FEATURE_NATURAL_LANGUAGE_TO_SQL:
- return "FEATURE_NATURAL_LANGUAGE_TO_SQL";
- case PlanFeature.FEATURE_AI_QUERY_EXPLANATION:
- return "FEATURE_AI_QUERY_EXPLANATION";
- case PlanFeature.FEATURE_AI_QUERY_SUGGESTIONS:
- return "FEATURE_AI_QUERY_SUGGESTIONS";
- case PlanFeature.FEATURE_AUTO_COMPLETE:
- return "FEATURE_AUTO_COMPLETE";
- case PlanFeature.FEATURE_SCHEMA_DIAGRAM:
- return "FEATURE_SCHEMA_DIAGRAM";
- case PlanFeature.FEATURE_SCHEMA_EDITOR:
- return "FEATURE_SCHEMA_EDITOR";
- case PlanFeature.FEATURE_DATA_EXPORT:
- return "FEATURE_DATA_EXPORT";
- case PlanFeature.FEATURE_DATA_OFFLINE_EXPORT:
- return "FEATURE_DATA_OFFLINE_EXPORT";
- case PlanFeature.FEATURE_QUERY_HISTORY:
- return "FEATURE_QUERY_HISTORY";
- case PlanFeature.FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS:
- return "FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS";
- case PlanFeature.FEATURE_BATCH_QUERY:
- return "FEATURE_BATCH_QUERY";
- case PlanFeature.FEATURE_INSTANCE_READ_ONLY_CONNECTION:
- return "FEATURE_INSTANCE_READ_ONLY_CONNECTION";
- case PlanFeature.FEATURE_QUERY_POLICY:
- return "FEATURE_QUERY_POLICY";
- case PlanFeature.FEATURE_RESTRICT_COPYING_DATA:
- return "FEATURE_RESTRICT_COPYING_DATA";
- case PlanFeature.FEATURE_IAM:
- return "FEATURE_IAM";
- case PlanFeature.FEATURE_INSTANCE_SSL_CONNECTION:
- return "FEATURE_INSTANCE_SSL_CONNECTION";
- case PlanFeature.FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL:
- return "FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL";
- case PlanFeature.FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION:
- return "FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION";
- case PlanFeature.FEATURE_GOOGLE_AND_GITHUB_SSO:
- return "FEATURE_GOOGLE_AND_GITHUB_SSO";
- case PlanFeature.FEATURE_USER_GROUPS:
- return "FEATURE_USER_GROUPS";
- case PlanFeature.FEATURE_DISALLOW_SELF_SERVICE_SIGNUP:
- return "FEATURE_DISALLOW_SELF_SERVICE_SIGNUP";
- case PlanFeature.FEATURE_DATABASE_SECRET_VARIABLES:
- return "FEATURE_DATABASE_SECRET_VARIABLES";
- case PlanFeature.FEATURE_CUSTOM_INSTANCE_SYNC_TIME:
- return "FEATURE_CUSTOM_INSTANCE_SYNC_TIME";
- case PlanFeature.FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT:
- return "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT";
- case PlanFeature.FEATURE_RISK_ASSESSMENT:
- return "FEATURE_RISK_ASSESSMENT";
- case PlanFeature.FEATURE_APPROVAL_WORKFLOW:
- return "FEATURE_APPROVAL_WORKFLOW";
- case PlanFeature.FEATURE_AUDIT_LOG:
- return "FEATURE_AUDIT_LOG";
- case PlanFeature.FEATURE_ENTERPRISE_SSO:
- return "FEATURE_ENTERPRISE_SSO";
- case PlanFeature.FEATURE_TWO_FA:
- return "FEATURE_TWO_FA";
- case PlanFeature.FEATURE_PASSWORD_RESTRICTIONS:
- return "FEATURE_PASSWORD_RESTRICTIONS";
- case PlanFeature.FEATURE_DISALLOW_PASSWORD_SIGNIN:
- return "FEATURE_DISALLOW_PASSWORD_SIGNIN";
- case PlanFeature.FEATURE_CUSTOM_ROLES:
- return "FEATURE_CUSTOM_ROLES";
- case PlanFeature.FEATURE_REQUEST_ROLE_WORKFLOW:
- return "FEATURE_REQUEST_ROLE_WORKFLOW";
- case PlanFeature.FEATURE_DATA_MASKING:
- return "FEATURE_DATA_MASKING";
- case PlanFeature.FEATURE_DATA_CLASSIFICATION:
- return "FEATURE_DATA_CLASSIFICATION";
- case PlanFeature.FEATURE_SCIM:
- return "FEATURE_SCIM";
- case PlanFeature.FEATURE_DIRECTORY_SYNC:
- return "FEATURE_DIRECTORY_SYNC";
- case PlanFeature.FEATURE_SIGN_IN_FREQUENCY_CONTROL:
- return "FEATURE_SIGN_IN_FREQUENCY_CONTROL";
- case PlanFeature.FEATURE_EXTERNAL_SECRET_MANAGER:
- return "FEATURE_EXTERNAL_SECRET_MANAGER";
- case PlanFeature.FEATURE_USER_EMAIL_DOMAIN_RESTRICTION:
- return "FEATURE_USER_EMAIL_DOMAIN_RESTRICTION";
- case PlanFeature.FEATURE_PROJECT_MANAGEMENT:
- return "FEATURE_PROJECT_MANAGEMENT";
- case PlanFeature.FEATURE_ENVIRONMENT_MANAGEMENT:
- return "FEATURE_ENVIRONMENT_MANAGEMENT";
- case PlanFeature.FEATURE_IM_NOTIFICATIONS:
- return "FEATURE_IM_NOTIFICATIONS";
- case PlanFeature.FEATURE_TERRAFORM_PROVIDER:
- return "FEATURE_TERRAFORM_PROVIDER";
- case PlanFeature.FEATURE_DATABASE_GROUPS:
- return "FEATURE_DATABASE_GROUPS";
- case PlanFeature.FEATURE_ENVIRONMENT_TIERS:
- return "FEATURE_ENVIRONMENT_TIERS";
- case PlanFeature.FEATURE_DASHBOARD_ANNOUNCEMENT:
- return "FEATURE_DASHBOARD_ANNOUNCEMENT";
- case PlanFeature.FEATURE_API_INTEGRATION_GUIDANCE:
- return "FEATURE_API_INTEGRATION_GUIDANCE";
- case PlanFeature.FEATURE_CUSTOM_LOGO:
- return "FEATURE_CUSTOM_LOGO";
- case PlanFeature.FEATURE_WATERMARK:
- return "FEATURE_WATERMARK";
- case PlanFeature.FEATURE_ROADMAP_PRIORITIZATION:
- return "FEATURE_ROADMAP_PRIORITIZATION";
- case PlanFeature.FEATURE_CUSTOM_MSA:
- return "FEATURE_CUSTOM_MSA";
- case PlanFeature.FEATURE_COMMUNITY_SUPPORT:
- return "FEATURE_COMMUNITY_SUPPORT";
- case PlanFeature.FEATURE_EMAIL_SUPPORT:
- return "FEATURE_EMAIL_SUPPORT";
- case PlanFeature.FEATURE_DEDICATED_SUPPORT_WITH_SLA:
- return "FEATURE_DEDICATED_SUPPORT_WITH_SLA";
- case PlanFeature.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function planFeatureToNumber(object: PlanFeature): number {
- switch (object) {
- case PlanFeature.FEATURE_UNSPECIFIED:
- return 0;
- case PlanFeature.FEATURE_DATABASE_CHANGE:
- return 1;
- case PlanFeature.FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL:
- return 2;
- case PlanFeature.FEATURE_DECLARATIVE_SCHEMA_MIGRATION:
- return 3;
- case PlanFeature.FEATURE_COMPARE_AND_SYNC_SCHEMA:
- return 4;
- case PlanFeature.FEATURE_ONLINE_SCHEMA_CHANGE:
- return 5;
- case PlanFeature.FEATURE_PRE_DEPLOYMENT_SQL_REVIEW:
- return 6;
- case PlanFeature.FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES:
- return 7;
- case PlanFeature.FEATURE_ONE_CLICK_DATA_ROLLBACK:
- return 8;
- case PlanFeature.FEATURE_MULTI_DATABASE_BATCH_CHANGES:
- return 9;
- case PlanFeature.FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT:
- return 10;
- case PlanFeature.FEATURE_SCHEDULED_ROLLOUT_TIME:
- return 11;
- case PlanFeature.FEATURE_DATABASE_CHANGELOG:
- return 12;
- case PlanFeature.FEATURE_SCHEMA_DRIFT_DETECTION:
- return 13;
- case PlanFeature.FEATURE_CHANGELIST:
- return 14;
- case PlanFeature.FEATURE_SCHEMA_TEMPLATE:
- return 15;
- case PlanFeature.FEATURE_ROLLOUT_POLICY:
- return 16;
- case PlanFeature.FEATURE_WEB_BASED_SQL_EDITOR:
- return 17;
- case PlanFeature.FEATURE_SQL_EDITOR_ADMIN_MODE:
- return 18;
- case PlanFeature.FEATURE_NATURAL_LANGUAGE_TO_SQL:
- return 19;
- case PlanFeature.FEATURE_AI_QUERY_EXPLANATION:
- return 20;
- case PlanFeature.FEATURE_AI_QUERY_SUGGESTIONS:
- return 21;
- case PlanFeature.FEATURE_AUTO_COMPLETE:
- return 22;
- case PlanFeature.FEATURE_SCHEMA_DIAGRAM:
- return 23;
- case PlanFeature.FEATURE_SCHEMA_EDITOR:
- return 24;
- case PlanFeature.FEATURE_DATA_EXPORT:
- return 25;
- case PlanFeature.FEATURE_DATA_OFFLINE_EXPORT:
- return 26;
- case PlanFeature.FEATURE_QUERY_HISTORY:
- return 27;
- case PlanFeature.FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS:
- return 28;
- case PlanFeature.FEATURE_BATCH_QUERY:
- return 29;
- case PlanFeature.FEATURE_INSTANCE_READ_ONLY_CONNECTION:
- return 30;
- case PlanFeature.FEATURE_QUERY_POLICY:
- return 31;
- case PlanFeature.FEATURE_RESTRICT_COPYING_DATA:
- return 32;
- case PlanFeature.FEATURE_IAM:
- return 33;
- case PlanFeature.FEATURE_INSTANCE_SSL_CONNECTION:
- return 34;
- case PlanFeature.FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL:
- return 35;
- case PlanFeature.FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION:
- return 36;
- case PlanFeature.FEATURE_GOOGLE_AND_GITHUB_SSO:
- return 37;
- case PlanFeature.FEATURE_USER_GROUPS:
- return 38;
- case PlanFeature.FEATURE_DISALLOW_SELF_SERVICE_SIGNUP:
- return 39;
- case PlanFeature.FEATURE_DATABASE_SECRET_VARIABLES:
- return 40;
- case PlanFeature.FEATURE_CUSTOM_INSTANCE_SYNC_TIME:
- return 41;
- case PlanFeature.FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT:
- return 42;
- case PlanFeature.FEATURE_RISK_ASSESSMENT:
- return 43;
- case PlanFeature.FEATURE_APPROVAL_WORKFLOW:
- return 44;
- case PlanFeature.FEATURE_AUDIT_LOG:
- return 45;
- case PlanFeature.FEATURE_ENTERPRISE_SSO:
- return 46;
- case PlanFeature.FEATURE_TWO_FA:
- return 47;
- case PlanFeature.FEATURE_PASSWORD_RESTRICTIONS:
- return 48;
- case PlanFeature.FEATURE_DISALLOW_PASSWORD_SIGNIN:
- return 49;
- case PlanFeature.FEATURE_CUSTOM_ROLES:
- return 50;
- case PlanFeature.FEATURE_REQUEST_ROLE_WORKFLOW:
- return 51;
- case PlanFeature.FEATURE_DATA_MASKING:
- return 52;
- case PlanFeature.FEATURE_DATA_CLASSIFICATION:
- return 53;
- case PlanFeature.FEATURE_SCIM:
- return 54;
- case PlanFeature.FEATURE_DIRECTORY_SYNC:
- return 55;
- case PlanFeature.FEATURE_SIGN_IN_FREQUENCY_CONTROL:
- return 56;
- case PlanFeature.FEATURE_EXTERNAL_SECRET_MANAGER:
- return 57;
- case PlanFeature.FEATURE_USER_EMAIL_DOMAIN_RESTRICTION:
- return 58;
- case PlanFeature.FEATURE_PROJECT_MANAGEMENT:
- return 59;
- case PlanFeature.FEATURE_ENVIRONMENT_MANAGEMENT:
- return 60;
- case PlanFeature.FEATURE_IM_NOTIFICATIONS:
- return 61;
- case PlanFeature.FEATURE_TERRAFORM_PROVIDER:
- return 62;
- case PlanFeature.FEATURE_DATABASE_GROUPS:
- return 63;
- case PlanFeature.FEATURE_ENVIRONMENT_TIERS:
- return 64;
- case PlanFeature.FEATURE_DASHBOARD_ANNOUNCEMENT:
- return 65;
- case PlanFeature.FEATURE_API_INTEGRATION_GUIDANCE:
- return 66;
- case PlanFeature.FEATURE_CUSTOM_LOGO:
- return 67;
- case PlanFeature.FEATURE_WATERMARK:
- return 68;
- case PlanFeature.FEATURE_ROADMAP_PRIORITIZATION:
- return 69;
- case PlanFeature.FEATURE_CUSTOM_MSA:
- return 70;
- case PlanFeature.FEATURE_COMMUNITY_SUPPORT:
- return 71;
- case PlanFeature.FEATURE_EMAIL_SUPPORT:
- return 72;
- case PlanFeature.FEATURE_DEDICATED_SUPPORT_WITH_SLA:
- return 73;
- case PlanFeature.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface GetSubscriptionRequest {
-}
-
-export interface UpdateSubscriptionRequest {
- license: string;
-}
-
-export interface Subscription {
- plan: PlanType;
- seats: number;
- instances: number;
- activeInstances: number;
- expiresTime: Timestamp | undefined;
- trialing: boolean;
- orgName: string;
-}
-
-/** PlanConfig represents the configuration for all plans loaded from plan.yaml */
-export interface PlanConfig {
- plans: PlanLimitConfig[];
- instanceFeatures: PlanFeature[];
-}
-
-/** PlanLimitConfig represents a single plan's configuration */
-export interface PlanLimitConfig {
- type: PlanType;
- maximumInstanceCount: number;
- maximumSeatCount: number;
- features: PlanFeature[];
-}
-
-function createBaseGetSubscriptionRequest(): GetSubscriptionRequest {
- return {};
-}
-
-export const GetSubscriptionRequest: MessageFns<GetSubscriptionRequest> = {
- encode(_: GetSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetSubscriptionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetSubscriptionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): GetSubscriptionRequest {
- return {};
- },
-
- toJSON(_: GetSubscriptionRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<GetSubscriptionRequest>): GetSubscriptionRequest {
- return GetSubscriptionRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<GetSubscriptionRequest>): GetSubscriptionRequest {
- const message = createBaseGetSubscriptionRequest();
- return message;
- },
-};
-
-function createBaseUpdateSubscriptionRequest(): UpdateSubscriptionRequest {
- return { license: "" };
-}
-
-export const UpdateSubscriptionRequest: MessageFns<UpdateSubscriptionRequest> = {
- encode(message: UpdateSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.license !== "") {
- writer.uint32(10).string(message.license);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateSubscriptionRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateSubscriptionRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.license = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateSubscriptionRequest {
- return { license: isSet(object.license) ? globalThis.String(object.license) : "" };
- },
-
- toJSON(message: UpdateSubscriptionRequest): unknown {
- const obj: any = {};
- if (message.license !== "") {
- obj.license = message.license;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateSubscriptionRequest>): UpdateSubscriptionRequest {
- return UpdateSubscriptionRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateSubscriptionRequest>): UpdateSubscriptionRequest {
- const message = createBaseUpdateSubscriptionRequest();
- message.license = object.license ?? "";
- return message;
- },
-};
-
-function createBaseSubscription(): Subscription {
- return {
- plan: PlanType.PLAN_TYPE_UNSPECIFIED,
- seats: 0,
- instances: 0,
- activeInstances: 0,
- expiresTime: undefined,
- trialing: false,
- orgName: "",
- };
-}
-
-export const Subscription: MessageFns<Subscription> = {
- encode(message: Subscription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(planTypeToNumber(message.plan));
- }
- if (message.seats !== 0) {
- writer.uint32(16).int32(message.seats);
- }
- if (message.instances !== 0) {
- writer.uint32(24).int32(message.instances);
- }
- if (message.activeInstances !== 0) {
- writer.uint32(32).int32(message.activeInstances);
- }
- if (message.expiresTime !== undefined) {
- Timestamp.encode(message.expiresTime, writer.uint32(42).fork()).join();
- }
- if (message.trialing !== false) {
- writer.uint32(48).bool(message.trialing);
- }
- if (message.orgName !== "") {
- writer.uint32(58).string(message.orgName);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Subscription {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSubscription();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.plan = planTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.seats = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.instances = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.activeInstances = reader.int32();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.expiresTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 6: {
- if (tag !== 48) {
- break;
- }
-
- message.trialing = reader.bool();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.orgName = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Subscription {
- return {
- plan: isSet(object.plan) ? planTypeFromJSON(object.plan) : PlanType.PLAN_TYPE_UNSPECIFIED,
- seats: isSet(object.seats) ? globalThis.Number(object.seats) : 0,
- instances: isSet(object.instances) ? globalThis.Number(object.instances) : 0,
- activeInstances: isSet(object.activeInstances) ? globalThis.Number(object.activeInstances) : 0,
- expiresTime: isSet(object.expiresTime) ? fromJsonTimestamp(object.expiresTime) : undefined,
- trialing: isSet(object.trialing) ? globalThis.Boolean(object.trialing) : false,
- orgName: isSet(object.orgName) ? globalThis.String(object.orgName) : "",
- };
- },
-
- toJSON(message: Subscription): unknown {
- const obj: any = {};
- if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
- obj.plan = planTypeToJSON(message.plan);
- }
- if (message.seats !== 0) {
- obj.seats = Math.round(message.seats);
- }
- if (message.instances !== 0) {
- obj.instances = Math.round(message.instances);
- }
- if (message.activeInstances !== 0) {
- obj.activeInstances = Math.round(message.activeInstances);
- }
- if (message.expiresTime !== undefined) {
- obj.expiresTime = fromTimestamp(message.expiresTime).toISOString();
- }
- if (message.trialing !== false) {
- obj.trialing = message.trialing;
- }
- if (message.orgName !== "") {
- obj.orgName = message.orgName;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Subscription>): Subscription {
- return Subscription.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Subscription>): Subscription {
- const message = createBaseSubscription();
- message.plan = object.plan ?? PlanType.PLAN_TYPE_UNSPECIFIED;
- message.seats = object.seats ?? 0;
- message.instances = object.instances ?? 0;
- message.activeInstances = object.activeInstances ?? 0;
- message.expiresTime = (object.expiresTime !== undefined && object.expiresTime !== null)
- ? Timestamp.fromPartial(object.expiresTime)
- : undefined;
- message.trialing = object.trialing ?? false;
- message.orgName = object.orgName ?? "";
- return message;
- },
-};
-
-function createBasePlanConfig(): PlanConfig {
- return { plans: [], instanceFeatures: [] };
-}
-
-export const PlanConfig: MessageFns<PlanConfig> = {
- encode(message: PlanConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.plans) {
- PlanLimitConfig.encode(v!, writer.uint32(10).fork()).join();
- }
- writer.uint32(18).fork();
- for (const v of message.instanceFeatures) {
- writer.int32(planFeatureToNumber(v));
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.plans.push(PlanLimitConfig.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag === 16) {
- message.instanceFeatures.push(planFeatureFromJSON(reader.int32()));
-
- continue;
- }
-
- if (tag === 18) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.instanceFeatures.push(planFeatureFromJSON(reader.int32()));
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanConfig {
- return {
- plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => PlanLimitConfig.fromJSON(e)) : [],
- instanceFeatures: globalThis.Array.isArray(object?.instanceFeatures)
- ? object.instanceFeatures.map((e: any) => planFeatureFromJSON(e))
- : [],
- };
- },
-
- toJSON(message: PlanConfig): unknown {
- const obj: any = {};
- if (message.plans?.length) {
- obj.plans = message.plans.map((e) => PlanLimitConfig.toJSON(e));
- }
- if (message.instanceFeatures?.length) {
- obj.instanceFeatures = message.instanceFeatures.map((e) => planFeatureToJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanConfig>): PlanConfig {
- return PlanConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanConfig>): PlanConfig {
- const message = createBasePlanConfig();
- message.plans = object.plans?.map((e) => PlanLimitConfig.fromPartial(e)) || [];
- message.instanceFeatures = object.instanceFeatures?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBasePlanLimitConfig(): PlanLimitConfig {
- return { type: PlanType.PLAN_TYPE_UNSPECIFIED, maximumInstanceCount: 0, maximumSeatCount: 0, features: [] };
-}
-
-export const PlanLimitConfig: MessageFns<PlanLimitConfig> = {
- encode(message: PlanLimitConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.type !== PlanType.PLAN_TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(planTypeToNumber(message.type));
- }
- if (message.maximumInstanceCount !== 0) {
- writer.uint32(16).int32(message.maximumInstanceCount);
- }
- if (message.maximumSeatCount !== 0) {
- writer.uint32(24).int32(message.maximumSeatCount);
- }
- writer.uint32(34).fork();
- for (const v of message.features) {
- writer.int32(planFeatureToNumber(v));
- }
- writer.join();
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): PlanLimitConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanLimitConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.type = planTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.maximumInstanceCount = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.maximumSeatCount = reader.int32();
- continue;
- }
- case 4: {
- if (tag === 32) {
- message.features.push(planFeatureFromJSON(reader.int32()));
-
- continue;
- }
-
- if (tag === 34) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.features.push(planFeatureFromJSON(reader.int32()));
- }
-
- continue;
- }
-
- break;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): PlanLimitConfig {
- return {
- type: isSet(object.type) ? planTypeFromJSON(object.type) : PlanType.PLAN_TYPE_UNSPECIFIED,
- maximumInstanceCount: isSet(object.maximumInstanceCount) ? globalThis.Number(object.maximumInstanceCount) : 0,
- maximumSeatCount: isSet(object.maximumSeatCount) ? globalThis.Number(object.maximumSeatCount) : 0,
- features: globalThis.Array.isArray(object?.features)
- ? object.features.map((e: any) => planFeatureFromJSON(e))
- : [],
- };
- },
-
- toJSON(message: PlanLimitConfig): unknown {
- const obj: any = {};
- if (message.type !== PlanType.PLAN_TYPE_UNSPECIFIED) {
- obj.type = planTypeToJSON(message.type);
- }
- if (message.maximumInstanceCount !== 0) {
- obj.maximumInstanceCount = Math.round(message.maximumInstanceCount);
- }
- if (message.maximumSeatCount !== 0) {
- obj.maximumSeatCount = Math.round(message.maximumSeatCount);
- }
- if (message.features?.length) {
- obj.features = message.features.map((e) => planFeatureToJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<PlanLimitConfig>): PlanLimitConfig {
- return PlanLimitConfig.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<PlanLimitConfig>): PlanLimitConfig {
- const message = createBasePlanLimitConfig();
- message.type = object.type ?? PlanType.PLAN_TYPE_UNSPECIFIED;
- message.maximumInstanceCount = object.maximumInstanceCount ?? 0;
- message.maximumSeatCount = object.maximumSeatCount ?? 0;
- message.features = object.features?.map((e) => e) || [];
- return message;
- },
-};
-
-export type SubscriptionServiceDefinition = typeof SubscriptionServiceDefinition;
-export const SubscriptionServiceDefinition = {
- name: "SubscriptionService",
- fullName: "bytebase.v1.SubscriptionService",
- methods: {
- /**
- * GetSubscription returns the current subscription.
- * If there is no license, we will return a free plan subscription without expiration time.
- * If there is expired license, we will return a free plan subscription with the expiration time of the expired license.
- * Permissions required: None
- */
- getSubscription: {
- name: "GetSubscription",
- requestType: GetSubscriptionRequest,
- requestStream: false,
- responseType: Subscription,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800000: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([18, 18, 16, 47, 118, 49, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110]),
- ],
- },
- },
- },
- /** Permissions required: bb.settings.set */
- updateSubscription: {
- name: "UpdateSubscription",
- requestType: UpdateSubscriptionRequest,
- requestStream: false,
- responseType: Subscription,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([5, 112, 97, 116, 99, 104])],
- 800010: [new Uint8Array([15, 98, 98, 46, 115, 101, 116, 116, 105, 110, 103, 115, 46, 115, 101, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 27,
- 58,
- 7,
- 108,
- 105,
- 99,
- 101,
- 110,
- 115,
- 101,
- 50,
- 16,
- 47,
- 118,
- 49,
- 47,
- 115,
- 117,
- 98,
- 115,
- 99,
- 114,
- 105,
- 112,
- 116,
- 105,
- 111,
- 110,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/user_service.ts b/frontend/src/types/proto/v1/user_service.ts
deleted file mode 100644
index ffbef746c7..0000000000
--- a/frontend/src/types/proto/v1/user_service.ts
+++ /dev/null
@@ -1,1605 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/user_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
-
-export const protobufPackage = "bytebase.v1";
-
-export enum UserType {
- USER_TYPE_UNSPECIFIED = "USER_TYPE_UNSPECIFIED",
- USER = "USER",
- SYSTEM_BOT = "SYSTEM_BOT",
- SERVICE_ACCOUNT = "SERVICE_ACCOUNT",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function userTypeFromJSON(object: any): UserType {
- switch (object) {
- case 0:
- case "USER_TYPE_UNSPECIFIED":
- return UserType.USER_TYPE_UNSPECIFIED;
- case 1:
- case "USER":
- return UserType.USER;
- case 2:
- case "SYSTEM_BOT":
- return UserType.SYSTEM_BOT;
- case 3:
- case "SERVICE_ACCOUNT":
- return UserType.SERVICE_ACCOUNT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return UserType.UNRECOGNIZED;
- }
-}
-
-export function userTypeToJSON(object: UserType): string {
- switch (object) {
- case UserType.USER_TYPE_UNSPECIFIED:
- return "USER_TYPE_UNSPECIFIED";
- case UserType.USER:
- return "USER";
- case UserType.SYSTEM_BOT:
- return "SYSTEM_BOT";
- case UserType.SERVICE_ACCOUNT:
- return "SERVICE_ACCOUNT";
- case UserType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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.
- * Format: users/{user uid or user email}
- */
- name: string;
-}
-
-export interface BatchGetUsersRequest {
- /**
- * The user names to retrieve.
- * Format: users/{user uid or user email}
- */
- names: string[];
-}
-
-export interface BatchGetUsersResponse {
- /** The users from the specified request. */
- users: User[];
-}
-
-export interface ListUsersRequest {
- /**
- * The maximum number of users to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 users will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListUsers` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListUsers` must match
- * the call that provided the page token.
- */
- pageToken: string;
- /** Show deleted users if specified. */
- showDeleted: boolean;
- /**
- * Filter is used to filter users returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - name: the user name, support "==" and ".matches()" operator.
- * - email: the user email, support "==" and ".matches()" operator.
- * - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
- * - state: check State enum for values, support "==" operator.
- * - project: the project full name in "projects/{id}" format, support "==" operator.
- *
- * For example:
- * name == "ed"
- * name.matches("ed")
- * email == "[email protected]"
- * email.matches("ed")
- * user_type == "SERVICE_ACCOUNT"
- * user_type in ["SERVICE_ACCOUNT", "USER"]
- * !(user_type in ["SERVICE_ACCOUNT", "USER"])
- * state == "DELETED"
- * project == "projects/sample-project"
- * You can combine filter conditions like:
- * name.matches("ed") && project == "projects/sample-project"
- * (name == "ed" || email == "[email protected]") && project == "projects/sample-project"
- */
- filter: string;
-}
-
-export interface ListUsersResponse {
- /** The users from the specified request. */
- users: User[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface CreateUserRequest {
- /** The user to create. */
- user: User | undefined;
-}
-
-export interface UpdateUserRequest {
- /**
- * The user to update.
- *
- * The user's `name` field is used to identify the user to update.
- * Format: users/{user}
- */
- user:
- | User
- | undefined;
- /** The list of fields to update. */
- updateMask:
- | string[]
- | undefined;
- /** The otp_code is used to verify the user's identity by MFA. */
- otpCode?:
- | string
- | undefined;
- /**
- * The regenerate_temp_mfa_secret flag means to regenerate temporary MFA secret for user.
- * This is used for MFA setup. The temporary MFA secret and recovery codes will be returned in the response.
- */
- regenerateTempMfaSecret: boolean;
- /** The regenerate_recovery_codes flag means to regenerate recovery codes for user. */
- regenerateRecoveryCodes: boolean;
-}
-
-export interface DeleteUserRequest {
- /**
- * The name of the user to delete.
- * Format: users/{user}
- */
- name: string;
-}
-
-export interface UndeleteUserRequest {
- /**
- * The name of the deleted user.
- * Format: users/{user}
- */
- name: string;
-}
-
-export interface User {
- /**
- * The name of the user.
- * Format: users/{user}. {user} is a system-generated unique ID.
- */
- name: string;
- state: State;
- email: string;
- title: string;
- userType: UserType;
- password: string;
- serviceKey: string;
- /** The mfa_enabled flag means if the user has enabled MFA. */
- mfaEnabled: boolean;
- /** The mfa_secret is the temporary secret using in two phase verification. */
- mfaSecret: string;
- /** The recovery_codes is the temporary recovery codes using in two phase verification. */
- recoveryCodes: string[];
- /**
- * Should be a valid E.164 compliant phone number.
- * Could be empty.
- */
- phone: string;
- profile: User_Profile | undefined;
-}
-
-export interface User_Profile {
- lastLoginTime: Timestamp | undefined;
- lastChangePasswordTime:
- | Timestamp
- | undefined;
- /** source means where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID. */
- source: string;
-}
-
-function createBaseGetUserRequest(): GetUserRequest {
- return { name: "" };
-}
-
-export const GetUserRequest: MessageFns<GetUserRequest> = {
- encode(message: GetUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetUserRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetUserRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetUserRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetUserRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetUserRequest>): GetUserRequest {
- return GetUserRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetUserRequest>): GetUserRequest {
- const message = createBaseGetUserRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseBatchGetUsersRequest(): BatchGetUsersRequest {
- return { names: [] };
-}
-
-export const BatchGetUsersRequest: MessageFns<BatchGetUsersRequest> = {
- encode(message: BatchGetUsersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.names) {
- writer.uint32(10).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetUsersRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetUsersRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.names.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetUsersRequest {
- return { names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [] };
- },
-
- toJSON(message: BatchGetUsersRequest): unknown {
- const obj: any = {};
- if (message.names?.length) {
- obj.names = message.names;
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetUsersRequest>): BatchGetUsersRequest {
- return BatchGetUsersRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetUsersRequest>): BatchGetUsersRequest {
- const message = createBaseBatchGetUsersRequest();
- message.names = object.names?.map((e) => e) || [];
- return message;
- },
-};
-
-function createBaseBatchGetUsersResponse(): BatchGetUsersResponse {
- return { users: [] };
-}
-
-export const BatchGetUsersResponse: MessageFns<BatchGetUsersResponse> = {
- encode(message: BatchGetUsersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.users) {
- User.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): BatchGetUsersResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseBatchGetUsersResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.users.push(User.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): BatchGetUsersResponse {
- return { users: globalThis.Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [] };
- },
-
- toJSON(message: BatchGetUsersResponse): unknown {
- const obj: any = {};
- if (message.users?.length) {
- obj.users = message.users.map((e) => User.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<BatchGetUsersResponse>): BatchGetUsersResponse {
- return BatchGetUsersResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<BatchGetUsersResponse>): BatchGetUsersResponse {
- const message = createBaseBatchGetUsersResponse();
- message.users = object.users?.map((e) => User.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseListUsersRequest(): ListUsersRequest {
- return { pageSize: 0, pageToken: "", showDeleted: false, filter: "" };
-}
-
-export const ListUsersRequest: MessageFns<ListUsersRequest> = {
- encode(message: ListUsersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.pageSize !== 0) {
- writer.uint32(8).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(18).string(message.pageToken);
- }
- if (message.showDeleted !== false) {
- writer.uint32(24).bool(message.showDeleted);
- }
- if (message.filter !== "") {
- writer.uint32(34).string(message.filter);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListUsersRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListUsersRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.showDeleted = reader.bool();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListUsersRequest {
- return {
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListUsersRequest): unknown {
- const obj: any = {};
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.showDeleted !== false) {
- obj.showDeleted = message.showDeleted;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListUsersRequest>): ListUsersRequest {
- return ListUsersRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListUsersRequest>): ListUsersRequest {
- const message = createBaseListUsersRequest();
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.showDeleted = object.showDeleted ?? false;
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListUsersResponse(): ListUsersResponse {
- return { users: [], nextPageToken: "" };
-}
-
-export const ListUsersResponse: MessageFns<ListUsersResponse> = {
- encode(message: ListUsersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.users) {
- User.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListUsersResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListUsersResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.users.push(User.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListUsersResponse {
- return {
- users: globalThis.Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListUsersResponse): unknown {
- const obj: any = {};
- if (message.users?.length) {
- obj.users = message.users.map((e) => User.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListUsersResponse>): ListUsersResponse {
- return ListUsersResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListUsersResponse>): ListUsersResponse {
- const message = createBaseListUsersResponse();
- message.users = object.users?.map((e) => User.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseCreateUserRequest(): CreateUserRequest {
- return { user: undefined };
-}
-
-export const CreateUserRequest: MessageFns<CreateUserRequest> = {
- encode(message: CreateUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.user !== undefined) {
- User.encode(message.user, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateUserRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateUserRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.user = User.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateUserRequest {
- return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined };
- },
-
- toJSON(message: CreateUserRequest): unknown {
- const obj: any = {};
- if (message.user !== undefined) {
- obj.user = User.toJSON(message.user);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateUserRequest>): CreateUserRequest {
- return CreateUserRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateUserRequest>): CreateUserRequest {
- const message = createBaseCreateUserRequest();
- message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
- return message;
- },
-};
-
-function createBaseUpdateUserRequest(): UpdateUserRequest {
- return {
- user: undefined,
- updateMask: undefined,
- otpCode: undefined,
- regenerateTempMfaSecret: false,
- regenerateRecoveryCodes: false,
- };
-}
-
-export const UpdateUserRequest: MessageFns<UpdateUserRequest> = {
- encode(message: UpdateUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.user !== undefined) {
- User.encode(message.user, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- if (message.otpCode !== undefined) {
- writer.uint32(26).string(message.otpCode);
- }
- if (message.regenerateTempMfaSecret !== false) {
- writer.uint32(32).bool(message.regenerateTempMfaSecret);
- }
- if (message.regenerateRecoveryCodes !== false) {
- writer.uint32(40).bool(message.regenerateRecoveryCodes);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateUserRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateUserRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.user = User.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.otpCode = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 32) {
- break;
- }
-
- message.regenerateTempMfaSecret = reader.bool();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.regenerateRecoveryCodes = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateUserRequest {
- return {
- user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- otpCode: isSet(object.otpCode) ? globalThis.String(object.otpCode) : undefined,
- regenerateTempMfaSecret: isSet(object.regenerateTempMfaSecret)
- ? globalThis.Boolean(object.regenerateTempMfaSecret)
- : false,
- regenerateRecoveryCodes: isSet(object.regenerateRecoveryCodes)
- ? globalThis.Boolean(object.regenerateRecoveryCodes)
- : false,
- };
- },
-
- toJSON(message: UpdateUserRequest): unknown {
- const obj: any = {};
- if (message.user !== undefined) {
- obj.user = User.toJSON(message.user);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- if (message.otpCode !== undefined) {
- obj.otpCode = message.otpCode;
- }
- if (message.regenerateTempMfaSecret !== false) {
- obj.regenerateTempMfaSecret = message.regenerateTempMfaSecret;
- }
- if (message.regenerateRecoveryCodes !== false) {
- obj.regenerateRecoveryCodes = message.regenerateRecoveryCodes;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateUserRequest>): UpdateUserRequest {
- return UpdateUserRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateUserRequest>): UpdateUserRequest {
- const message = createBaseUpdateUserRequest();
- message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
- message.updateMask = object.updateMask ?? undefined;
- message.otpCode = object.otpCode ?? undefined;
- message.regenerateTempMfaSecret = object.regenerateTempMfaSecret ?? false;
- message.regenerateRecoveryCodes = object.regenerateRecoveryCodes ?? false;
- return message;
- },
-};
-
-function createBaseDeleteUserRequest(): DeleteUserRequest {
- return { name: "" };
-}
-
-export const DeleteUserRequest: MessageFns<DeleteUserRequest> = {
- encode(message: DeleteUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteUserRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteUserRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteUserRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteUserRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteUserRequest>): DeleteUserRequest {
- return DeleteUserRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteUserRequest>): DeleteUserRequest {
- const message = createBaseDeleteUserRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUndeleteUserRequest(): UndeleteUserRequest {
- return { name: "" };
-}
-
-export const UndeleteUserRequest: MessageFns<UndeleteUserRequest> = {
- encode(message: UndeleteUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UndeleteUserRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUndeleteUserRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UndeleteUserRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: UndeleteUserRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<UndeleteUserRequest>): UndeleteUserRequest {
- return UndeleteUserRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UndeleteUserRequest>): UndeleteUserRequest {
- const message = createBaseUndeleteUserRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUser(): User {
- return {
- name: "",
- state: State.STATE_UNSPECIFIED,
- email: "",
- title: "",
- userType: UserType.USER_TYPE_UNSPECIFIED,
- password: "",
- serviceKey: "",
- mfaEnabled: false,
- mfaSecret: "",
- recoveryCodes: [],
- phone: "",
- profile: undefined,
- };
-}
-
-export const User: MessageFns<User> = {
- encode(message: User, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- writer.uint32(16).int32(stateToNumber(message.state));
- }
- if (message.email !== "") {
- writer.uint32(26).string(message.email);
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
- writer.uint32(40).int32(userTypeToNumber(message.userType));
- }
- if (message.password !== "") {
- writer.uint32(58).string(message.password);
- }
- if (message.serviceKey !== "") {
- writer.uint32(66).string(message.serviceKey);
- }
- if (message.mfaEnabled !== false) {
- writer.uint32(72).bool(message.mfaEnabled);
- }
- if (message.mfaSecret !== "") {
- writer.uint32(82).string(message.mfaSecret);
- }
- for (const v of message.recoveryCodes) {
- writer.uint32(90).string(v!);
- }
- if (message.phone !== "") {
- writer.uint32(98).string(message.phone);
- }
- if (message.profile !== undefined) {
- User_Profile.encode(message.profile, writer.uint32(106).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): User {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUser();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.state = stateFromJSON(reader.int32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.email = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 40) {
- break;
- }
-
- message.userType = userTypeFromJSON(reader.int32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.password = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.serviceKey = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.mfaEnabled = reader.bool();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.mfaSecret = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
- break;
- }
-
- message.recoveryCodes.push(reader.string());
- continue;
- }
- case 12: {
- if (tag !== 98) {
- break;
- }
-
- message.phone = reader.string();
- continue;
- }
- case 13: {
- if (tag !== 106) {
- break;
- }
-
- message.profile = User_Profile.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): User {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
- email: isSet(object.email) ? globalThis.String(object.email) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- userType: isSet(object.userType) ? userTypeFromJSON(object.userType) : UserType.USER_TYPE_UNSPECIFIED,
- password: isSet(object.password) ? globalThis.String(object.password) : "",
- serviceKey: isSet(object.serviceKey) ? globalThis.String(object.serviceKey) : "",
- mfaEnabled: isSet(object.mfaEnabled) ? globalThis.Boolean(object.mfaEnabled) : false,
- mfaSecret: isSet(object.mfaSecret) ? globalThis.String(object.mfaSecret) : "",
- recoveryCodes: globalThis.Array.isArray(object?.recoveryCodes)
- ? object.recoveryCodes.map((e: any) => globalThis.String(e))
- : [],
- phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
- profile: isSet(object.profile) ? User_Profile.fromJSON(object.profile) : undefined,
- };
- },
-
- toJSON(message: User): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.state !== State.STATE_UNSPECIFIED) {
- obj.state = stateToJSON(message.state);
- }
- if (message.email !== "") {
- obj.email = message.email;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
- obj.userType = userTypeToJSON(message.userType);
- }
- if (message.password !== "") {
- obj.password = message.password;
- }
- if (message.serviceKey !== "") {
- obj.serviceKey = message.serviceKey;
- }
- if (message.mfaEnabled !== false) {
- obj.mfaEnabled = message.mfaEnabled;
- }
- if (message.mfaSecret !== "") {
- obj.mfaSecret = message.mfaSecret;
- }
- if (message.recoveryCodes?.length) {
- obj.recoveryCodes = message.recoveryCodes;
- }
- if (message.phone !== "") {
- obj.phone = message.phone;
- }
- if (message.profile !== undefined) {
- obj.profile = User_Profile.toJSON(message.profile);
- }
- return obj;
- },
-
- create(base?: DeepPartial<User>): User {
- return User.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<User>): User {
- const message = createBaseUser();
- message.name = object.name ?? "";
- message.state = object.state ?? State.STATE_UNSPECIFIED;
- message.email = object.email ?? "";
- message.title = object.title ?? "";
- message.userType = object.userType ?? UserType.USER_TYPE_UNSPECIFIED;
- message.password = object.password ?? "";
- message.serviceKey = object.serviceKey ?? "";
- message.mfaEnabled = object.mfaEnabled ?? false;
- message.mfaSecret = object.mfaSecret ?? "";
- message.recoveryCodes = object.recoveryCodes?.map((e) => e) || [];
- message.phone = object.phone ?? "";
- message.profile = (object.profile !== undefined && object.profile !== null)
- ? User_Profile.fromPartial(object.profile)
- : undefined;
- return message;
- },
-};
-
-function createBaseUser_Profile(): User_Profile {
- return { lastLoginTime: undefined, lastChangePasswordTime: undefined, source: "" };
-}
-
-export const User_Profile: MessageFns<User_Profile> = {
- encode(message: User_Profile, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.lastLoginTime !== undefined) {
- Timestamp.encode(message.lastLoginTime, writer.uint32(10).fork()).join();
- }
- if (message.lastChangePasswordTime !== undefined) {
- Timestamp.encode(message.lastChangePasswordTime, writer.uint32(18).fork()).join();
- }
- if (message.source !== "") {
- writer.uint32(26).string(message.source);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): User_Profile {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUser_Profile();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.lastLoginTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.lastChangePasswordTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.source = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): User_Profile {
- return {
- lastLoginTime: isSet(object.lastLoginTime) ? fromJsonTimestamp(object.lastLoginTime) : undefined,
- lastChangePasswordTime: isSet(object.lastChangePasswordTime)
- ? fromJsonTimestamp(object.lastChangePasswordTime)
- : undefined,
- source: isSet(object.source) ? globalThis.String(object.source) : "",
- };
- },
-
- toJSON(message: User_Profile): unknown {
- const obj: any = {};
- if (message.lastLoginTime !== undefined) {
- obj.lastLoginTime = fromTimestamp(message.lastLoginTime).toISOString();
- }
- if (message.lastChangePasswordTime !== undefined) {
- obj.lastChangePasswordTime = fromTimestamp(message.lastChangePasswordTime).toISOString();
- }
- if (message.source !== "") {
- obj.source = message.source;
- }
- return obj;
- },
-
- create(base?: DeepPartial<User_Profile>): User_Profile {
- return User_Profile.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<User_Profile>): User_Profile {
- const message = createBaseUser_Profile();
- message.lastLoginTime = (object.lastLoginTime !== undefined && object.lastLoginTime !== null)
- ? Timestamp.fromPartial(object.lastLoginTime)
- : undefined;
- message.lastChangePasswordTime =
- (object.lastChangePasswordTime !== undefined && object.lastChangePasswordTime !== null)
- ? Timestamp.fromPartial(object.lastChangePasswordTime)
- : undefined;
- message.source = object.source ?? "";
- return message;
- },
-};
-
-export type UserServiceDefinition = typeof UserServiceDefinition;
-export const UserServiceDefinition = {
- name: "UserService",
- fullName: "bytebase.v1.UserService",
- methods: {
- /**
- * Get the user.
- * Any authenticated user can get the user.
- * Permissions required: bb.users.get
- */
- getUser: {
- name: "GetUser",
- requestType: GetUserRequest,
- requestStream: false,
- responseType: User,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 20,
- 18,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 117,
- 115,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /**
- * Get the users in batch.
- * Any authenticated user can batch get users.
- * Permissions required: bb.users.get
- */
- batchGetUsers: {
- name: "BatchGetUsers",
- requestType: BatchGetUsersRequest,
- requestStream: false,
- responseType: BatchGetUsersResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 20,
- 18,
- 18,
- 47,
- 118,
- 49,
- 47,
- 117,
- 115,
- 101,
- 114,
- 115,
- 58,
- 98,
- 97,
- 116,
- 99,
- 104,
- 71,
- 101,
- 116,
- ]),
- ],
- },
- },
- },
- /**
- * Get the current authenticated user.
- * Permissions required: None
- */
- getCurrentUser: {
- name: "GetCurrentUser",
- requestType: Empty,
- requestStream: false,
- responseType: User,
- responseStream: false,
- options: {
- _unknownFields: {
- 800000: [new Uint8Array([1])],
- 800016: [new Uint8Array([2])],
- 578365826: [new Uint8Array([14, 18, 12, 47, 118, 49, 47, 117, 115, 101, 114, 115, 47, 109, 101])],
- },
- },
- },
- /**
- * List all users.
- * Any authenticated user can list users.
- * Permissions required: bb.users.list
- */
- listUsers: {
- name: "ListUsers",
- requestType: ListUsersRequest,
- requestStream: false,
- responseType: ListUsersResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [new Uint8Array([11, 18, 9, 47, 118, 49, 47, 117, 115, 101, 114, 115])],
- },
- },
- },
- /**
- * Create a user.
- * When Disallow Signup is enabled, only the caller with bb.users.create on the workspace can create a user.
- * Otherwise, any unauthenticated user can create a user.
- * Permissions required: bb.users.create
- */
- createUser: {
- name: "CreateUser",
- requestType: CreateUserRequest,
- requestStream: false,
- responseType: User,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 117, 115, 101, 114])],
- 800000: [new Uint8Array([1])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [new Uint8Array([17, 58, 4, 117, 115, 101, 114, 34, 9, 47, 118, 49, 47, 117, 115, 101, 114, 115])],
- },
- },
- },
- /**
- * Only the user itself and the user with bb.users.update permission on the workspace can update the user.
- * Permissions required: bb.users.update
- */
- updateUser: {
- name: "UpdateUser",
- requestType: UpdateUserRequest,
- requestStream: false,
- responseType: User,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([16, 117, 115, 101, 114, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 31,
- 58,
- 4,
- 117,
- 115,
- 101,
- 114,
- 50,
- 23,
- 47,
- 118,
- 49,
- 47,
- 123,
- 117,
- 115,
- 101,
- 114,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 117,
- 115,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /**
- * Only the user with bb.users.delete permission on the workspace can delete the user.
- * The last remaining workspace admin cannot be deleted.
- * Permissions required: bb.users.delete
- */
- deleteUser: {
- name: "DeleteUser",
- requestType: DeleteUserRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 20,
- 42,
- 18,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 117,
- 115,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /**
- * Only the user with bb.users.undelete permission on the workspace can undelete the user.
- * Permissions required: bb.users.undelete
- */
- undeleteUser: {
- name: "UndeleteUser",
- requestType: UndeleteUserRequest,
- requestStream: false,
- responseType: User,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 32,
- 58,
- 1,
- 42,
- 34,
- 27,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 117,
- 115,
- 101,
- 114,
- 115,
- 47,
- 42,
- 125,
- 58,
- 117,
- 110,
- 100,
- 101,
- 108,
- 101,
- 116,
- 101,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/worksheet_service.ts b/frontend/src/types/proto/v1/worksheet_service.ts
deleted file mode 100644
index 2bc14151e1..0000000000
--- a/frontend/src/types/proto/v1/worksheet_service.ts
+++ /dev/null
@@ -1,1538 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/worksheet_service.proto
-
-/* eslint-disable */
-import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
-import Long from "long";
-import { Empty } from "../google/protobuf/empty";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { Timestamp } from "../google/protobuf/timestamp";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface CreateWorksheetRequest {
- /** The worksheet to create. */
- worksheet: Worksheet | undefined;
-}
-
-export interface GetWorksheetRequest {
- /**
- * The name of the worksheet to retrieve.
- * Format: worksheets/{worksheet}
- */
- name: string;
-}
-
-export interface UpdateWorksheetRequest {
- /**
- * The worksheet to update.
- *
- * The worksheet's `name` field is used to identify the worksheet to update.
- * Format: worksheets/{worksheet}
- */
- worksheet:
- | Worksheet
- | undefined;
- /**
- * The list of fields to be updated.
- * Fields are specified relative to the worksheet.
- * (e.g. `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
- * Only support update the following fields for now:
- * - `title`
- * - `statement`
- * - `starred`
- * - `visibility`
- */
- updateMask: string[] | undefined;
-}
-
-export interface UpdateWorksheetOrganizerRequest {
- /**
- * The organizer to update.
- *
- * The organizer's `worksheet` field is used to identify the worksheet.
- * Format: worksheets/{worksheet}
- */
- organizer:
- | WorksheetOrganizer
- | undefined;
- /**
- * The list of fields to be updated.
- * Fields are specified relative to the worksheet organizer.
- * Only support update the following fields for now:
- * - `starred`
- */
- updateMask: string[] | undefined;
-}
-
-export interface WorksheetOrganizer {
- /**
- * The name of the worksheet.
- * Format: worksheets/{worksheet}
- */
- worksheet: string;
- /** starred means if the worksheet is starred. */
- starred: boolean;
-}
-
-export interface DeleteWorksheetRequest {
- /**
- * The name of the worksheet to delete.
- * Format: worksheets/{worksheet}
- */
- name: string;
-}
-
-export interface SearchWorksheetsRequest {
- /**
- * To filter the search result.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filter:
- * - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
- * - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
- * - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
- *
- * For example:
- * creator == "users/{email}"
- * creator != "users/{email}"
- * starred == true
- * starred == false
- * visibility in ["VISIBILITY_PRIVATE", "VISIBILITY_PROJECT_READ", "VISIBILITY_PROJECT_WRITE"]
- * visibility == "VISIBILITY_PRIVATE"
- */
- filter: string;
- /**
- * Not used.
- * The maximum number of worksheets to return. The service may return fewer than
- * this value.
- * If unspecified, at most 10 worksheets will be returned.
- * The maximum value is 1000; values above 1000 will be coerced to 1000.
- */
- pageSize: number;
- /**
- * Not used.
- * A page token, received from a previous `SearchWorksheets` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `SearchWorksheets` must match
- * the call that provided the page token.
- */
- pageToken: string;
-}
-
-export interface SearchWorksheetsResponse {
- /** The worksheets that matched the search criteria. */
- worksheets: Worksheet[];
- /**
- * Not used. A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
-export interface Worksheet {
- /**
- * The name of the worksheet resource, generated by the server.
- * Canonical parent is project.
- * Format: worksheets/{worksheet}
- */
- name: string;
- /**
- * The project resource name.
- * Format: projects/{project}
- */
- project: string;
- /**
- * The database resource name.
- * Format: instances/{instance}/databases/{database}
- * If the database parent doesn't exist, the database field is empty.
- */
- database: string;
- /** The title of the worksheet. */
- title: string;
- /**
- * The creator of the Worksheet.
- * Format: users/{email}
- */
- creator: string;
- /** The create time of the worksheet. */
- createTime:
- | Timestamp
- | undefined;
- /** The last update time of the worksheet. */
- updateTime:
- | Timestamp
- | undefined;
- /**
- * The content of the worksheet.
- * By default, it will be cut off in SearchWorksheet() method. If it doesn't match the `content_size`, you can
- * use GetWorksheet() request to retrieve the full content.
- */
- content: Uint8Array;
- /** content_size is the full size of the content, may not match the size of the `content` field. */
- contentSize: Long;
- visibility: Worksheet_Visibility;
- /** starred indicates whether the worksheet is starred by the current authenticated user. */
- starred: boolean;
-}
-
-export enum Worksheet_Visibility {
- 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 = "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 = "VISIBILITY_PROJECT_WRITE",
- /** VISIBILITY_PRIVATE - Private, only worksheet OWNER can read/write. */
- VISIBILITY_PRIVATE = "VISIBILITY_PRIVATE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function worksheet_VisibilityFromJSON(object: any): Worksheet_Visibility {
- switch (object) {
- case 0:
- case "VISIBILITY_UNSPECIFIED":
- return Worksheet_Visibility.VISIBILITY_UNSPECIFIED;
- case 1:
- case "VISIBILITY_PROJECT_READ":
- return Worksheet_Visibility.VISIBILITY_PROJECT_READ;
- case 2:
- case "VISIBILITY_PROJECT_WRITE":
- return Worksheet_Visibility.VISIBILITY_PROJECT_WRITE;
- case 3:
- case "VISIBILITY_PRIVATE":
- return Worksheet_Visibility.VISIBILITY_PRIVATE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Worksheet_Visibility.UNRECOGNIZED;
- }
-}
-
-export function worksheet_VisibilityToJSON(object: Worksheet_Visibility): string {
- switch (object) {
- case Worksheet_Visibility.VISIBILITY_UNSPECIFIED:
- return "VISIBILITY_UNSPECIFIED";
- case Worksheet_Visibility.VISIBILITY_PROJECT_READ:
- return "VISIBILITY_PROJECT_READ";
- case Worksheet_Visibility.VISIBILITY_PROJECT_WRITE:
- return "VISIBILITY_PROJECT_WRITE";
- case Worksheet_Visibility.VISIBILITY_PRIVATE:
- return "VISIBILITY_PRIVATE";
- case Worksheet_Visibility.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-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 };
-}
-
-export const CreateWorksheetRequest: MessageFns<CreateWorksheetRequest> = {
- encode(message: CreateWorksheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.worksheet !== undefined) {
- Worksheet.encode(message.worksheet, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): CreateWorksheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseCreateWorksheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.worksheet = Worksheet.decode(reader, reader.uint32());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): CreateWorksheetRequest {
- return { worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined };
- },
-
- toJSON(message: CreateWorksheetRequest): unknown {
- const obj: any = {};
- if (message.worksheet !== undefined) {
- obj.worksheet = Worksheet.toJSON(message.worksheet);
- }
- return obj;
- },
-
- create(base?: DeepPartial<CreateWorksheetRequest>): CreateWorksheetRequest {
- return CreateWorksheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<CreateWorksheetRequest>): CreateWorksheetRequest {
- const message = createBaseCreateWorksheetRequest();
- message.worksheet = (object.worksheet !== undefined && object.worksheet !== null)
- ? Worksheet.fromPartial(object.worksheet)
- : undefined;
- return message;
- },
-};
-
-function createBaseGetWorksheetRequest(): GetWorksheetRequest {
- return { name: "" };
-}
-
-export const GetWorksheetRequest: MessageFns<GetWorksheetRequest> = {
- encode(message: GetWorksheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): GetWorksheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetWorksheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): GetWorksheetRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: GetWorksheetRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<GetWorksheetRequest>): GetWorksheetRequest {
- return GetWorksheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<GetWorksheetRequest>): GetWorksheetRequest {
- const message = createBaseGetWorksheetRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseUpdateWorksheetRequest(): UpdateWorksheetRequest {
- return { worksheet: undefined, updateMask: undefined };
-}
-
-export const UpdateWorksheetRequest: MessageFns<UpdateWorksheetRequest> = {
- encode(message: UpdateWorksheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.worksheet !== undefined) {
- Worksheet.encode(message.worksheet, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateWorksheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateWorksheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.worksheet = Worksheet.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateWorksheetRequest {
- return {
- worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateWorksheetRequest): unknown {
- const obj: any = {};
- if (message.worksheet !== undefined) {
- obj.worksheet = Worksheet.toJSON(message.worksheet);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateWorksheetRequest>): UpdateWorksheetRequest {
- return UpdateWorksheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateWorksheetRequest>): UpdateWorksheetRequest {
- const message = createBaseUpdateWorksheetRequest();
- message.worksheet = (object.worksheet !== undefined && object.worksheet !== null)
- ? Worksheet.fromPartial(object.worksheet)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseUpdateWorksheetOrganizerRequest(): UpdateWorksheetOrganizerRequest {
- return { organizer: undefined, updateMask: undefined };
-}
-
-export const UpdateWorksheetOrganizerRequest: MessageFns<UpdateWorksheetOrganizerRequest> = {
- encode(message: UpdateWorksheetOrganizerRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.organizer !== undefined) {
- WorksheetOrganizer.encode(message.organizer, writer.uint32(10).fork()).join();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateWorksheetOrganizerRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateWorksheetOrganizerRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.organizer = WorksheetOrganizer.decode(reader, reader.uint32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateWorksheetOrganizerRequest {
- return {
- organizer: isSet(object.organizer) ? WorksheetOrganizer.fromJSON(object.organizer) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateWorksheetOrganizerRequest): unknown {
- const obj: any = {};
- if (message.organizer !== undefined) {
- obj.organizer = WorksheetOrganizer.toJSON(message.organizer);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateWorksheetOrganizerRequest>): UpdateWorksheetOrganizerRequest {
- return UpdateWorksheetOrganizerRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateWorksheetOrganizerRequest>): UpdateWorksheetOrganizerRequest {
- const message = createBaseUpdateWorksheetOrganizerRequest();
- message.organizer = (object.organizer !== undefined && object.organizer !== null)
- ? WorksheetOrganizer.fromPartial(object.organizer)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseWorksheetOrganizer(): WorksheetOrganizer {
- return { worksheet: "", starred: false };
-}
-
-export const WorksheetOrganizer: MessageFns<WorksheetOrganizer> = {
- encode(message: WorksheetOrganizer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.worksheet !== "") {
- writer.uint32(10).string(message.worksheet);
- }
- if (message.starred !== false) {
- writer.uint32(16).bool(message.starred);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): WorksheetOrganizer {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWorksheetOrganizer();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.worksheet = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.starred = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): WorksheetOrganizer {
- return {
- worksheet: isSet(object.worksheet) ? globalThis.String(object.worksheet) : "",
- starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
- };
- },
-
- toJSON(message: WorksheetOrganizer): unknown {
- const obj: any = {};
- if (message.worksheet !== "") {
- obj.worksheet = message.worksheet;
- }
- if (message.starred !== false) {
- obj.starred = message.starred;
- }
- return obj;
- },
-
- create(base?: DeepPartial<WorksheetOrganizer>): WorksheetOrganizer {
- return WorksheetOrganizer.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<WorksheetOrganizer>): WorksheetOrganizer {
- const message = createBaseWorksheetOrganizer();
- message.worksheet = object.worksheet ?? "";
- message.starred = object.starred ?? false;
- return message;
- },
-};
-
-function createBaseDeleteWorksheetRequest(): DeleteWorksheetRequest {
- return { name: "" };
-}
-
-export const DeleteWorksheetRequest: MessageFns<DeleteWorksheetRequest> = {
- encode(message: DeleteWorksheetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteWorksheetRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDeleteWorksheetRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DeleteWorksheetRequest {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
- },
-
- toJSON(message: DeleteWorksheetRequest): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DeleteWorksheetRequest>): DeleteWorksheetRequest {
- return DeleteWorksheetRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DeleteWorksheetRequest>): DeleteWorksheetRequest {
- const message = createBaseDeleteWorksheetRequest();
- message.name = object.name ?? "";
- return message;
- },
-};
-
-function createBaseSearchWorksheetsRequest(): SearchWorksheetsRequest {
- return { filter: "", pageSize: 0, pageToken: "" };
-}
-
-export const SearchWorksheetsRequest: MessageFns<SearchWorksheetsRequest> = {
- encode(message: SearchWorksheetsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.filter !== "") {
- writer.uint32(10).string(message.filter);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchWorksheetsRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchWorksheetsRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchWorksheetsRequest {
- return {
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: SearchWorksheetsRequest): unknown {
- const obj: any = {};
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchWorksheetsRequest>): SearchWorksheetsRequest {
- return SearchWorksheetsRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchWorksheetsRequest>): SearchWorksheetsRequest {
- const message = createBaseSearchWorksheetsRequest();
- message.filter = object.filter ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseSearchWorksheetsResponse(): SearchWorksheetsResponse {
- return { worksheets: [], nextPageToken: "" };
-}
-
-export const SearchWorksheetsResponse: MessageFns<SearchWorksheetsResponse> = {
- encode(message: SearchWorksheetsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.worksheets) {
- Worksheet.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): SearchWorksheetsResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSearchWorksheetsResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.worksheets.push(Worksheet.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): SearchWorksheetsResponse {
- return {
- worksheets: globalThis.Array.isArray(object?.worksheets)
- ? object.worksheets.map((e: any) => Worksheet.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: SearchWorksheetsResponse): unknown {
- const obj: any = {};
- if (message.worksheets?.length) {
- obj.worksheets = message.worksheets.map((e) => Worksheet.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<SearchWorksheetsResponse>): SearchWorksheetsResponse {
- return SearchWorksheetsResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<SearchWorksheetsResponse>): SearchWorksheetsResponse {
- const message = createBaseSearchWorksheetsResponse();
- message.worksheets = object.worksheets?.map((e) => Worksheet.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseWorksheet(): Worksheet {
- return {
- name: "",
- project: "",
- database: "",
- title: "",
- creator: "",
- createTime: undefined,
- updateTime: undefined,
- content: new Uint8Array(0),
- contentSize: Long.ZERO,
- visibility: Worksheet_Visibility.VISIBILITY_UNSPECIFIED,
- starred: false,
- };
-}
-
-export const Worksheet: MessageFns<Worksheet> = {
- encode(message: Worksheet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.project !== "") {
- writer.uint32(18).string(message.project);
- }
- if (message.database !== "") {
- writer.uint32(26).string(message.database);
- }
- if (message.title !== "") {
- writer.uint32(34).string(message.title);
- }
- if (message.creator !== "") {
- writer.uint32(42).string(message.creator);
- }
- if (message.createTime !== undefined) {
- Timestamp.encode(message.createTime, writer.uint32(50).fork()).join();
- }
- if (message.updateTime !== undefined) {
- Timestamp.encode(message.updateTime, writer.uint32(58).fork()).join();
- }
- if (message.content.length !== 0) {
- writer.uint32(66).bytes(message.content);
- }
- if (!message.contentSize.equals(Long.ZERO)) {
- writer.uint32(72).int64(message.contentSize.toString());
- }
- if (message.visibility !== Worksheet_Visibility.VISIBILITY_UNSPECIFIED) {
- writer.uint32(80).int32(worksheet_VisibilityToNumber(message.visibility));
- }
- if (message.starred !== false) {
- writer.uint32(88).bool(message.starred);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Worksheet {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseWorksheet();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.name = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.project = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.database = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.title = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.creator = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.createTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.updateTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.content = reader.bytes();
- continue;
- }
- case 9: {
- if (tag !== 72) {
- break;
- }
-
- message.contentSize = Long.fromString(reader.int64().toString());
- continue;
- }
- case 10: {
- if (tag !== 80) {
- break;
- }
-
- message.visibility = worksheet_VisibilityFromJSON(reader.int32());
- continue;
- }
- case 11: {
- if (tag !== 88) {
- break;
- }
-
- message.starred = reader.bool();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Worksheet {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- project: isSet(object.project) ? globalThis.String(object.project) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
- title: isSet(object.title) ? globalThis.String(object.title) : "",
- creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
- createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
- updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
- contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
- visibility: isSet(object.visibility)
- ? worksheet_VisibilityFromJSON(object.visibility)
- : Worksheet_Visibility.VISIBILITY_UNSPECIFIED,
- starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
- };
- },
-
- toJSON(message: Worksheet): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.project !== "") {
- obj.project = message.project;
- }
- if (message.database !== "") {
- obj.database = message.database;
- }
- if (message.title !== "") {
- obj.title = message.title;
- }
- if (message.creator !== "") {
- obj.creator = message.creator;
- }
- if (message.createTime !== undefined) {
- obj.createTime = fromTimestamp(message.createTime).toISOString();
- }
- if (message.updateTime !== undefined) {
- obj.updateTime = fromTimestamp(message.updateTime).toISOString();
- }
- if (message.content.length !== 0) {
- obj.content = base64FromBytes(message.content);
- }
- if (!message.contentSize.equals(Long.ZERO)) {
- obj.contentSize = (message.contentSize || Long.ZERO).toString();
- }
- if (message.visibility !== Worksheet_Visibility.VISIBILITY_UNSPECIFIED) {
- obj.visibility = worksheet_VisibilityToJSON(message.visibility);
- }
- if (message.starred !== false) {
- obj.starred = message.starred;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Worksheet>): Worksheet {
- return Worksheet.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Worksheet>): Worksheet {
- const message = createBaseWorksheet();
- message.name = object.name ?? "";
- message.project = object.project ?? "";
- message.database = object.database ?? "";
- message.title = object.title ?? "";
- message.creator = object.creator ?? "";
- message.createTime = (object.createTime !== undefined && object.createTime !== null)
- ? Timestamp.fromPartial(object.createTime)
- : undefined;
- message.updateTime = (object.updateTime !== undefined && object.updateTime !== null)
- ? Timestamp.fromPartial(object.updateTime)
- : undefined;
- message.content = object.content ?? new Uint8Array(0);
- message.contentSize = (object.contentSize !== undefined && object.contentSize !== null)
- ? Long.fromValue(object.contentSize)
- : Long.ZERO;
- message.visibility = object.visibility ?? Worksheet_Visibility.VISIBILITY_UNSPECIFIED;
- message.starred = object.starred ?? false;
- return message;
- },
-};
-
-export type WorksheetServiceDefinition = typeof WorksheetServiceDefinition;
-export const WorksheetServiceDefinition = {
- name: "WorksheetService",
- fullName: "bytebase.v1.WorksheetService",
- methods: {
- /**
- * Create a personal worksheet used in SQL Editor.
- * Permissions required: None
- */
- createWorksheet: {
- name: "CreateWorksheet",
- requestType: CreateWorksheetRequest,
- requestStream: false,
- responseType: Worksheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([16, 112, 97, 114, 101, 110, 116, 44, 119, 111, 114, 107, 115, 104, 101, 101, 116])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 27,
- 58,
- 9,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 34,
- 14,
- 47,
- 118,
- 49,
- 47,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- ]),
- ],
- },
- },
- },
- /**
- * Get a worksheet by name.
- * The users can access this method if,
- * - they are the creator of the worksheet;
- * - they have bb.worksheets.get permission on the workspace;
- * - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
- * Permissions required: None
- */
- getWorksheet: {
- name: "GetWorksheet",
- requestType: GetWorksheetRequest,
- requestStream: false,
- responseType: Worksheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 25,
- 18,
- 23,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /**
- * Search for worksheets.
- * This is used for finding my worksheets or worksheets shared by other people.
- * The sheet accessibility is the same as GetWorksheet().
- * Permissions required: None
- */
- searchWorksheets: {
- name: "SearchWorksheets",
- requestType: SearchWorksheetsRequest,
- requestStream: false,
- responseType: SearchWorksheetsResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 26,
- 58,
- 1,
- 42,
- 34,
- 21,
- 47,
- 118,
- 49,
- 47,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 58,
- 115,
- 101,
- 97,
- 114,
- 99,
- 104,
- ]),
- ],
- },
- },
- },
- /**
- * Update a worksheet.
- * The users can access this method if,
- * - they are the creator of the worksheet;
- * - they have bb.worksheets.manage permission on the workspace;
- * - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
- * Permissions required: None
- */
- updateWorksheet: {
- name: "UpdateWorksheet",
- requestType: UpdateWorksheetRequest,
- requestStream: false,
- responseType: Worksheet,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 21,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 46,
- 58,
- 9,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 50,
- 33,
- 47,
- 118,
- 49,
- 47,
- 123,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- /**
- * Update the organizer of a worksheet.
- * The access is the same as UpdateWorksheet method.
- * Permissions required: None
- */
- updateWorksheetOrganizer: {
- name: "UpdateWorksheetOrganizer",
- requestType: UpdateWorksheetOrganizerRequest,
- requestStream: false,
- responseType: WorksheetOrganizer,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 21,
- 111,
- 114,
- 103,
- 97,
- 110,
- 105,
- 122,
- 101,
- 114,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 61,
- 58,
- 9,
- 111,
- 114,
- 103,
- 97,
- 110,
- 105,
- 122,
- 101,
- 114,
- 50,
- 48,
- 47,
- 118,
- 49,
- 47,
- 123,
- 111,
- 114,
- 103,
- 97,
- 110,
- 105,
- 122,
- 101,
- 114,
- 46,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- 47,
- 111,
- 114,
- 103,
- 97,
- 110,
- 105,
- 122,
- 101,
- 114,
- ]),
- ],
- },
- },
- },
- /**
- * Delete a worksheet.
- * The access is the same as UpdateWorksheet method.
- * Permissions required: None
- */
- deleteWorksheet: {
- name: "DeleteWorksheet",
- requestType: DeleteWorksheetRequest,
- requestStream: false,
- responseType: Empty,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([4, 110, 97, 109, 101])],
- 800016: [new Uint8Array([2])],
- 578365826: [
- new Uint8Array([
- 25,
- 42,
- 23,
- 47,
- 118,
- 49,
- 47,
- 123,
- 110,
- 97,
- 109,
- 101,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 104,
- 101,
- 101,
- 116,
- 115,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} as const;
-
-function bytesFromBase64(b64: string): Uint8Array {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
-}
-
-type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
-
-export type DeepPartial<T> = T extends Builtin ? T
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
- : Partial<T>;
-
-function toTimestamp(date: Date): Timestamp {
- const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
- const nanos = (date.getTime() % 1_000) * 1_000_000;
- return { seconds, nanos };
-}
-
-function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds.toNumber() || 0) * 1_000;
- millis += (t.nanos || 0) / 1_000_000;
- return new globalThis.Date(millis);
-}
-
-function fromJsonTimestamp(o: any): Timestamp {
- if (o instanceof globalThis.Date) {
- return toTimestamp(o);
- } else if (typeof o === "string") {
- return toTimestamp(new globalThis.Date(o));
- } else {
- return Timestamp.fromJSON(o);
- }
-}
-
-function numberToLong(number: number) {
- return Long.fromNumber(number);
-}
-
-function isSet(value: any): boolean {
- return value !== null && value !== undefined;
-}
-
-export interface MessageFns<T> {
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
- decode(input: BinaryReader | Uint8Array, length?: number): T;
- fromJSON(object: any): T;
- toJSON(message: T): unknown;
- create(base?: DeepPartial<T>): T;
- fromPartial(object: DeepPartial<T>): T;
-}
diff --git a/frontend/src/types/proto/v1/workspace_service.ts b/frontend/src/types/proto/v1/workspace_service.ts
deleted file mode 100644
index dca94dd192..0000000000
--- a/frontend/src/types/proto/v1/workspace_service.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
-// versions:
-// protoc-gen-ts_proto v2.3.0
-// protoc unknown
-// source: v1/workspace_service.proto
-
-/* eslint-disable */
-import { GetIamPolicyRequest, IamPolicy, SetIamPolicyRequest } from "./iam_policy";
-
-export const protobufPackage = "bytebase.v1";
-
-export type WorkspaceServiceDefinition = typeof WorkspaceServiceDefinition;
-export const WorkspaceServiceDefinition = {
- name: "WorkspaceService",
- fullName: "bytebase.v1.WorkspaceService",
- methods: {
- /** Permissions required: bb.workspaces.getIamPolicy */
- getIamPolicy: {
- name: "GetIamPolicy",
- requestType: GetIamPolicyRequest,
- requestStream: false,
- responseType: IamPolicy,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 26,
- 98,
- 98,
- 46,
- 119,
- 111,
- 114,
- 107,
- 115,
- 112,
- 97,
- 99,
- 101,
- 115,
- 46,
- 103,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 42,
- 18,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 115,
- 111,
- 117,
- 114,
- 99,
- 101,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 112,
- 97,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 103,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- },
- },
- },
- /** Permissions required: bb.workspaces.setIamPolicy */
- setIamPolicy: {
- name: "SetIamPolicy",
- requestType: SetIamPolicyRequest,
- requestStream: false,
- responseType: IamPolicy,
- responseStream: false,
- options: {
- _unknownFields: {
- 800010: [
- new Uint8Array([
- 26,
- 98,
- 98,
- 46,
- 119,
- 111,
- 114,
- 107,
- 115,
- 112,
- 97,
- 99,
- 101,
- 115,
- 46,
- 115,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- 800016: [new Uint8Array([1])],
- 800024: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 45,
- 58,
- 1,
- 42,
- 34,
- 40,
- 47,
- 118,
- 49,
- 47,
- 123,
- 114,
- 101,
- 115,
- 111,
- 117,
- 114,
- 99,
- 101,
- 61,
- 119,
- 111,
- 114,
- 107,
- 115,
- 112,
- 97,
- 99,
- 101,
- 115,
- 47,
- 42,
- 125,
- 58,
- 115,
- 101,
- 116,
- 73,
- 97,
- 109,
- 80,
- 111,
- 108,
- 105,
- 99,
- 121,
- ]),
- ],
- },
- },
- },
- },
-} as const;
diff --git a/frontend/src/types/timestamp.ts b/frontend/src/types/timestamp.ts
index 3e535014fc..43500408ef 100644
--- a/frontend/src/types/timestamp.ts
+++ b/frontend/src/types/timestamp.ts
@@ -1,24 +1,5 @@
-import { Timestamp } from "./proto/google/protobuf/timestamp";
import type { Timestamp as TimestampProtoEs } from "@bufbuild/protobuf/wkt";
-export const getTimeForPbTimestamp = (
- timestamp?: Timestamp,
- defaultValue = Date.now()
-): number => {
- if (!timestamp) {
- return defaultValue;
- }
- return timestamp.seconds.toNumber() * 1000 + timestamp.nanos / 1000000;
-};
-
-export const getDateForPbTimestamp = (
- timestamp?: Timestamp
-): Date | undefined => {
- if (!timestamp) {
- return undefined;
- }
- return new Date(getTimeForPbTimestamp(timestamp));
-};
// Helper functions for proto-es timestamps (which use bigint for seconds)
export const getTimeForPbTimestampProtoEs = (
diff --git a/frontend/src/utils/v1/audit-log-conversions.ts b/frontend/src/utils/v1/audit-log-conversions.ts
deleted file mode 100644
index ea9d92c304..0000000000
--- a/frontend/src/utils/v1/audit-log-conversions.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { AuditLog_Severity } from "@/types/proto-es/v1/audit_log_service_pb";
-
-/**
- * Converts AuditLog_Severity enum value to its string representation
- * @param severity - The severity enum value
- * @returns The string name of the severity level (e.g., "INFO", "ERROR", "WARNING")
- */
-export function severityToString(severity: AuditLog_Severity): string {
- return AuditLog_Severity[severity];
-}
\ No newline at end of file
diff --git a/frontend/src/utils/v1/cel-conversions.ts b/frontend/src/utils/v1/cel-conversions.ts
deleted file mode 100644
index af9df7f18d..0000000000
--- a/frontend/src/utils/v1/cel-conversions.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import { Expr as OldExpr } from "@/types/proto/google/api/expr/v1alpha1/syntax";
-import type { Expr as NewExpr } from "@/types/proto-es/google/api/expr/v1alpha1/syntax_pb";
-import { ExprSchema } from "@/types/proto-es/google/api/expr/v1alpha1/syntax_pb";
-
-// Convert old proto to proto-es
-export const convertOldExprToNew = (oldExpr: OldExpr): NewExpr => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldExpr.toJSON(oldExpr) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(ExprSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewExprToOld = (newExpr: NewExpr): OldExpr => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(ExprSchema, newExpr);
- return OldExpr.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/changelist-conversions.ts b/frontend/src/utils/v1/changelist-conversions.ts
deleted file mode 100644
index 7b7a011d7e..0000000000
--- a/frontend/src/utils/v1/changelist-conversions.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Changelist as OldChangelist } from "@/types/proto/v1/changelist_service";
-import { Changelist as OldChangelistProto } from "@/types/proto/v1/changelist_service";
-import type { Changelist as NewChangelist } from "@/types/proto-es/v1/changelist_service_pb";
-import { ChangelistSchema } from "@/types/proto-es/v1/changelist_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldChangelistToNew = (oldChangelist: OldChangelist): NewChangelist => {
- const json = OldChangelistProto.toJSON(oldChangelist) as any;
- return fromJson(ChangelistSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewChangelistToOld = (newChangelist: NewChangelist): OldChangelist => {
- const json = toJson(ChangelistSchema, newChangelist);
- return OldChangelistProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/common-conversions.ts b/frontend/src/utils/v1/common-conversions.ts
index 58e68086df..76570b7007 100644
--- a/frontend/src/utils/v1/common-conversions.ts
+++ b/frontend/src/utils/v1/common-conversions.ts
@@ -1,311 +1,15 @@
/**
* Common type conversions between old proto and proto-es for common types.
- *
+ *
* This file provides conversion functions for types in common.proto that are shared
* across multiple services during the migration from old proto to proto-es.
*/
-
-// Old proto imports
-import {
- Engine as OldEngine,
- State as OldState,
- ExportFormat as OldExportFormat,
- VCSType as OldVCSType,
- engineToJSON as oldEngineToJSON,
- engineFromJSON as oldEngineFromJSON,
-} from "@/types/proto/v1/common";
-
-import {
- Duration as OldDuration,
-} from "@/types/proto/google/protobuf/duration"
-
import {
- Timestamp as OldTimestamp,
-} from "@/types/proto/google/protobuf/timestamp";
-
-import {
- DurationSchema as NewDurationSchema,
- type Duration as NewDuration,
- TimestampSchema as NewTimestampSchema,
- type Timestamp as NewTimestamp,
-} from "@bufbuild/protobuf/wkt"
-
-// Expr type imports
-import { Expr as OldExpr } from "@/types/proto/google/type/expr";
-import type { Expr as NewExpr } from "@/types/proto-es/google/type/expr_pb";
-import { ExprSchema as NewExprSchema } from "@/types/proto-es/google/type/expr_pb";
-
-
-// Proto-es imports
-import {
Engine as NewEngine,
- State as NewState,
+ State as NewState,
ExportFormat as NewExportFormat,
VCSType as NewVCSType,
} from "@/types/proto-es/v1/common_pb";
-import { create } from "@bufbuild/protobuf";
-
-/**
- * Convert proto-es Engine to old proto Engine
- */
-export const convertEngineToOld = (engine: NewEngine): OldEngine => {
- switch (engine) {
- case NewEngine.ENGINE_UNSPECIFIED:
- return OldEngine.ENGINE_UNSPECIFIED;
- case NewEngine.CLICKHOUSE:
- return OldEngine.CLICKHOUSE;
- case NewEngine.MYSQL:
- return OldEngine.MYSQL;
- case NewEngine.POSTGRES:
- return OldEngine.POSTGRES;
- case NewEngine.SNOWFLAKE:
- return OldEngine.SNOWFLAKE;
- case NewEngine.SQLITE:
- return OldEngine.SQLITE;
- case NewEngine.TIDB:
- return OldEngine.TIDB;
- case NewEngine.MONGODB:
- return OldEngine.MONGODB;
- case NewEngine.REDIS:
- return OldEngine.REDIS;
- case NewEngine.ORACLE:
- return OldEngine.ORACLE;
- case NewEngine.MSSQL:
- return OldEngine.MSSQL;
- case NewEngine.REDSHIFT:
- return OldEngine.REDSHIFT;
- case NewEngine.MARIADB:
- return OldEngine.MARIADB;
- case NewEngine.OCEANBASE:
- return OldEngine.OCEANBASE;
- case NewEngine.DM:
- return OldEngine.DM;
- case NewEngine.RISINGWAVE:
- return OldEngine.RISINGWAVE;
- case NewEngine.OCEANBASE_ORACLE:
- return OldEngine.OCEANBASE_ORACLE;
- case NewEngine.STARROCKS:
- return OldEngine.STARROCKS;
- case NewEngine.DORIS:
- return OldEngine.DORIS;
- case NewEngine.HIVE:
- return OldEngine.HIVE;
- case NewEngine.ELASTICSEARCH:
- return OldEngine.ELASTICSEARCH;
- case NewEngine.BIGQUERY:
- return OldEngine.BIGQUERY;
- case NewEngine.DYNAMODB:
- return OldEngine.DYNAMODB;
- case NewEngine.SPANNER:
- return OldEngine.SPANNER;
- case NewEngine.COCKROACHDB:
- return OldEngine.COCKROACHDB;
- case NewEngine.DATABRICKS:
- return OldEngine.DATABRICKS;
- case NewEngine.COSMOSDB:
- return OldEngine.COSMOSDB;
- case NewEngine.TRINO:
- return OldEngine.TRINO;
- case NewEngine.CASSANDRA:
- return OldEngine.CASSANDRA;
- default:
- return OldEngine.ENGINE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert old proto Engine to proto-es Engine
- */
-export const convertEngineToNew = (engine: OldEngine): NewEngine => {
- switch (engine) {
- case OldEngine.ENGINE_UNSPECIFIED:
- return NewEngine.ENGINE_UNSPECIFIED;
- case OldEngine.CLICKHOUSE:
- return NewEngine.CLICKHOUSE;
- case OldEngine.MYSQL:
- return NewEngine.MYSQL;
- case OldEngine.POSTGRES:
- return NewEngine.POSTGRES;
- case OldEngine.SNOWFLAKE:
- return NewEngine.SNOWFLAKE;
- case OldEngine.SQLITE:
- return NewEngine.SQLITE;
- case OldEngine.TIDB:
- return NewEngine.TIDB;
- case OldEngine.MONGODB:
- return NewEngine.MONGODB;
- case OldEngine.REDIS:
- return NewEngine.REDIS;
- case OldEngine.ORACLE:
- return NewEngine.ORACLE;
- case OldEngine.MSSQL:
- return NewEngine.MSSQL;
- case OldEngine.REDSHIFT:
- return NewEngine.REDSHIFT;
- case OldEngine.MARIADB:
- return NewEngine.MARIADB;
- case OldEngine.OCEANBASE:
- return NewEngine.OCEANBASE;
- case OldEngine.DM:
- return NewEngine.DM;
- case OldEngine.RISINGWAVE:
- return NewEngine.RISINGWAVE;
- case OldEngine.OCEANBASE_ORACLE:
- return NewEngine.OCEANBASE_ORACLE;
- case OldEngine.STARROCKS:
- return NewEngine.STARROCKS;
- case OldEngine.DORIS:
- return NewEngine.DORIS;
- case OldEngine.HIVE:
- return NewEngine.HIVE;
- case OldEngine.ELASTICSEARCH:
- return NewEngine.ELASTICSEARCH;
- case OldEngine.BIGQUERY:
- return NewEngine.BIGQUERY;
- case OldEngine.DYNAMODB:
- return NewEngine.DYNAMODB;
- case OldEngine.SPANNER:
- return NewEngine.SPANNER;
- case OldEngine.COCKROACHDB:
- return NewEngine.COCKROACHDB;
- case OldEngine.DATABRICKS:
- return NewEngine.DATABRICKS;
- case OldEngine.COSMOSDB:
- return NewEngine.COSMOSDB;
- case OldEngine.TRINO:
- return NewEngine.TRINO;
- case OldEngine.CASSANDRA:
- return NewEngine.CASSANDRA;
- default:
- return NewEngine.ENGINE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert proto-es State to old proto State
- */
-export const convertStateToOld = (state: NewState): OldState => {
- switch (state) {
- case NewState.STATE_UNSPECIFIED:
- return OldState.STATE_UNSPECIFIED;
- case NewState.ACTIVE:
- return OldState.ACTIVE;
- case NewState.DELETED:
- return OldState.DELETED;
- default:
- return OldState.STATE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert old proto State to proto-es State
- */
-export const convertStateToNew = (state: OldState): NewState => {
- switch (state) {
- case OldState.STATE_UNSPECIFIED:
- return NewState.STATE_UNSPECIFIED;
- case OldState.ACTIVE:
- return NewState.ACTIVE;
- case OldState.DELETED:
- return NewState.DELETED;
- default:
- return NewState.STATE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert proto-es ExportFormat to old proto ExportFormat
- */
-export const convertExportFormatToOld = (format: NewExportFormat): OldExportFormat => {
- switch (format) {
- case NewExportFormat.FORMAT_UNSPECIFIED:
- return OldExportFormat.FORMAT_UNSPECIFIED;
- case NewExportFormat.CSV:
- return OldExportFormat.CSV;
- case NewExportFormat.JSON:
- return OldExportFormat.JSON;
- case NewExportFormat.SQL:
- return OldExportFormat.SQL;
- case NewExportFormat.XLSX:
- return OldExportFormat.XLSX;
- default:
- return OldExportFormat.FORMAT_UNSPECIFIED;
- }
-};
-
-/**
- * Convert old proto ExportFormat to proto-es ExportFormat
- */
-export const convertExportFormatToNew = (format: OldExportFormat): NewExportFormat => {
- switch (format) {
- case OldExportFormat.FORMAT_UNSPECIFIED:
- return NewExportFormat.FORMAT_UNSPECIFIED;
- case OldExportFormat.CSV:
- return NewExportFormat.CSV;
- case OldExportFormat.JSON:
- return NewExportFormat.JSON;
- case OldExportFormat.SQL:
- return NewExportFormat.SQL;
- case OldExportFormat.XLSX:
- return NewExportFormat.XLSX;
- default:
- return NewExportFormat.FORMAT_UNSPECIFIED;
- }
-};
-
-/**
- * Convert proto-es VCSType to old proto VCSType
- */
-export const convertVCSTypeToOld = (vcsType: NewVCSType): OldVCSType => {
- switch (vcsType) {
- case NewVCSType.VCS_TYPE_UNSPECIFIED:
- return OldVCSType.VCS_TYPE_UNSPECIFIED;
- case NewVCSType.GITHUB:
- return OldVCSType.GITHUB;
- case NewVCSType.GITLAB:
- return OldVCSType.GITLAB;
- case NewVCSType.BITBUCKET:
- return OldVCSType.BITBUCKET;
- case NewVCSType.AZURE_DEVOPS:
- return OldVCSType.AZURE_DEVOPS;
- default:
- return OldVCSType.VCS_TYPE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert old proto VCSType to proto-es VCSType
- */
-export const convertVCSTypeToNew = (vcsType: OldVCSType): NewVCSType => {
- switch (vcsType) {
- case OldVCSType.VCS_TYPE_UNSPECIFIED:
- return NewVCSType.VCS_TYPE_UNSPECIFIED;
- case OldVCSType.GITHUB:
- return NewVCSType.GITHUB;
- case OldVCSType.GITLAB:
- return NewVCSType.GITLAB;
- case OldVCSType.BITBUCKET:
- return NewVCSType.BITBUCKET;
- case OldVCSType.AZURE_DEVOPS:
- return NewVCSType.AZURE_DEVOPS;
- default:
- return NewVCSType.VCS_TYPE_UNSPECIFIED;
- }
-};
-
-/**
- * Convert old proto Engine to JSON string (backwards compatibility)
- */
-export const engineToJSON = (engine: OldEngine): string => {
- return oldEngineToJSON(engine);
-};
-
-/**
- * Convert JSON string to old proto Engine (backwards compatibility)
- */
-export const engineFromJSON = (json: string): OldEngine => {
- return oldEngineFromJSON(json);
-};
/**
* Convert proto-es Engine to string for display/logging
@@ -333,13 +37,15 @@ export const exportFormatToString = (format: NewExportFormat): string => {
*/
export const vcsTypeToString = (vcsType: NewVCSType): string => {
return NewVCSType[vcsType] || "VCS_TYPE_UNSPECIFIED";
-}
+};
/**
* Convert scope value (string or number) to proto-es Engine
* Handles both string names and numeric enum values from scope.value
*/
-export const convertScopeValueToEngine = (value: string | number): NewEngine => {
+export const convertScopeValueToEngine = (
+ value: string | number
+): NewEngine => {
switch (value) {
case 0:
case "ENGINE_UNSPECIFIED":
@@ -434,61 +140,3 @@ export const convertScopeValueToEngine = (value: string | number): NewEngine =>
return NewEngine.ENGINE_UNSPECIFIED;
}
};
-
-export const convertDurationToOld = (value: NewDuration): OldDuration => {
- return OldDuration.fromPartial({
- seconds: Number(value.seconds),
- nanos: value.nanos,
- })
-}
-
-export const convertDurationToNew = (value: OldDuration): NewDuration => {
- return create(NewDurationSchema, {
- seconds: value.seconds.toBigInt(),
- nanos: value.nanos,
- })
-}
-
-/**
- * Convert old proto Expr to proto-es Expr
- */
-export const convertExprToNew = (expr: OldExpr): NewExpr => {
- return create(NewExprSchema, {
- expression: expr.expression,
- title: expr.title,
- description: expr.description,
- location: expr.location,
- });
-};
-
-/**
- * Convert proto-es Expr to old proto Expr
- */
-export const convertExprToOld = (expr: NewExpr): OldExpr => {
- return OldExpr.create({
- expression: expr.expression,
- title: expr.title,
- description: expr.description,
- location: expr.location,
- });
-};
-
-/**
- * Convert proto-es Timestamp to old proto Timestamp
- */
-export const convertTimestampToOld = (timestamp: NewTimestamp): OldTimestamp => {
- return OldTimestamp.fromPartial({
- seconds: Number(timestamp.seconds),
- nanos: timestamp.nanos,
- });
-};
-
-/**
- * Convert old proto Timestamp to proto-es Timestamp
- */
-export const convertTimestampToNew = (timestamp: OldTimestamp): NewTimestamp => {
- return create(NewTimestampSchema, {
- seconds: timestamp.seconds.toBigInt(),
- nanos: timestamp.nanos,
- });
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/database-catalog-conversions.ts b/frontend/src/utils/v1/database-catalog-conversions.ts
deleted file mode 100644
index 81e34f2b7b..0000000000
--- a/frontend/src/utils/v1/database-catalog-conversions.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- DatabaseCatalog as OldDatabaseCatalog,
- TableCatalog as OldTableCatalog,
- ColumnCatalog as OldColumnCatalog,
- TableCatalog_Columns as OldTableCatalog_Columns
-} from "@/types/proto/v1/database_catalog_service";
-import {
- DatabaseCatalog as OldDatabaseCatalogProto,
- TableCatalog as OldTableCatalogProto,
- ColumnCatalog as OldColumnCatalogProto,
- TableCatalog_Columns as OldTableCatalog_ColumnsProto
-} from "@/types/proto/v1/database_catalog_service";
-import type {
- DatabaseCatalog as NewDatabaseCatalog,
- TableCatalog as NewTableCatalog,
- ColumnCatalog as NewColumnCatalog,
- TableCatalog_Columns as NewTableCatalog_Columns
-} from "@/types/proto-es/v1/database_catalog_service_pb";
-import {
- DatabaseCatalogSchema,
- TableCatalogSchema,
- ColumnCatalogSchema,
- TableCatalog_ColumnsSchema
-} from "@/types/proto-es/v1/database_catalog_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldDatabaseCatalogToNew = (oldCatalog: OldDatabaseCatalog): NewDatabaseCatalog => {
- const json = OldDatabaseCatalogProto.toJSON(oldCatalog) as any;
- return fromJson(DatabaseCatalogSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewDatabaseCatalogToOld = (newCatalog: NewDatabaseCatalog): OldDatabaseCatalog => {
- const json = toJson(DatabaseCatalogSchema, newCatalog);
- return OldDatabaseCatalogProto.fromJSON(json);
-};
-
-export const convertOldTableCatalogToNew = (oldTable: OldTableCatalog): NewTableCatalog => {
- const json = OldTableCatalogProto.toJSON(oldTable) as any;
- return fromJson(TableCatalogSchema, json);
-};
-
-export const convertNewTableCatalogToOld = (newTable: NewTableCatalog): OldTableCatalog => {
- const json = toJson(TableCatalogSchema, newTable);
- return OldTableCatalogProto.fromJSON(json);
-};
-
-export const convertOldColumnCatalogToNew = (oldColumn: OldColumnCatalog): NewColumnCatalog => {
- const json = OldColumnCatalogProto.toJSON(oldColumn) as any;
- return fromJson(ColumnCatalogSchema, json);
-};
-
-export const convertNewColumnCatalogToOld = (newColumn: NewColumnCatalog): OldColumnCatalog => {
- const json = toJson(ColumnCatalogSchema, newColumn);
- return OldColumnCatalogProto.fromJSON(json);
-};
-
-export const convertOldTableCatalogColumnsToNew = (oldColumns: OldTableCatalog_Columns): NewTableCatalog_Columns => {
- const json = OldTableCatalog_ColumnsProto.toJSON(oldColumns) as any;
- return fromJson(TableCatalog_ColumnsSchema, json);
-};
-
-export const convertNewTableCatalogColumnsToOld = (newColumns: NewTableCatalog_Columns): OldTableCatalog_Columns => {
- const json = toJson(TableCatalog_ColumnsSchema, newColumns);
- return OldTableCatalog_ColumnsProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/database-conversions.ts b/frontend/src/utils/v1/database-conversions.ts
deleted file mode 100644
index 15c256ddbe..0000000000
--- a/frontend/src/utils/v1/database-conversions.ts
+++ /dev/null
@@ -1,585 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- Database as OldDatabase,
- GetDatabaseRequest as OldGetDatabaseRequest,
- BatchGetDatabasesRequest as OldBatchGetDatabasesRequest,
- BatchGetDatabasesResponse as OldBatchGetDatabasesResponse,
- ListDatabasesRequest as OldListDatabasesRequest,
- ListDatabasesResponse as OldListDatabasesResponse,
- UpdateDatabaseRequest as OldUpdateDatabaseRequest,
- BatchUpdateDatabasesRequest as OldBatchUpdateDatabasesRequest,
- BatchUpdateDatabasesResponse as OldBatchUpdateDatabasesResponse,
- BatchSyncDatabasesRequest as OldBatchSyncDatabasesRequest,
- BatchSyncDatabasesResponse as OldBatchSyncDatabasesResponse,
- SyncDatabaseRequest as OldSyncDatabaseRequest,
- SyncDatabaseResponse as OldSyncDatabaseResponse,
- GetDatabaseMetadataRequest as OldGetDatabaseMetadataRequest,
- GetDatabaseSchemaRequest as OldGetDatabaseSchemaRequest,
- DiffSchemaRequest as OldDiffSchemaRequest,
- ListSecretsRequest as OldListSecretsRequest,
- ListSecretsResponse as OldListSecretsResponse,
- UpdateSecretRequest as OldUpdateSecretRequest,
- DeleteSecretRequest as OldDeleteSecretRequest,
- ListChangelogsRequest as OldListChangelogsRequest,
- ListChangelogsResponse as OldListChangelogsResponse,
- GetChangelogRequest as OldGetChangelogRequest,
- GetSchemaStringRequest as OldGetSchemaStringRequest,
- DatabaseMetadata as OldDatabaseMetadata,
- Changelog as OldChangelog,
- Secret as OldSecret,
- DatabaseSchema as OldDatabaseSchema,
- DiffSchemaResponse as OldDiffSchemaResponse,
- GetSchemaStringResponse as OldGetSchemaStringResponse,
- SchemaMetadata as OldSchemaMetadata,
- TableMetadata as OldTableMetadata,
- ColumnMetadata as OldColumnMetadata,
-} from "@/types/proto/v1/database_service";
-import {
- Database as OldDatabaseProto,
- GetDatabaseRequest as OldGetDatabaseRequestProto,
- BatchGetDatabasesRequest as OldBatchGetDatabasesRequestProto,
- BatchGetDatabasesResponse as OldBatchGetDatabasesResponseProto,
- ListDatabasesRequest as OldListDatabasesRequestProto,
- ListDatabasesResponse as OldListDatabasesResponseProto,
- UpdateDatabaseRequest as OldUpdateDatabaseRequestProto,
- BatchUpdateDatabasesRequest as OldBatchUpdateDatabasesRequestProto,
- BatchUpdateDatabasesResponse as OldBatchUpdateDatabasesResponseProto,
- BatchSyncDatabasesRequest as OldBatchSyncDatabasesRequestProto,
- BatchSyncDatabasesResponse as OldBatchSyncDatabasesResponseProto,
- SyncDatabaseRequest as OldSyncDatabaseRequestProto,
- SyncDatabaseResponse as OldSyncDatabaseResponseProto,
- GetDatabaseMetadataRequest as OldGetDatabaseMetadataRequestProto,
- GetDatabaseSchemaRequest as OldGetDatabaseSchemaRequestProto,
- DiffSchemaRequest as OldDiffSchemaRequestProto,
- ListSecretsRequest as OldListSecretsRequestProto,
- ListSecretsResponse as OldListSecretsResponseProto,
- UpdateSecretRequest as OldUpdateSecretRequestProto,
- DeleteSecretRequest as OldDeleteSecretRequestProto,
- ListChangelogsRequest as OldListChangelogsRequestProto,
- ListChangelogsResponse as OldListChangelogsResponseProto,
- GetChangelogRequest as OldGetChangelogRequestProto,
- GetSchemaStringRequest as OldGetSchemaStringRequestProto,
- DatabaseMetadata as OldDatabaseMetadataProto,
- Changelog as OldChangelogProto,
- Secret as OldSecretProto,
- DatabaseSchema as OldDatabaseSchemaProto,
- DiffSchemaResponse as OldDiffSchemaResponseProto,
- GetSchemaStringResponse as OldGetSchemaStringResponseProto,
- SchemaMetadata as OldSchemaMetadataProto,
- TableMetadata as OldTableMetadataProto,
- ColumnMetadata as OldColumnMetadataProto,
- ChangelogView as OldChangelogView,
- GetSchemaStringRequest_ObjectType as OldObjectType
-} from "@/types/proto/v1/database_service";
-import type {
- Database as NewDatabase,
- GetDatabaseRequest as NewGetDatabaseRequest,
- BatchGetDatabasesRequest as NewBatchGetDatabasesRequest,
- BatchGetDatabasesResponse as NewBatchGetDatabasesResponse,
- ListDatabasesRequest as NewListDatabasesRequest,
- ListDatabasesResponse as NewListDatabasesResponse,
- UpdateDatabaseRequest as NewUpdateDatabaseRequest,
- BatchUpdateDatabasesRequest as NewBatchUpdateDatabasesRequest,
- BatchUpdateDatabasesResponse as NewBatchUpdateDatabasesResponse,
- BatchSyncDatabasesRequest as NewBatchSyncDatabasesRequest,
- BatchSyncDatabasesResponse as NewBatchSyncDatabasesResponse,
- SyncDatabaseRequest as NewSyncDatabaseRequest,
- SyncDatabaseResponse as NewSyncDatabaseResponse,
- GetDatabaseMetadataRequest as NewGetDatabaseMetadataRequest,
- GetDatabaseSchemaRequest as NewGetDatabaseSchemaRequest,
- DiffSchemaRequest as NewDiffSchemaRequest,
- ListSecretsRequest as NewListSecretsRequest,
- ListSecretsResponse as NewListSecretsResponse,
- UpdateSecretRequest as NewUpdateSecretRequest,
- DeleteSecretRequest as NewDeleteSecretRequest,
- ListChangelogsRequest as NewListChangelogsRequest,
- ListChangelogsResponse as NewListChangelogsResponse,
- GetChangelogRequest as NewGetChangelogRequest,
- GetSchemaStringRequest as NewGetSchemaStringRequest,
- DatabaseMetadata as NewDatabaseMetadata,
- Changelog as NewChangelog,
- Secret as NewSecret,
- DatabaseSchema as NewDatabaseSchemaType,
- DiffSchemaResponse as NewDiffSchemaResponse,
- GetSchemaStringResponse as NewGetSchemaStringResponse,
- SchemaMetadata as NewSchemaMetadata,
- TableMetadata as NewTableMetadata,
- ColumnMetadata as NewColumnMetadata,
-} from "@/types/proto-es/v1/database_service_pb";
-import {
- GetDatabaseRequestSchema,
- BatchGetDatabasesRequestSchema,
- BatchGetDatabasesResponseSchema,
- ListDatabasesRequestSchema,
- ListDatabasesResponseSchema,
- UpdateDatabaseRequestSchema,
- BatchUpdateDatabasesRequestSchema,
- BatchUpdateDatabasesResponseSchema,
- BatchSyncDatabasesRequestSchema,
- BatchSyncDatabasesResponseSchema,
- SyncDatabaseRequestSchema,
- SyncDatabaseResponseSchema,
- GetDatabaseMetadataRequestSchema,
- GetDatabaseSchemaRequestSchema,
- DiffSchemaRequestSchema,
- ListSecretsRequestSchema,
- ListSecretsResponseSchema,
- UpdateSecretRequestSchema,
- DeleteSecretRequestSchema,
- ListChangelogsRequestSchema,
- ListChangelogsResponseSchema,
- GetChangelogRequestSchema,
- GetSchemaStringRequestSchema,
- DatabaseMetadataSchema as NewDatabaseMetadataSchema,
- ChangelogSchema as NewChangelogSchema,
- SecretSchema as NewSecretSchema,
- DatabaseSchemaSchema as NewDatabaseSchemaSchema,
- DiffSchemaResponseSchema as NewDiffSchemaResponseSchema,
- GetSchemaStringResponseSchema as NewGetSchemaStringResponseSchema,
- SchemaMetadataSchema as NewSchemaMetadataSchema,
- TableMetadataSchema as NewTableMetadataSchema,
- ColumnMetadataSchema as NewColumnMetadataSchema,
- ChangelogView as NewChangelogView,
- GetSchemaStringRequest_ObjectType as NewObjectType,
- DatabaseSchema$
-} from "@/types/proto-es/v1/database_service_pb";
-
-
-
-// Convert old ChangelogView enum to new
-export const convertOldChangelogViewToNew = (oldView: OldChangelogView): NewChangelogView => {
- const mapping: Record<OldChangelogView, NewChangelogView> = {
- [OldChangelogView.CHANGELOG_VIEW_UNSPECIFIED]: NewChangelogView.UNSPECIFIED,
- [OldChangelogView.CHANGELOG_VIEW_BASIC]: NewChangelogView.BASIC,
- [OldChangelogView.CHANGELOG_VIEW_FULL]: NewChangelogView.FULL,
- [OldChangelogView.UNRECOGNIZED]: NewChangelogView.UNSPECIFIED,
- };
- return mapping[oldView] ?? NewChangelogView.UNSPECIFIED;
-};
-
-// Convert new ChangelogView enum to old
-export const convertNewChangelogViewToOld = (newView: NewChangelogView): OldChangelogView => {
- const mapping: Record<NewChangelogView, OldChangelogView> = {
- [NewChangelogView.UNSPECIFIED]: OldChangelogView.CHANGELOG_VIEW_UNSPECIFIED,
- [NewChangelogView.BASIC]: OldChangelogView.CHANGELOG_VIEW_BASIC,
- [NewChangelogView.FULL]: OldChangelogView.CHANGELOG_VIEW_FULL,
- };
- return mapping[newView] ?? OldChangelogView.UNRECOGNIZED;
-};
-
-// Convert old GetSchemaStringRequest_ObjectType enum to new
-export const convertOldObjectTypeToNew = (oldType?: OldObjectType): NewObjectType | undefined => {
- if (!oldType) return undefined;
- const mapping: Record<OldObjectType, NewObjectType> = {
- [OldObjectType.OBJECT_TYPE_UNSPECIFIED]: NewObjectType.OBJECT_TYPE_UNSPECIFIED,
- [OldObjectType.DATABASE]: NewObjectType.DATABASE,
- [OldObjectType.SCHEMA]: NewObjectType.SCHEMA,
- [OldObjectType.TABLE]: NewObjectType.TABLE,
- [OldObjectType.VIEW]: NewObjectType.VIEW,
- [OldObjectType.MATERIALIZED_VIEW]: NewObjectType.MATERIALIZED_VIEW,
- [OldObjectType.FUNCTION]: NewObjectType.FUNCTION,
- [OldObjectType.PROCEDURE]: NewObjectType.PROCEDURE,
- [OldObjectType.SEQUENCE]: NewObjectType.SEQUENCE,
- [OldObjectType.UNRECOGNIZED]: NewObjectType.OBJECT_TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewObjectType.OBJECT_TYPE_UNSPECIFIED;
-};
-
-// Convert old Database proto to proto-es
-export const convertOldDatabaseToNew = (oldDatabase: OldDatabase): NewDatabase => {
- const json = OldDatabaseProto.toJSON(oldDatabase) as any;
- return fromJson(DatabaseSchema$, json);
-};
-
-// Convert proto-es Database to old proto
-export const convertNewDatabaseToOld = (newDatabase: NewDatabase): OldDatabase => {
- const json = toJson(DatabaseSchema$, newDatabase);
- return OldDatabaseProto.fromJSON(json);
-};
-
-// Convert old DatabaseMetadata proto to proto-es
-export const convertOldDatabaseMetadataToNew = (oldMetadata: OldDatabaseMetadata): NewDatabaseMetadata => {
- const json = OldDatabaseMetadataProto.toJSON(oldMetadata) as any;
- return fromJson(NewDatabaseMetadataSchema, json);
-};
-
-// Convert proto-es DatabaseMetadata to old proto
-export const convertNewDatabaseMetadataToOld = (newMetadata: NewDatabaseMetadata): OldDatabaseMetadata => {
- const json = toJson(NewDatabaseMetadataSchema, newMetadata);
- return OldDatabaseMetadataProto.fromJSON(json);
-};
-
-// Convert old Changelog proto to proto-es
-export const convertOldChangelogToNew = (oldChangelog: OldChangelog): NewChangelog => {
- const json = OldChangelogProto.toJSON(oldChangelog) as any;
- return fromJson(NewChangelogSchema, json);
-};
-
-// Convert proto-es Changelog to old proto
-export const convertNewChangelogToOld = (newChangelog: NewChangelog): OldChangelog => {
- const json = toJson(NewChangelogSchema, newChangelog);
- return OldChangelogProto.fromJSON(json);
-};
-
-// Convert old Secret proto to proto-es
-export const convertOldSecretToNew = (oldSecret: OldSecret): NewSecret => {
- const json = OldSecretProto.toJSON(oldSecret) as any;
- return fromJson(NewSecretSchema, json);
-};
-
-// Convert proto-es Secret to old proto
-export const convertNewSecretToOld = (newSecret: NewSecret): OldSecret => {
- const json = toJson(NewSecretSchema, newSecret);
- return OldSecretProto.fromJSON(json);
-};
-
-// Convert old DatabaseSchema proto to proto-es
-export const convertOldDatabaseSchemaToNew = (oldSchema: OldDatabaseSchema): NewDatabaseSchemaType => {
- const json = OldDatabaseSchemaProto.toJSON(oldSchema) as any;
- return fromJson(NewDatabaseSchemaSchema, json);
-};
-
-// Convert proto-es DatabaseSchema to old proto
-export const convertNewDatabaseSchemaToOld = (newSchema: NewDatabaseSchemaType): OldDatabaseSchema => {
- const json = toJson(NewDatabaseSchemaSchema, newSchema);
- return OldDatabaseSchemaProto.fromJSON(json);
-};
-
-// Convert old DiffSchemaResponse proto to proto-es
-export const convertOldDiffSchemaResponseToNew = (oldResponse: OldDiffSchemaResponse): NewDiffSchemaResponse => {
- const json = OldDiffSchemaResponseProto.toJSON(oldResponse) as any;
- return fromJson(NewDiffSchemaResponseSchema, json);
-};
-
-// Convert proto-es DiffSchemaResponse to old proto
-export const convertNewDiffSchemaResponseToOld = (newResponse: NewDiffSchemaResponse): OldDiffSchemaResponse => {
- const json = toJson(NewDiffSchemaResponseSchema, newResponse);
- return OldDiffSchemaResponseProto.fromJSON(json);
-};
-
-// Convert old GetSchemaStringResponse proto to proto-es
-export const convertOldGetSchemaStringResponseToNew = (oldResponse: OldGetSchemaStringResponse): NewGetSchemaStringResponse => {
- const json = OldGetSchemaStringResponseProto.toJSON(oldResponse) as any;
- return fromJson(NewGetSchemaStringResponseSchema, json);
-};
-
-// Convert proto-es GetSchemaStringResponse to old proto
-export const convertNewGetSchemaStringResponseToOld = (newResponse: NewGetSchemaStringResponse): OldGetSchemaStringResponse => {
- const json = toJson(NewGetSchemaStringResponseSchema, newResponse);
- return OldGetSchemaStringResponseProto.fromJSON(json);
-};
-
-// Convert old SchemaMetadata proto to proto-es
-export const convertOldSchemaMetadataToNew = (oldMetadata: OldSchemaMetadata): NewSchemaMetadata => {
- const json = OldSchemaMetadataProto.toJSON(oldMetadata) as any;
- return fromJson(NewSchemaMetadataSchema, json);
-};
-
-// Convert proto-es SchemaMetadata to old proto
-export const convertNewSchemaMetadataToOld = (newMetadata: NewSchemaMetadata): OldSchemaMetadata => {
- const json = toJson(NewSchemaMetadataSchema, newMetadata);
- return OldSchemaMetadataProto.fromJSON(json);
-};
-
-// Convert old TableMetadata proto to proto-es
-export const convertOldTableMetadataToNew = (oldMetadata: OldTableMetadata): NewTableMetadata => {
- const json = OldTableMetadataProto.toJSON(oldMetadata) as any;
- return fromJson(NewTableMetadataSchema, json);
-};
-
-// Convert proto-es TableMetadata to old proto
-export const convertNewTableMetadataToOld = (newMetadata: NewTableMetadata): OldTableMetadata => {
- const json = toJson(NewTableMetadataSchema, newMetadata);
- return OldTableMetadataProto.fromJSON(json);
-};
-
-// Convert old ColumnMetadata proto to proto-es
-export const convertOldColumnMetadataToNew = (oldMetadata: OldColumnMetadata): NewColumnMetadata => {
- const json = OldColumnMetadataProto.toJSON(oldMetadata) as any;
- return fromJson(NewColumnMetadataSchema, json);
-};
-
-// Convert proto-es ColumnMetadata to old proto
-export const convertNewColumnMetadataToOld = (newMetadata: NewColumnMetadata): OldColumnMetadata => {
- const json = toJson(NewColumnMetadataSchema, newMetadata);
- return OldColumnMetadataProto.fromJSON(json);
-};
-
-// ========== REQUEST/RESPONSE CONVERSIONS ==========
-
-// Convert old GetDatabaseRequest proto to proto-es
-export const convertOldGetDatabaseRequestToNew = (oldRequest: OldGetDatabaseRequest): NewGetDatabaseRequest => {
- const json = OldGetDatabaseRequestProto.toJSON(oldRequest) as any;
- return fromJson(GetDatabaseRequestSchema, json);
-};
-
-// Convert proto-es GetDatabaseRequest to old proto
-export const convertNewGetDatabaseRequestToOld = (newRequest: NewGetDatabaseRequest): OldGetDatabaseRequest => {
- const json = toJson(GetDatabaseRequestSchema, newRequest);
- return OldGetDatabaseRequestProto.fromJSON(json);
-};
-
-// Convert old BatchGetDatabasesRequest proto to proto-es
-export const convertOldBatchGetDatabasesRequestToNew = (oldRequest: OldBatchGetDatabasesRequest): NewBatchGetDatabasesRequest => {
- const json = OldBatchGetDatabasesRequestProto.toJSON(oldRequest) as any;
- return fromJson(BatchGetDatabasesRequestSchema, json);
-};
-
-// Convert proto-es BatchGetDatabasesRequest to old proto
-export const convertNewBatchGetDatabasesRequestToOld = (newRequest: NewBatchGetDatabasesRequest): OldBatchGetDatabasesRequest => {
- const json = toJson(BatchGetDatabasesRequestSchema, newRequest);
- return OldBatchGetDatabasesRequestProto.fromJSON(json);
-};
-
-// Convert old BatchGetDatabasesResponse proto to proto-es
-export const convertOldBatchGetDatabasesResponseToNew = (oldResponse: OldBatchGetDatabasesResponse): NewBatchGetDatabasesResponse => {
- const json = OldBatchGetDatabasesResponseProto.toJSON(oldResponse) as any;
- return fromJson(BatchGetDatabasesResponseSchema, json);
-};
-
-// Convert proto-es BatchGetDatabasesResponse to old proto
-export const convertNewBatchGetDatabasesResponseToOld = (newResponse: NewBatchGetDatabasesResponse): OldBatchGetDatabasesResponse => {
- const json = toJson(BatchGetDatabasesResponseSchema, newResponse);
- return OldBatchGetDatabasesResponseProto.fromJSON(json);
-};
-
-// Convert old ListDatabasesRequest proto to proto-es
-export const convertOldListDatabasesRequestToNew = (oldRequest: OldListDatabasesRequest): NewListDatabasesRequest => {
- const json = OldListDatabasesRequestProto.toJSON(oldRequest) as any;
- return fromJson(ListDatabasesRequestSchema, json);
-};
-
-// Convert proto-es ListDatabasesRequest to old proto
-export const convertNewListDatabasesRequestToOld = (newRequest: NewListDatabasesRequest): OldListDatabasesRequest => {
- const json = toJson(ListDatabasesRequestSchema, newRequest);
- return OldListDatabasesRequestProto.fromJSON(json);
-};
-
-// Convert old ListDatabasesResponse proto to proto-es
-export const convertOldListDatabasesResponseToNew = (oldResponse: OldListDatabasesResponse): NewListDatabasesResponse => {
- const json = OldListDatabasesResponseProto.toJSON(oldResponse) as any;
- return fromJson(ListDatabasesResponseSchema, json);
-};
-
-// Convert proto-es ListDatabasesResponse to old proto
-export const convertNewListDatabasesResponseToOld = (newResponse: NewListDatabasesResponse): OldListDatabasesResponse => {
- const json = toJson(ListDatabasesResponseSchema, newResponse);
- return OldListDatabasesResponseProto.fromJSON(json);
-};
-
-// Convert old UpdateDatabaseRequest proto to proto-es
-export const convertOldUpdateDatabaseRequestToNew = (oldRequest: OldUpdateDatabaseRequest): NewUpdateDatabaseRequest => {
- const json = OldUpdateDatabaseRequestProto.toJSON(oldRequest) as any;
- return fromJson(UpdateDatabaseRequestSchema, json);
-};
-
-// Convert proto-es UpdateDatabaseRequest to old proto
-export const convertNewUpdateDatabaseRequestToOld = (newRequest: NewUpdateDatabaseRequest): OldUpdateDatabaseRequest => {
- const json = toJson(UpdateDatabaseRequestSchema, newRequest);
- return OldUpdateDatabaseRequestProto.fromJSON(json);
-};
-
-// Convert old BatchUpdateDatabasesRequest proto to proto-es
-export const convertOldBatchUpdateDatabasesRequestToNew = (oldRequest: OldBatchUpdateDatabasesRequest): NewBatchUpdateDatabasesRequest => {
- const json = OldBatchUpdateDatabasesRequestProto.toJSON(oldRequest) as any;
- return fromJson(BatchUpdateDatabasesRequestSchema, json);
-};
-
-// Convert proto-es BatchUpdateDatabasesRequest to old proto
-export const convertNewBatchUpdateDatabasesRequestToOld = (newRequest: NewBatchUpdateDatabasesRequest): OldBatchUpdateDatabasesRequest => {
- const json = toJson(BatchUpdateDatabasesRequestSchema, newRequest);
- return OldBatchUpdateDatabasesRequestProto.fromJSON(json);
-};
-
-// Convert old BatchUpdateDatabasesResponse proto to proto-es
-export const convertOldBatchUpdateDatabasesResponseToNew = (oldResponse: OldBatchUpdateDatabasesResponse): NewBatchUpdateDatabasesResponse => {
- const json = OldBatchUpdateDatabasesResponseProto.toJSON(oldResponse) as any;
- return fromJson(BatchUpdateDatabasesResponseSchema, json);
-};
-
-// Convert proto-es BatchUpdateDatabasesResponse to old proto
-export const convertNewBatchUpdateDatabasesResponseToOld = (newResponse: NewBatchUpdateDatabasesResponse): OldBatchUpdateDatabasesResponse => {
- const json = toJson(BatchUpdateDatabasesResponseSchema, newResponse);
- return OldBatchUpdateDatabasesResponseProto.fromJSON(json);
-};
-
-// Convert old BatchSyncDatabasesRequest proto to proto-es
-export const convertOldBatchSyncDatabasesRequestToNew = (oldRequest: OldBatchSyncDatabasesRequest): NewBatchSyncDatabasesRequest => {
- const json = OldBatchSyncDatabasesRequestProto.toJSON(oldRequest) as any;
- return fromJson(BatchSyncDatabasesRequestSchema, json);
-};
-
-// Convert proto-es BatchSyncDatabasesRequest to old proto
-export const convertNewBatchSyncDatabasesRequestToOld = (newRequest: NewBatchSyncDatabasesRequest): OldBatchSyncDatabasesRequest => {
- const json = toJson(BatchSyncDatabasesRequestSchema, newRequest);
- return OldBatchSyncDatabasesRequestProto.fromJSON(json);
-};
-
-// Convert old BatchSyncDatabasesResponse proto to proto-es
-export const convertOldBatchSyncDatabasesResponseToNew = (oldResponse: OldBatchSyncDatabasesResponse): NewBatchSyncDatabasesResponse => {
- const json = OldBatchSyncDatabasesResponseProto.toJSON(oldResponse) as any;
- return fromJson(BatchSyncDatabasesResponseSchema, json);
-};
-
-// Convert proto-es BatchSyncDatabasesResponse to old proto
-export const convertNewBatchSyncDatabasesResponseToOld = (newResponse: NewBatchSyncDatabasesResponse): OldBatchSyncDatabasesResponse => {
- const json = toJson(BatchSyncDatabasesResponseSchema, newResponse);
- return OldBatchSyncDatabasesResponseProto.fromJSON(json);
-};
-
-// Convert old SyncDatabaseRequest proto to proto-es
-export const convertOldSyncDatabaseRequestToNew = (oldRequest: OldSyncDatabaseRequest): NewSyncDatabaseRequest => {
- const json = OldSyncDatabaseRequestProto.toJSON(oldRequest) as any;
- return fromJson(SyncDatabaseRequestSchema, json);
-};
-
-// Convert proto-es SyncDatabaseRequest to old proto
-export const convertNewSyncDatabaseRequestToOld = (newRequest: NewSyncDatabaseRequest): OldSyncDatabaseRequest => {
- const json = toJson(SyncDatabaseRequestSchema, newRequest);
- return OldSyncDatabaseRequestProto.fromJSON(json);
-};
-
-// Convert old SyncDatabaseResponse proto to proto-es
-export const convertOldSyncDatabaseResponseToNew = (oldResponse: OldSyncDatabaseResponse): NewSyncDatabaseResponse => {
- const json = OldSyncDatabaseResponseProto.toJSON(oldResponse) as any;
- return fromJson(SyncDatabaseResponseSchema, json);
-};
-
-// Convert proto-es SyncDatabaseResponse to old proto
-export const convertNewSyncDatabaseResponseToOld = (newResponse: NewSyncDatabaseResponse): OldSyncDatabaseResponse => {
- const json = toJson(SyncDatabaseResponseSchema, newResponse);
- return OldSyncDatabaseResponseProto.fromJSON(json);
-};
-
-// Convert old GetDatabaseMetadataRequest proto to proto-es
-export const convertOldGetDatabaseMetadataRequestToNew = (oldRequest: OldGetDatabaseMetadataRequest): NewGetDatabaseMetadataRequest => {
- const json = OldGetDatabaseMetadataRequestProto.toJSON(oldRequest) as any;
- return fromJson(GetDatabaseMetadataRequestSchema, json);
-};
-
-// Convert proto-es GetDatabaseMetadataRequest to old proto
-export const convertNewGetDatabaseMetadataRequestToOld = (newRequest: NewGetDatabaseMetadataRequest): OldGetDatabaseMetadataRequest => {
- const json = toJson(GetDatabaseMetadataRequestSchema, newRequest);
- return OldGetDatabaseMetadataRequestProto.fromJSON(json);
-};
-
-// Convert old GetDatabaseSchemaRequest proto to proto-es
-export const convertOldGetDatabaseSchemaRequestToNew = (oldRequest: OldGetDatabaseSchemaRequest): NewGetDatabaseSchemaRequest => {
- const json = OldGetDatabaseSchemaRequestProto.toJSON(oldRequest) as any;
- return fromJson(GetDatabaseSchemaRequestSchema, json);
-};
-
-// Convert proto-es GetDatabaseSchemaRequest to old proto
-export const convertNewGetDatabaseSchemaRequestToOld = (newRequest: NewGetDatabaseSchemaRequest): OldGetDatabaseSchemaRequest => {
- const json = toJson(GetDatabaseSchemaRequestSchema, newRequest);
- return OldGetDatabaseSchemaRequestProto.fromJSON(json);
-};
-
-// Convert old DiffSchemaRequest proto to proto-es
-export const convertOldDiffSchemaRequestToNew = (oldRequest: OldDiffSchemaRequest): NewDiffSchemaRequest => {
- const json = OldDiffSchemaRequestProto.toJSON(oldRequest) as any;
- return fromJson(DiffSchemaRequestSchema, json);
-};
-
-// Convert proto-es DiffSchemaRequest to old proto
-export const convertNewDiffSchemaRequestToOld = (newRequest: NewDiffSchemaRequest): OldDiffSchemaRequest => {
- const json = toJson(DiffSchemaRequestSchema, newRequest);
- return OldDiffSchemaRequestProto.fromJSON(json);
-};
-
-// Convert old ListSecretsRequest proto to proto-es
-export const convertOldListSecretsRequestToNew = (oldRequest: OldListSecretsRequest): NewListSecretsRequest => {
- const json = OldListSecretsRequestProto.toJSON(oldRequest) as any;
- return fromJson(ListSecretsRequestSchema, json);
-};
-
-// Convert proto-es ListSecretsRequest to old proto
-export const convertNewListSecretsRequestToOld = (newRequest: NewListSecretsRequest): OldListSecretsRequest => {
- const json = toJson(ListSecretsRequestSchema, newRequest);
- return OldListSecretsRequestProto.fromJSON(json);
-};
-
-// Convert old ListSecretsResponse proto to proto-es
-export const convertOldListSecretsResponseToNew = (oldResponse: OldListSecretsResponse): NewListSecretsResponse => {
- const json = OldListSecretsResponseProto.toJSON(oldResponse) as any;
- return fromJson(ListSecretsResponseSchema, json);
-};
-
-// Convert proto-es ListSecretsResponse to old proto
-export const convertNewListSecretsResponseToOld = (newResponse: NewListSecretsResponse): OldListSecretsResponse => {
- const json = toJson(ListSecretsResponseSchema, newResponse);
- return OldListSecretsResponseProto.fromJSON(json);
-};
-
-// Convert old UpdateSecretRequest proto to proto-es
-export const convertOldUpdateSecretRequestToNew = (oldRequest: OldUpdateSecretRequest): NewUpdateSecretRequest => {
- const json = OldUpdateSecretRequestProto.toJSON(oldRequest) as any;
- return fromJson(UpdateSecretRequestSchema, json);
-};
-
-// Convert proto-es UpdateSecretRequest to old proto
-export const convertNewUpdateSecretRequestToOld = (newRequest: NewUpdateSecretRequest): OldUpdateSecretRequest => {
- const json = toJson(UpdateSecretRequestSchema, newRequest);
- return OldUpdateSecretRequestProto.fromJSON(json);
-};
-
-// Convert old DeleteSecretRequest proto to proto-es
-export const convertOldDeleteSecretRequestToNew = (oldRequest: OldDeleteSecretRequest): NewDeleteSecretRequest => {
- const json = OldDeleteSecretRequestProto.toJSON(oldRequest) as any;
- return fromJson(DeleteSecretRequestSchema, json);
-};
-
-// Convert proto-es DeleteSecretRequest to old proto
-export const convertNewDeleteSecretRequestToOld = (newRequest: NewDeleteSecretRequest): OldDeleteSecretRequest => {
- const json = toJson(DeleteSecretRequestSchema, newRequest);
- return OldDeleteSecretRequestProto.fromJSON(json);
-};
-
-// Convert old ListChangelogsRequest proto to proto-es
-export const convertOldListChangelogsRequestToNew = (oldRequest: OldListChangelogsRequest): NewListChangelogsRequest => {
- const json = OldListChangelogsRequestProto.toJSON(oldRequest) as any;
- return fromJson(ListChangelogsRequestSchema, json);
-};
-
-// Convert proto-es ListChangelogsRequest to old proto
-export const convertNewListChangelogsRequestToOld = (newRequest: NewListChangelogsRequest): OldListChangelogsRequest => {
- const json = toJson(ListChangelogsRequestSchema, newRequest);
- return OldListChangelogsRequestProto.fromJSON(json);
-};
-
-// Convert old ListChangelogsResponse proto to proto-es
-export const convertOldListChangelogsResponseToNew = (oldResponse: OldListChangelogsResponse): NewListChangelogsResponse => {
- const json = OldListChangelogsResponseProto.toJSON(oldResponse) as any;
- return fromJson(ListChangelogsResponseSchema, json);
-};
-
-// Convert proto-es ListChangelogsResponse to old proto
-export const convertNewListChangelogsResponseToOld = (newResponse: NewListChangelogsResponse): OldListChangelogsResponse => {
- const json = toJson(ListChangelogsResponseSchema, newResponse);
- return OldListChangelogsResponseProto.fromJSON(json);
-};
-
-// Convert old GetChangelogRequest proto to proto-es
-export const convertOldGetChangelogRequestToNew = (oldRequest: OldGetChangelogRequest): NewGetChangelogRequest => {
- const json = OldGetChangelogRequestProto.toJSON(oldRequest) as any;
- return fromJson(GetChangelogRequestSchema, json);
-};
-
-// Convert proto-es GetChangelogRequest to old proto
-export const convertNewGetChangelogRequestToOld = (newRequest: NewGetChangelogRequest): OldGetChangelogRequest => {
- const json = toJson(GetChangelogRequestSchema, newRequest);
- return OldGetChangelogRequestProto.fromJSON(json);
-};
-
-// Convert old GetSchemaStringRequest proto to proto-es
-export const convertOldGetSchemaStringRequestToNew = (oldRequest: OldGetSchemaStringRequest): NewGetSchemaStringRequest => {
- const json = OldGetSchemaStringRequestProto.toJSON(oldRequest) as any;
- return fromJson(GetSchemaStringRequestSchema, json);
-};
-
-// Convert proto-es GetSchemaStringRequest to old proto
-export const convertNewGetSchemaStringRequestToOld = (newRequest: NewGetSchemaStringRequest): OldGetSchemaStringRequest => {
- const json = toJson(GetSchemaStringRequestSchema, newRequest);
- return OldGetSchemaStringRequestProto.fromJSON(json);
-};
-
diff --git a/frontend/src/utils/v1/database-group-conversions.ts b/frontend/src/utils/v1/database-group-conversions.ts
deleted file mode 100644
index 552eb79737..0000000000
--- a/frontend/src/utils/v1/database-group-conversions.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- DatabaseGroup as OldDatabaseGroup,
- DatabaseGroup_Database as OldDatabaseGroup_Database,
- DatabaseGroupView as OldDatabaseGroupView,
-} from "@/types/proto/v1/database_group_service";
-import {
- DatabaseGroup as OldDatabaseGroupProto,
- DatabaseGroup_Database as OldDatabaseGroup_DatabaseProto,
- DatabaseGroupView as OldDatabaseGroupViewEnum,
-} from "@/types/proto/v1/database_group_service";
-import type {
- DatabaseGroup as NewDatabaseGroup,
- DatabaseGroup_Database as NewDatabaseGroup_Database,
-} from "@/types/proto-es/v1/database_group_service_pb";
-import {
- DatabaseGroupSchema,
- DatabaseGroup_DatabaseSchema,
- DatabaseGroupView as NewDatabaseGroupView,
-} from "@/types/proto-es/v1/database_group_service_pb";
-
-// Convert old proto DatabaseGroup to proto-es DatabaseGroup
-export const convertOldDatabaseGroupToNew = (
- oldGroup: OldDatabaseGroup
-): NewDatabaseGroup => {
- const json = OldDatabaseGroupProto.toJSON(oldGroup) as any;
- return fromJson(DatabaseGroupSchema, json);
-};
-
-// Convert proto-es DatabaseGroup to old proto DatabaseGroup
-export const convertNewDatabaseGroupToOld = (
- newGroup: NewDatabaseGroup
-): OldDatabaseGroup => {
- const json = toJson(DatabaseGroupSchema, newGroup);
- return OldDatabaseGroupProto.fromJSON(json);
-};
-
-// Convert old DatabaseGroup_Database to new
-export const convertOldDatabaseGroup_DatabaseToNew = (
- oldDb: OldDatabaseGroup_Database
-): NewDatabaseGroup_Database => {
- const json = OldDatabaseGroup_DatabaseProto.toJSON(oldDb) as any;
- return fromJson(DatabaseGroup_DatabaseSchema, json);
-};
-
-// Convert new DatabaseGroup_Database to old
-export const convertNewDatabaseGroup_DatabaseToOld = (
- newDb: NewDatabaseGroup_Database
-): OldDatabaseGroup_Database => {
- const json = toJson(DatabaseGroup_DatabaseSchema, newDb);
- return OldDatabaseGroup_DatabaseProto.fromJSON(json);
-};
-
-// Convert old DatabaseGroupView enum to new
-export const convertOldDatabaseGroupViewToNew = (
- oldView: OldDatabaseGroupView
-): NewDatabaseGroupView => {
- switch (oldView) {
- case OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_UNSPECIFIED:
- return NewDatabaseGroupView.UNSPECIFIED;
- case OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_BASIC:
- return NewDatabaseGroupView.BASIC;
- case OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_FULL:
- return NewDatabaseGroupView.FULL;
- case OldDatabaseGroupViewEnum.UNRECOGNIZED:
- default:
- return NewDatabaseGroupView.UNSPECIFIED;
- }
-};
-
-// Convert new DatabaseGroupView enum to old
-export const convertNewDatabaseGroupViewToOld = (
- newView: NewDatabaseGroupView
-): OldDatabaseGroupView => {
- switch (newView) {
- case NewDatabaseGroupView.UNSPECIFIED:
- return OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_UNSPECIFIED;
- case NewDatabaseGroupView.BASIC:
- return OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_BASIC;
- case NewDatabaseGroupView.FULL:
- return OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_FULL;
- default:
- return OldDatabaseGroupViewEnum.DATABASE_GROUP_VIEW_UNSPECIFIED;
- }
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/google-type-expr-conversions.ts b/frontend/src/utils/v1/google-type-expr-conversions.ts
deleted file mode 100644
index e7114e6789..0000000000
--- a/frontend/src/utils/v1/google-type-expr-conversions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Expr as OldExpr } from "@/types/proto/google/type/expr";
-import { Expr as OldExprProto } from "@/types/proto/google/type/expr";
-import type { Expr as NewExpr } from "@/types/proto-es/google/type/expr_pb";
-import { ExprSchema } from "@/types/proto-es/google/type/expr_pb";
-
-// Convert old proto to proto-es
-export const convertOldGoogleTypeExprToNew = (oldExpr: OldExpr): NewExpr => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldExprProto.toJSON(oldExpr) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(ExprSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewGoogleTypeExprToOld = (newExpr: NewExpr): OldExpr => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(ExprSchema, newExpr);
- return OldExprProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/group-conversions.ts b/frontend/src/utils/v1/group-conversions.ts
deleted file mode 100644
index 9ca2a03d14..0000000000
--- a/frontend/src/utils/v1/group-conversions.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- Group as OldGroup,
- GroupMember as OldGroupMember,
- GroupMember_Role as OldGroupMember_Role
-} from "@/types/proto/v1/group_service";
-import {
- Group as OldGroupProto,
- GroupMember as OldGroupMemberProto,
- GroupMember_Role as OldGroupMember_RoleEnum
-} from "@/types/proto/v1/group_service";
-import type {
- Group as NewGroup,
- GroupMember as NewGroupMember
-} from "@/types/proto-es/v1/group_service_pb";
-import {
- GroupSchema,
- GroupMemberSchema,
- GroupMember_Role as NewGroupMember_Role
-} from "@/types/proto-es/v1/group_service_pb";
-
-// Convert old proto Group to proto-es Group
-export const convertOldGroupToNew = (oldGroup: OldGroup): NewGroup => {
- const json = OldGroupProto.toJSON(oldGroup) as any;
- return fromJson(GroupSchema, json);
-};
-
-// Convert proto-es Group to old proto Group
-export const convertNewGroupToOld = (newGroup: NewGroup): OldGroup => {
- const json = toJson(GroupSchema, newGroup);
- return OldGroupProto.fromJSON(json);
-};
-
-// Convert old proto GroupMember to proto-es GroupMember
-export const convertOldGroupMemberToNew = (oldMember: OldGroupMember): NewGroupMember => {
- const json = OldGroupMemberProto.toJSON(oldMember) as any;
- return fromJson(GroupMemberSchema, json);
-};
-
-// Convert proto-es GroupMember to old proto GroupMember
-export const convertNewGroupMemberToOld = (newMember: NewGroupMember): OldGroupMember => {
- const json = toJson(GroupMemberSchema, newMember);
- return OldGroupMemberProto.fromJSON(json);
-};
-
-// Convert old GroupMember_Role enum to new
-export const convertOldGroupMemberRoleToNew = (oldRole: OldGroupMember_Role): NewGroupMember_Role => {
- switch (oldRole) {
- case OldGroupMember_RoleEnum.ROLE_UNSPECIFIED:
- return NewGroupMember_Role.ROLE_UNSPECIFIED;
- case OldGroupMember_RoleEnum.OWNER:
- return NewGroupMember_Role.OWNER;
- case OldGroupMember_RoleEnum.MEMBER:
- return NewGroupMember_Role.MEMBER;
- case OldGroupMember_RoleEnum.UNRECOGNIZED:
- default:
- return NewGroupMember_Role.ROLE_UNSPECIFIED;
- }
-};
-
-// Convert new GroupMember_Role enum to old
-export const convertNewGroupMemberRoleToOld = (newRole: NewGroupMember_Role): OldGroupMember_Role => {
- switch (newRole) {
- case NewGroupMember_Role.ROLE_UNSPECIFIED:
- return OldGroupMember_RoleEnum.ROLE_UNSPECIFIED;
- case NewGroupMember_Role.OWNER:
- return OldGroupMember_RoleEnum.OWNER;
- case NewGroupMember_Role.MEMBER:
- return OldGroupMember_RoleEnum.MEMBER;
- default:
- return OldGroupMember_RoleEnum.ROLE_UNSPECIFIED;
- }
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/iam-conversions.ts b/frontend/src/utils/v1/iam-conversions.ts
deleted file mode 100644
index f02141641c..0000000000
--- a/frontend/src/utils/v1/iam-conversions.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { IamPolicy as OldIamPolicy, Binding as OldBinding } from "@/types/proto/v1/iam_policy";
-import { IamPolicy as OldIamPolicyProto, Binding as OldBindingProto } from "@/types/proto/v1/iam_policy";
-import type { IamPolicy as NewIamPolicy, Binding as NewBinding } from "@/types/proto-es/v1/iam_policy_pb";
-import { IamPolicySchema, BindingSchema } from "@/types/proto-es/v1/iam_policy_pb";
-
-// Convert old proto IamPolicy to proto-es IamPolicy
-export const convertOldIamPolicyToNew = (oldPolicy: OldIamPolicy): NewIamPolicy => {
- const json = OldIamPolicyProto.toJSON(oldPolicy) as any;
- return fromJson(IamPolicySchema, json);
-};
-
-// Convert proto-es IamPolicy to old proto IamPolicy
-export const convertNewIamPolicyToOld = (newPolicy: NewIamPolicy): OldIamPolicy => {
- const json = toJson(IamPolicySchema, newPolicy) as any;
- return OldIamPolicyProto.fromJSON(json);
-};
-
-// Convert old proto Binding to proto-es Binding
-export const convertOldBindingToNew = (oldBinding: OldBinding): NewBinding => {
- const json = OldBindingProto.toJSON(oldBinding) as any;
- return fromJson(BindingSchema, json);
-};
-
-// Convert proto-es Binding to old proto Binding
-export const convertNewBindingToOld = (newBinding: NewBinding): OldBinding => {
- const json = toJson(BindingSchema, newBinding) as any;
- return OldBindingProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/idp-conversions.ts b/frontend/src/utils/v1/idp-conversions.ts
deleted file mode 100644
index 03f0c2473a..0000000000
--- a/frontend/src/utils/v1/idp-conversions.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { IdentityProvider as OldIdentityProvider } from "@/types/proto/v1/idp_service";
-import { IdentityProvider as OldIdentityProviderProto } from "@/types/proto/v1/idp_service";
-import type { IdentityProvider as NewIdentityProvider } from "@/types/proto-es/v1/idp_service_pb";
-import { IdentityProviderSchema } from "@/types/proto-es/v1/idp_service_pb";
-import { IdentityProviderType as OldIdentityProviderType } from "@/types/proto/v1/idp_service";
-import { IdentityProviderType as NewIdentityProviderType } from "@/types/proto-es/v1/idp_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldIdentityProviderToNew = (oldProvider: OldIdentityProvider): NewIdentityProvider => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldIdentityProviderProto.toJSON(oldProvider) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(IdentityProviderSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewIdentityProviderToOld = (newProvider: NewIdentityProvider): OldIdentityProvider => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(IdentityProviderSchema, newProvider);
- return OldIdentityProviderProto.fromJSON(json);
-};
-
-// Convert old IdentityProviderType enum to new (string to numeric)
-export const convertOldIdentityProviderTypeToNew = (oldType: OldIdentityProviderType): NewIdentityProviderType => {
- const mapping: Record<OldIdentityProviderType, NewIdentityProviderType> = {
- [OldIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED]: NewIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
- [OldIdentityProviderType.OAUTH2]: NewIdentityProviderType.OAUTH2,
- [OldIdentityProviderType.OIDC]: NewIdentityProviderType.OIDC,
- [OldIdentityProviderType.LDAP]: NewIdentityProviderType.LDAP,
- [OldIdentityProviderType.UNRECOGNIZED]: NewIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED;
-};
-
-// Convert new IdentityProviderType enum to old (numeric to string)
-export const convertNewIdentityProviderTypeToOld = (newType: NewIdentityProviderType): OldIdentityProviderType => {
- const mapping: Record<NewIdentityProviderType, OldIdentityProviderType> = {
- [NewIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED]: OldIdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
- [NewIdentityProviderType.OAUTH2]: OldIdentityProviderType.OAUTH2,
- [NewIdentityProviderType.OIDC]: OldIdentityProviderType.OIDC,
- [NewIdentityProviderType.LDAP]: OldIdentityProviderType.LDAP,
- };
- return mapping[newType] ?? OldIdentityProviderType.UNRECOGNIZED;
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/index.ts b/frontend/src/utils/v1/index.ts
index 784ad6ccb7..9463e350e2 100644
--- a/frontend/src/utils/v1/index.ts
+++ b/frontend/src/utils/v1/index.ts
@@ -1,4 +1,3 @@
-export * from "./audit-log-conversions";
export * from "./common";
export * from "./environment";
export * from "./instance";
diff --git a/frontend/src/utils/v1/instance-conversions.ts b/frontend/src/utils/v1/instance-conversions.ts
index 3c2953a1e0..48c805e411 100644
--- a/frontend/src/utils/v1/instance-conversions.ts
+++ b/frontend/src/utils/v1/instance-conversions.ts
@@ -1,258 +1,8 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
import {
- Instance as OldInstance,
- DataSource as OldDataSource,
- UpdateInstanceRequest as OldUpdateInstanceRequest,
- GetInstanceRequest as OldGetInstanceRequest,
- ListInstancesRequest as OldListInstancesRequest,
- ListInstancesResponse as OldListInstancesResponse,
- CreateInstanceRequest as OldCreateInstanceRequest,
- DeleteInstanceRequest as OldDeleteInstanceRequest,
- UndeleteInstanceRequest as OldUndeleteInstanceRequest,
- SyncInstanceRequest as OldSyncInstanceRequest,
- BatchSyncInstancesRequest as OldBatchSyncInstancesRequest,
- DataSourceType as OldDataSourceType,
- DataSource_AuthenticationType as OldDataSource_AuthenticationType
-} from "@/types/proto/v1/instance_service";
-import {
- type Instance as NewInstance,
- type DataSource as NewDataSource,
- type UpdateInstanceRequest as NewUpdateInstanceRequest,
- type GetInstanceRequest as NewGetInstanceRequest,
- type ListInstancesRequest as NewListInstancesRequest,
- type ListInstancesResponse as NewListInstancesResponse,
- type CreateInstanceRequest as NewCreateInstanceRequest,
- type DeleteInstanceRequest as NewDeleteInstanceRequest,
- type UndeleteInstanceRequest as NewUndeleteInstanceRequest,
- type SyncInstanceRequest as NewSyncInstanceRequest,
- type BatchSyncInstancesRequest as NewBatchSyncInstancesRequest,
DataSourceType as NewDataSourceType,
DataSource_AuthenticationType as NewDataSource_AuthenticationType,
- InstanceSchema,
- BatchSyncInstancesRequestSchema,
- SyncInstanceRequestSchema,
- UndeleteInstanceRequestSchema,
- CreateInstanceRequestSchema,
- DataSourceSchema,
- UpdateInstanceRequestSchema,
- GetInstanceRequestSchema,
- ListInstancesRequestSchema,
- ListInstancesResponseSchema,
- DeleteInstanceRequestSchema,
} from "@/types/proto-es/v1/instance_service_pb";
-// Convert old proto to proto-es
-export const convertOldInstanceToNew = (oldInstance: OldInstance): NewInstance => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldInstance.toJSON(oldInstance) as any; // Type assertion needed due to proto type incompatibility
-
- // Fix Duration fields: proto-es expects string format, old proto outputs object
- if (json.syncInterval && typeof json.syncInterval === 'object') {
- const duration = json.syncInterval as { seconds?: string | number; nanos?: number };
- if (!duration.seconds && !duration.nanos) {
- delete json.syncInterval;
- } else {
- const seconds = Number(duration.seconds || 0) + (duration.nanos || 0) / 1e9;
- json.syncInterval = `${seconds}s`;
- }
- }
-
- return fromJson(InstanceSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewInstanceToOld = (newInstance: NewInstance): OldInstance => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(InstanceSchema, newInstance);
- return OldInstance.fromJSON(json);
-};
-
-// Convert old proto DataSource to proto-es
-export const convertOldDataSourceToNew = (oldDataSource: OldDataSource): NewDataSource => {
- const json = OldDataSource.toJSON(oldDataSource) as any;
- return fromJson(DataSourceSchema, json);
-};
-
-// Convert proto-es DataSource to old proto
-export const convertNewDataSourceToOld = (newDataSource: NewDataSource): OldDataSource => {
- const json = toJson(DataSourceSchema, newDataSource);
- return OldDataSource.fromJSON(json);
-};
-
-// Convert old proto UpdateInstanceRequest to proto-es
-export const convertOldUpdateInstanceRequestToNew = (oldRequest: OldUpdateInstanceRequest): NewUpdateInstanceRequest => {
- const json = OldUpdateInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(UpdateInstanceRequestSchema, json);
-};
-
-// Convert proto-es UpdateInstanceRequest to old proto
-export const convertNewUpdateInstanceRequestToOld = (newRequest: NewUpdateInstanceRequest): OldUpdateInstanceRequest => {
- const json = toJson(UpdateInstanceRequestSchema, newRequest);
- return OldUpdateInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto GetInstanceRequest to proto-es
-export const convertOldGetInstanceRequestToNew = (oldRequest: OldGetInstanceRequest): NewGetInstanceRequest => {
- const json = OldGetInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(GetInstanceRequestSchema, json);
-};
-
-// Convert proto-es GetInstanceRequest to old proto
-export const convertNewGetInstanceRequestToOld = (newRequest: NewGetInstanceRequest): OldGetInstanceRequest => {
- const json = toJson(GetInstanceRequestSchema, newRequest);
- return OldGetInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto ListInstancesRequest to proto-es
-export const convertOldListInstancesRequestToNew = (oldRequest: OldListInstancesRequest): NewListInstancesRequest => {
- const json = OldListInstancesRequest.toJSON(oldRequest) as any;
- return fromJson(ListInstancesRequestSchema, json);
-};
-
-// Convert proto-es ListInstancesRequest to old proto
-export const convertNewListInstancesRequestToOld = (newRequest: NewListInstancesRequest): OldListInstancesRequest => {
- const json = toJson(ListInstancesRequestSchema, newRequest);
- return OldListInstancesRequest.fromJSON(json);
-};
-
-// Convert old proto ListInstancesResponse to proto-es
-export const convertOldListInstancesResponseToNew = (oldResponse: OldListInstancesResponse): NewListInstancesResponse => {
- const json = OldListInstancesResponse.toJSON(oldResponse) as any;
- return fromJson(ListInstancesResponseSchema, json);
-};
-
-// Convert proto-es ListInstancesResponse to old proto
-export const convertNewListInstancesResponseToOld = (newResponse: NewListInstancesResponse): OldListInstancesResponse => {
- const json = toJson(ListInstancesResponseSchema, newResponse);
- return OldListInstancesResponse.fromJSON(json);
-};
-
-// Convert old proto CreateInstanceRequest to proto-es
-export const convertOldCreateInstanceRequestToNew = (oldRequest: OldCreateInstanceRequest): NewCreateInstanceRequest => {
- const json = OldCreateInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(CreateInstanceRequestSchema, json);
-};
-
-// Convert proto-es CreateInstanceRequest to old proto
-export const convertNewCreateInstanceRequestToOld = (newRequest: NewCreateInstanceRequest): OldCreateInstanceRequest => {
- const json = toJson(CreateInstanceRequestSchema, newRequest);
- return OldCreateInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto DeleteInstanceRequest to proto-es
-export const convertOldDeleteInstanceRequestToNew = (oldRequest: OldDeleteInstanceRequest): NewDeleteInstanceRequest => {
- const json = OldDeleteInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(DeleteInstanceRequestSchema, json);
-};
-
-// Convert proto-es DeleteInstanceRequest to old proto
-export const convertNewDeleteInstanceRequestToOld = (newRequest: NewDeleteInstanceRequest): OldDeleteInstanceRequest => {
- const json = toJson(DeleteInstanceRequestSchema, newRequest);
- return OldDeleteInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto UndeleteInstanceRequest to proto-es
-export const convertOldUndeleteInstanceRequestToNew = (oldRequest: OldUndeleteInstanceRequest): NewUndeleteInstanceRequest => {
- const json = OldUndeleteInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(UndeleteInstanceRequestSchema, json);
-};
-
-// Convert proto-es UndeleteInstanceRequest to old proto
-export const convertNewUndeleteInstanceRequestToOld = (newRequest: NewUndeleteInstanceRequest): OldUndeleteInstanceRequest => {
- const json = toJson(UndeleteInstanceRequestSchema, newRequest);
- return OldUndeleteInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto SyncInstanceRequest to proto-es
-export const convertOldSyncInstanceRequestToNew = (oldRequest: OldSyncInstanceRequest): NewSyncInstanceRequest => {
- const json = OldSyncInstanceRequest.toJSON(oldRequest) as any;
- return fromJson(SyncInstanceRequestSchema, json);
-};
-
-// Convert proto-es SyncInstanceRequest to old proto
-export const convertNewSyncInstanceRequestToOld = (newRequest: NewSyncInstanceRequest): OldSyncInstanceRequest => {
- const json = toJson(SyncInstanceRequestSchema, newRequest);
- return OldSyncInstanceRequest.fromJSON(json);
-};
-
-// Convert old proto BatchSyncInstancesRequest to proto-es
-export const convertOldBatchSyncInstancesRequestToNew = (oldRequest: OldBatchSyncInstancesRequest): NewBatchSyncInstancesRequest => {
- const json = OldBatchSyncInstancesRequest.toJSON(oldRequest) as any;
- return fromJson(BatchSyncInstancesRequestSchema, json);
-};
-
-// Convert proto-es BatchSyncInstancesRequest to old proto
-export const convertNewBatchSyncInstancesRequestToOld = (newRequest: NewBatchSyncInstancesRequest): OldBatchSyncInstancesRequest => {
- const json = toJson(BatchSyncInstancesRequestSchema, newRequest);
- return OldBatchSyncInstancesRequest.fromJSON(json);
-};
-
-// ========== ENUM CONVERSIONS ==========
-
-// Convert proto-es DataSourceType to old proto DataSourceType
-export const convertDataSourceTypeToOld = (dataSourceType: NewDataSourceType): OldDataSourceType => {
- switch (dataSourceType) {
- case NewDataSourceType.DATA_SOURCE_UNSPECIFIED:
- return OldDataSourceType.DATA_SOURCE_UNSPECIFIED;
- case NewDataSourceType.ADMIN:
- return OldDataSourceType.ADMIN;
- case NewDataSourceType.READ_ONLY:
- return OldDataSourceType.READ_ONLY;
- default:
- return OldDataSourceType.DATA_SOURCE_UNSPECIFIED;
- }
-};
-
-// Convert old proto DataSourceType to proto-es DataSourceType
-export const convertDataSourceTypeToNew = (dataSourceType: OldDataSourceType): NewDataSourceType => {
- switch (dataSourceType) {
- case OldDataSourceType.DATA_SOURCE_UNSPECIFIED:
- return NewDataSourceType.DATA_SOURCE_UNSPECIFIED;
- case OldDataSourceType.ADMIN:
- return NewDataSourceType.ADMIN;
- case OldDataSourceType.READ_ONLY:
- return NewDataSourceType.READ_ONLY;
- default:
- return NewDataSourceType.DATA_SOURCE_UNSPECIFIED;
- }
-};
-
-// Convert proto-es DataSource_AuthenticationType to old proto DataSource_AuthenticationType
-export const convertDataSourceAuthenticationTypeToOld = (authType: NewDataSource_AuthenticationType): OldDataSource_AuthenticationType => {
- switch (authType) {
- case NewDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED:
- return OldDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- case NewDataSource_AuthenticationType.PASSWORD:
- return OldDataSource_AuthenticationType.PASSWORD;
- case NewDataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM:
- return OldDataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM;
- case NewDataSource_AuthenticationType.AWS_RDS_IAM:
- return OldDataSource_AuthenticationType.AWS_RDS_IAM;
- case NewDataSource_AuthenticationType.AZURE_IAM:
- return OldDataSource_AuthenticationType.AZURE_IAM;
- default:
- return OldDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- }
-};
-
-// Convert old proto DataSource_AuthenticationType to proto-es DataSource_AuthenticationType
-export const convertDataSourceAuthenticationTypeToNew = (authType: OldDataSource_AuthenticationType): NewDataSource_AuthenticationType => {
- switch (authType) {
- case OldDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED:
- return NewDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- case OldDataSource_AuthenticationType.PASSWORD:
- return NewDataSource_AuthenticationType.PASSWORD;
- case OldDataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM:
- return NewDataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM;
- case OldDataSource_AuthenticationType.AWS_RDS_IAM:
- return NewDataSource_AuthenticationType.AWS_RDS_IAM;
- case OldDataSource_AuthenticationType.AZURE_IAM:
- return NewDataSource_AuthenticationType.AZURE_IAM;
- default:
- return NewDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- }
-};
-
// ========== SCOPE VALUE CONVERSIONS (for AdvancedSearch components) ==========
// Convert scope value (string or number) to proto-es DataSourceType
@@ -298,18 +48,3 @@ export const convertScopeValueToDataSourceAuthenticationType = (value: string |
return NewDataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
}
};
-
-// ========== COMPOSED INSTANCE ADAPTERS ==========
-
-import type { ComposedInstance as NewComposedInstance } from "@/types/v1/instance";
-
-export const adaptComposedInstance = {
- fromLegacy: (legacy: any): NewComposedInstance => {
- // Since ComposedInstance is already using proto-es types, just return it
- return legacy as NewComposedInstance;
- },
- toLegacy: (current: NewComposedInstance): any => {
- // Since ComposedInstance is already using proto-es types, just return it
- return current;
- }
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/instance-role-conversions.ts b/frontend/src/utils/v1/instance-role-conversions.ts
deleted file mode 100644
index 6313fa94ed..0000000000
--- a/frontend/src/utils/v1/instance-role-conversions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { InstanceRole as OldInstanceRole } from "@/types/proto/v1/instance_role_service";
-import { InstanceRole as OldInstanceRoleProto } from "@/types/proto/v1/instance_role_service";
-import type { InstanceRole as NewInstanceRole } from "@/types/proto-es/v1/instance_role_service_pb";
-import { InstanceRoleSchema } from "@/types/proto-es/v1/instance_role_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldInstanceRoleToNew = (oldRole: OldInstanceRole): NewInstanceRole => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldInstanceRoleProto.toJSON(oldRole) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(InstanceRoleSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewInstanceRoleToOld = (newRole: NewInstanceRole): OldInstanceRole => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(InstanceRoleSchema, newRole);
- return OldInstanceRoleProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/issue-conversions.ts b/frontend/src/utils/v1/issue-conversions.ts
deleted file mode 100644
index 1d0717d07d..0000000000
--- a/frontend/src/utils/v1/issue-conversions.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Issue as OldIssue } from "@/types/proto/v1/issue_service";
-import { Issue as OldIssueProto } from "@/types/proto/v1/issue_service";
-import type { IssueComment as OldIssueComment } from "@/types/proto/v1/issue_service";
-import { IssueComment as OldIssueCommentProto } from "@/types/proto/v1/issue_service";
-import type { Issue as NewIssue } from "@/types/proto-es/v1/issue_service_pb";
-import { IssueSchema } from "@/types/proto-es/v1/issue_service_pb";
-import type { IssueComment as NewIssueComment } from "@/types/proto-es/v1/issue_service_pb";
-import { IssueCommentSchema } from "@/types/proto-es/v1/issue_service_pb";
-
-// Convert old proto Issue to proto-es Issue
-export const convertOldIssueToNew = (oldIssue: OldIssue): NewIssue => {
- const json = OldIssueProto.toJSON(oldIssue) as any;
- return fromJson(IssueSchema, json);
-};
-
-// Convert proto-es Issue to old proto Issue
-export const convertNewIssueToOld = (newIssue: NewIssue): OldIssue => {
- const json = toJson(IssueSchema, newIssue);
- return OldIssueProto.fromJSON(json);
-};
-
-// Convert old proto IssueComment to proto-es IssueComment
-export const convertOldIssueCommentToNew = (oldComment: OldIssueComment): NewIssueComment => {
- const json = OldIssueCommentProto.toJSON(oldComment) as any;
- return fromJson(IssueCommentSchema, json);
-};
-
-// Convert proto-es IssueComment to old proto IssueComment
-export const convertNewIssueCommentToOld = (newComment: NewIssueComment): OldIssueComment => {
- const json = toJson(IssueCommentSchema, newComment);
- return OldIssueCommentProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/org-policy-conversions.ts b/frontend/src/utils/v1/org-policy-conversions.ts
deleted file mode 100644
index 3cb7203716..0000000000
--- a/frontend/src/utils/v1/org-policy-conversions.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Policy as OldPolicy } from "@/types/proto/v1/org_policy_service";
-import { Policy as OldPolicyProto } from "@/types/proto/v1/org_policy_service";
-import type { Policy as NewPolicy } from "@/types/proto-es/v1/org_policy_service_pb";
-import { PolicySchema } from "@/types/proto-es/v1/org_policy_service_pb";
-import { PolicyResourceType as OldPolicyResourceType } from "@/types/proto/v1/org_policy_service";
-import { PolicyResourceType as NewPolicyResourceType } from "@/types/proto-es/v1/org_policy_service_pb";
-import { PolicyType as OldPolicyType } from "@/types/proto/v1/org_policy_service";
-import { PolicyType as NewPolicyType } from "@/types/proto-es/v1/org_policy_service_pb";
-import { SQLReviewRuleLevel as OldSQLReviewRuleLevel } from "@/types/proto/v1/org_policy_service";
-import { SQLReviewRuleLevel as NewSQLReviewRuleLevel } from "@/types/proto-es/v1/org_policy_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldPolicyToNew = (oldPolicy: OldPolicy): NewPolicy => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldPolicyProto.toJSON(oldPolicy) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(PolicySchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewPolicyToOld = (newPolicy: NewPolicy): OldPolicy => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(PolicySchema, newPolicy);
- return OldPolicyProto.fromJSON(json);
-};
-
-// Convert old PolicyResourceType enum to new (string to numeric)
-export const convertOldPolicyResourceTypeToNew = (oldType: OldPolicyResourceType): NewPolicyResourceType => {
- const mapping: Record<OldPolicyResourceType, NewPolicyResourceType> = {
- [OldPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED]: NewPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
- [OldPolicyResourceType.WORKSPACE]: NewPolicyResourceType.WORKSPACE,
- [OldPolicyResourceType.ENVIRONMENT]: NewPolicyResourceType.ENVIRONMENT,
- [OldPolicyResourceType.PROJECT]: NewPolicyResourceType.PROJECT,
- [OldPolicyResourceType.UNRECOGNIZED]: NewPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED;
-};
-
-// Convert new PolicyResourceType enum to old (numeric to string)
-export const convertNewPolicyResourceTypeToOld = (newType: NewPolicyResourceType): OldPolicyResourceType => {
- const mapping: Record<NewPolicyResourceType, OldPolicyResourceType> = {
- [NewPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED]: OldPolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
- [NewPolicyResourceType.WORKSPACE]: OldPolicyResourceType.WORKSPACE,
- [NewPolicyResourceType.ENVIRONMENT]: OldPolicyResourceType.ENVIRONMENT,
- [NewPolicyResourceType.PROJECT]: OldPolicyResourceType.PROJECT,
- };
- return mapping[newType] ?? OldPolicyResourceType.UNRECOGNIZED;
-};
-
-// Convert old PolicyType enum to new (string to numeric)
-export const convertOldPolicyTypeToNew = (oldType: OldPolicyType): NewPolicyType => {
- const mapping: Record<OldPolicyType, NewPolicyType> = {
- [OldPolicyType.POLICY_TYPE_UNSPECIFIED]: NewPolicyType.POLICY_TYPE_UNSPECIFIED,
- [OldPolicyType.ROLLOUT_POLICY]: NewPolicyType.ROLLOUT_POLICY,
- [OldPolicyType.DISABLE_COPY_DATA]: NewPolicyType.DISABLE_COPY_DATA,
- [OldPolicyType.MASKING_RULE]: NewPolicyType.MASKING_RULE,
- [OldPolicyType.MASKING_EXCEPTION]: NewPolicyType.MASKING_EXCEPTION,
- [OldPolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW]: NewPolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW,
- [OldPolicyType.TAG]: NewPolicyType.TAG,
- [OldPolicyType.DATA_SOURCE_QUERY]: NewPolicyType.DATA_SOURCE_QUERY,
- [OldPolicyType.DATA_EXPORT]: NewPolicyType.DATA_EXPORT,
- [OldPolicyType.DATA_QUERY]: NewPolicyType.DATA_QUERY,
- [OldPolicyType.UNRECOGNIZED]: NewPolicyType.POLICY_TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewPolicyType.POLICY_TYPE_UNSPECIFIED;
-};
-
-// Convert new PolicyType enum to old (numeric to string)
-export const convertNewPolicyTypeToOld = (newType: NewPolicyType): OldPolicyType => {
- const mapping: Record<NewPolicyType, OldPolicyType> = {
- [NewPolicyType.POLICY_TYPE_UNSPECIFIED]: OldPolicyType.POLICY_TYPE_UNSPECIFIED,
- [NewPolicyType.ROLLOUT_POLICY]: OldPolicyType.ROLLOUT_POLICY,
- [NewPolicyType.DISABLE_COPY_DATA]: OldPolicyType.DISABLE_COPY_DATA,
- [NewPolicyType.MASKING_RULE]: OldPolicyType.MASKING_RULE,
- [NewPolicyType.MASKING_EXCEPTION]: OldPolicyType.MASKING_EXCEPTION,
- [NewPolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW]: OldPolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW,
- [NewPolicyType.TAG]: OldPolicyType.TAG,
- [NewPolicyType.DATA_SOURCE_QUERY]: OldPolicyType.DATA_SOURCE_QUERY,
- [NewPolicyType.DATA_EXPORT]: OldPolicyType.DATA_EXPORT,
- [NewPolicyType.DATA_QUERY]: OldPolicyType.DATA_QUERY,
- };
- return mapping[newType] ?? OldPolicyType.UNRECOGNIZED;
-};
-
-// Convert old SQLReviewRuleLevel enum to new (string to numeric)
-export const convertOldSQLReviewRuleLevelToNew = (oldLevel: OldSQLReviewRuleLevel): NewSQLReviewRuleLevel => {
- const mapping: Record<OldSQLReviewRuleLevel, NewSQLReviewRuleLevel> = {
- [OldSQLReviewRuleLevel.LEVEL_UNSPECIFIED]: NewSQLReviewRuleLevel.LEVEL_UNSPECIFIED,
- [OldSQLReviewRuleLevel.ERROR]: NewSQLReviewRuleLevel.ERROR,
- [OldSQLReviewRuleLevel.WARNING]: NewSQLReviewRuleLevel.WARNING,
- [OldSQLReviewRuleLevel.DISABLED]: NewSQLReviewRuleLevel.DISABLED,
- [OldSQLReviewRuleLevel.UNRECOGNIZED]: NewSQLReviewRuleLevel.LEVEL_UNSPECIFIED,
- };
- return mapping[oldLevel] ?? NewSQLReviewRuleLevel.LEVEL_UNSPECIFIED;
-};
-
-// Convert new SQLReviewRuleLevel enum to old (numeric to string)
-export const convertNewSQLReviewRuleLevelToOld = (newLevel: NewSQLReviewRuleLevel): OldSQLReviewRuleLevel => {
- const mapping: Record<NewSQLReviewRuleLevel, OldSQLReviewRuleLevel> = {
- [NewSQLReviewRuleLevel.LEVEL_UNSPECIFIED]: OldSQLReviewRuleLevel.LEVEL_UNSPECIFIED,
- [NewSQLReviewRuleLevel.ERROR]: OldSQLReviewRuleLevel.ERROR,
- [NewSQLReviewRuleLevel.WARNING]: OldSQLReviewRuleLevel.WARNING,
- [NewSQLReviewRuleLevel.DISABLED]: OldSQLReviewRuleLevel.DISABLED,
- };
- return mapping[newLevel] ?? OldSQLReviewRuleLevel.UNRECOGNIZED;
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/plan-conversions.ts b/frontend/src/utils/v1/plan-conversions.ts
deleted file mode 100644
index 73c4e4bfac..0000000000
--- a/frontend/src/utils/v1/plan-conversions.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Plan as OldPlan } from "@/types/proto/v1/plan_service";
-import { Plan as OldPlanProto } from "@/types/proto/v1/plan_service";
-import type { Plan as NewPlan } from "@/types/proto-es/v1/plan_service_pb";
-import { PlanSchema } from "@/types/proto-es/v1/plan_service_pb";
-import type { PlanCheckRun as OldPlanCheckRun } from "@/types/proto/v1/plan_service";
-import { PlanCheckRun as OldPlanCheckRunProto } from "@/types/proto/v1/plan_service";
-import type { PlanCheckRun as NewPlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
-import { PlanCheckRunSchema } from "@/types/proto-es/v1/plan_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldPlanToNew = (oldPlan: OldPlan): NewPlan => {
- const json = OldPlanProto.toJSON(oldPlan) as any;
- return fromJson(PlanSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewPlanToOld = (newPlan: NewPlan): OldPlan => {
- const json = toJson(PlanSchema, newPlan);
- return OldPlanProto.fromJSON(json);
-};
-
-// Convert old proto PlanCheckRun to proto-es
-export const convertOldPlanCheckRunToNew = (oldRun: OldPlanCheckRun): NewPlanCheckRun => {
- const json = OldPlanCheckRunProto.toJSON(oldRun) as any;
- return fromJson(PlanCheckRunSchema, json);
-};
-
-// Convert proto-es PlanCheckRun to old proto
-export const convertNewPlanCheckRunToOld = (newRun: NewPlanCheckRun): OldPlanCheckRun => {
- const json = toJson(PlanCheckRunSchema, newRun);
- return OldPlanCheckRunProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/project-conversions.ts b/frontend/src/utils/v1/project-conversions.ts
deleted file mode 100644
index 043fd6ae9d..0000000000
--- a/frontend/src/utils/v1/project-conversions.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Project as OldProject, Webhook as OldWebhook } from "@/types/proto/v1/project_service";
-import { Project as OldProjectProto, Webhook as OldWebhookProto } from "@/types/proto/v1/project_service";
-import type { IamPolicy as OldIamPolicy } from "@/types/proto/v1/iam_policy";
-import { IamPolicy as OldIamPolicyProto } from "@/types/proto/v1/iam_policy";
-import type { Project as NewProject, Webhook as NewWebhook } from "@/types/proto-es/v1/project_service_pb";
-import { ProjectSchema, WebhookSchema } from "@/types/proto-es/v1/project_service_pb";
-import type { IamPolicy as NewIamPolicy } from "@/types/proto-es/v1/iam_policy_pb";
-import { IamPolicySchema } from "@/types/proto-es/v1/iam_policy_pb";
-
-// Convert old proto to proto-es
-export const convertOldProjectToNew = (oldProject: OldProject): NewProject => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldProjectProto.toJSON(oldProject) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(ProjectSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewProjectToOld = (newProject: NewProject): OldProject => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(ProjectSchema, newProject);
- return OldProjectProto.fromJSON(json);
-};
-
-// Convert old webhook proto to proto-es
-export const convertOldWebhookToNew = (oldWebhook: OldWebhook): NewWebhook => {
- const json = OldWebhookProto.toJSON(oldWebhook) as any;
- return fromJson(WebhookSchema, json);
-};
-
-// Convert proto-es webhook to old proto
-export const convertNewWebhookToOld = (newWebhook: NewWebhook): OldWebhook => {
- const json = toJson(WebhookSchema, newWebhook);
- return OldWebhookProto.fromJSON(json);
-};
-
-// Convert old IamPolicy proto to proto-es
-export const convertOldIamPolicyToNew = (oldPolicy: OldIamPolicy): NewIamPolicy => {
- const json = OldIamPolicyProto.toJSON(oldPolicy) as any;
- return fromJson(IamPolicySchema, json);
-};
-
-// Convert proto-es IamPolicy to old proto
-export const convertNewIamPolicyToOld = (newPolicy: NewIamPolicy): OldIamPolicy => {
- const json = toJson(IamPolicySchema, newPolicy);
- return OldIamPolicyProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/release-conversions.ts b/frontend/src/utils/v1/release-conversions.ts
deleted file mode 100644
index d004787f14..0000000000
--- a/frontend/src/utils/v1/release-conversions.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Release as OldRelease, CheckReleaseResponse as OldCheckReleaseResponse } from "@/types/proto/v1/release_service";
-import { Release as OldReleaseProto, CheckReleaseResponse as OldCheckReleaseResponseProto, Release_File_ChangeType as OldChangeType } from "@/types/proto/v1/release_service";
-import type { Release as NewRelease, CheckReleaseResponse as NewCheckReleaseResponse } from "@/types/proto-es/v1/release_service_pb";
-import { ReleaseSchema, CheckReleaseResponseSchema, Release_File_ChangeType as NewChangeType } from "@/types/proto-es/v1/release_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldReleaseToNew = (oldRelease: OldRelease): NewRelease => {
- const json = OldReleaseProto.toJSON(oldRelease) as any;
- return fromJson(ReleaseSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewReleaseToOld = (newRelease: NewRelease): OldRelease => {
- const json = toJson(ReleaseSchema, newRelease);
- return OldReleaseProto.fromJSON(json);
-};
-
-// Convert proto-es CheckReleaseResponse to old proto
-export const convertNewCheckReleaseResponseToOld = (newResponse: NewCheckReleaseResponse): OldCheckReleaseResponse => {
- const json = toJson(CheckReleaseResponseSchema, newResponse);
- return OldCheckReleaseResponseProto.fromJSON(json);
-};
-
-// Convert old ChangeType enum to new ChangeType enum
-export const convertOldChangeTypeToNew = (oldChangeType: OldChangeType): NewChangeType => {
- switch (oldChangeType) {
- case OldChangeType.DDL:
- return NewChangeType.DDL;
- case OldChangeType.DDL_GHOST:
- return NewChangeType.DDL_GHOST;
- case OldChangeType.DML:
- return NewChangeType.DML;
- default:
- return NewChangeType.CHANGE_TYPE_UNSPECIFIED;
- }
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/review-config-conversions.ts b/frontend/src/utils/v1/review-config-conversions.ts
deleted file mode 100644
index 9bfc2eeef2..0000000000
--- a/frontend/src/utils/v1/review-config-conversions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { ReviewConfig as OldReviewConfig } from "@/types/proto/v1/review_config_service";
-import { ReviewConfig as OldReviewConfigProto } from "@/types/proto/v1/review_config_service";
-import type { ReviewConfig as NewReviewConfig } from "@/types/proto-es/v1/review_config_service_pb";
-import { ReviewConfigSchema } from "@/types/proto-es/v1/review_config_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldReviewConfigToNew = (oldReviewConfig: OldReviewConfig): NewReviewConfig => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldReviewConfigProto.toJSON(oldReviewConfig) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(ReviewConfigSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewReviewConfigToOld = (newReviewConfig: NewReviewConfig): OldReviewConfig => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(ReviewConfigSchema, newReviewConfig);
- return OldReviewConfigProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/revision-conversions.ts b/frontend/src/utils/v1/revision-conversions.ts
deleted file mode 100644
index eb472d38f4..0000000000
--- a/frontend/src/utils/v1/revision-conversions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Revision as OldRevision } from "@/types/proto/v1/revision_service";
-import { Revision as OldRevisionProto } from "@/types/proto/v1/revision_service";
-import type { Revision as NewRevision } from "@/types/proto-es/v1/revision_service_pb";
-import { RevisionSchema } from "@/types/proto-es/v1/revision_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldRevisionToNew = (oldRevision: OldRevision): NewRevision => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldRevisionProto.toJSON(oldRevision) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(RevisionSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewRevisionToOld = (newRevision: NewRevision): OldRevision => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(RevisionSchema, newRevision);
- return OldRevisionProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/risk-conversions.ts b/frontend/src/utils/v1/risk-conversions.ts
deleted file mode 100644
index a065cf5158..0000000000
--- a/frontend/src/utils/v1/risk-conversions.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Risk as OldRisk } from "@/types/proto/v1/risk_service";
-import { Risk as OldRiskProto } from "@/types/proto/v1/risk_service";
-import type { Risk as NewRisk } from "@/types/proto-es/v1/risk_service_pb";
-import { RiskSchema } from "@/types/proto-es/v1/risk_service_pb";
-import { Risk_Source as OldRiskSource } from "@/types/proto/v1/risk_service";
-import { Risk_Source as NewRiskSource } from "@/types/proto-es/v1/risk_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldRiskToNew = (oldRisk: OldRisk): NewRisk => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldRiskProto.toJSON(oldRisk) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(RiskSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewRiskToOld = (newRisk: NewRisk): OldRisk => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(RiskSchema, newRisk);
- return OldRiskProto.fromJSON(json);
-};
-
-// Convert old Risk_Source enum to new (string to numeric)
-export const convertOldRiskSourceToNew = (oldSource: OldRiskSource): NewRiskSource => {
- const mapping: Record<OldRiskSource, NewRiskSource> = {
- [OldRiskSource.SOURCE_UNSPECIFIED]: NewRiskSource.SOURCE_UNSPECIFIED,
- [OldRiskSource.DDL]: NewRiskSource.DDL,
- [OldRiskSource.DML]: NewRiskSource.DML,
- [OldRiskSource.CREATE_DATABASE]: NewRiskSource.CREATE_DATABASE,
- [OldRiskSource.DATA_EXPORT]: NewRiskSource.DATA_EXPORT,
- [OldRiskSource.REQUEST_ROLE]: NewRiskSource.REQUEST_ROLE,
- [OldRiskSource.UNRECOGNIZED]: NewRiskSource.SOURCE_UNSPECIFIED,
- };
- return mapping[oldSource] ?? NewRiskSource.SOURCE_UNSPECIFIED;
-};
-
-// Convert new Risk_Source enum to old (numeric to string)
-export const convertNewRiskSourceToOld = (newSource: NewRiskSource): OldRiskSource => {
- const mapping: Record<NewRiskSource, OldRiskSource> = {
- [NewRiskSource.SOURCE_UNSPECIFIED]: OldRiskSource.SOURCE_UNSPECIFIED,
- [NewRiskSource.DDL]: OldRiskSource.DDL,
- [NewRiskSource.DML]: OldRiskSource.DML,
- [NewRiskSource.CREATE_DATABASE]: OldRiskSource.CREATE_DATABASE,
- [NewRiskSource.DATA_EXPORT]: OldRiskSource.DATA_EXPORT,
- [NewRiskSource.REQUEST_ROLE]: OldRiskSource.REQUEST_ROLE,
- };
- return mapping[newSource] ?? OldRiskSource.UNRECOGNIZED;
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/role-conversions.ts b/frontend/src/utils/v1/role-conversions.ts
deleted file mode 100644
index 469a12c1d2..0000000000
--- a/frontend/src/utils/v1/role-conversions.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- Role as OldRole,
- Role_Type as OldRoleType
-} from "@/types/proto/v1/role_service";
-import {
- Role as OldRoleProto,
- Role_Type as OldRoleTypeEnum
-} from "@/types/proto/v1/role_service";
-import type {
- Role as NewRole
-} from "@/types/proto-es/v1/role_service_pb";
-import {
- RoleSchema,
- Role_Type as NewRoleType
-} from "@/types/proto-es/v1/role_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldRoleToNew = (oldRole: OldRole): NewRole => {
- const json = OldRoleProto.toJSON(oldRole) as any;
- return fromJson(RoleSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewRoleToOld = (newRole: NewRole): OldRole => {
- const json = toJson(RoleSchema, newRole);
- return OldRoleProto.fromJSON(json);
-};
-
-// Convert old role type enum to new enum
-export const convertOldRoleTypeToNew = (oldType: OldRoleType): NewRoleType => {
- const mapping: Record<OldRoleType, NewRoleType> = {
- [OldRoleTypeEnum.TYPE_UNSPECIFIED]: NewRoleType.TYPE_UNSPECIFIED,
- [OldRoleTypeEnum.BUILT_IN]: NewRoleType.BUILT_IN,
- [OldRoleTypeEnum.CUSTOM]: NewRoleType.CUSTOM,
- [OldRoleTypeEnum.UNRECOGNIZED]: NewRoleType.TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewRoleType.TYPE_UNSPECIFIED;
-};
-
-// Convert new role type enum to old enum
-export const convertNewRoleTypeToOld = (newType: NewRoleType): OldRoleType => {
- const mapping: Record<NewRoleType, OldRoleType> = {
- [NewRoleType.TYPE_UNSPECIFIED]: OldRoleTypeEnum.TYPE_UNSPECIFIED,
- [NewRoleType.BUILT_IN]: OldRoleTypeEnum.BUILT_IN,
- [NewRoleType.CUSTOM]: OldRoleTypeEnum.CUSTOM,
- };
- return mapping[newType] ?? OldRoleTypeEnum.UNRECOGNIZED;
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/rollout-conversions.ts b/frontend/src/utils/v1/rollout-conversions.ts
deleted file mode 100644
index c1ece06600..0000000000
--- a/frontend/src/utils/v1/rollout-conversions.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Rollout as OldRollout } from "@/types/proto/v1/rollout_service";
-import { Rollout as OldRolloutProto } from "@/types/proto/v1/rollout_service";
-import type { Rollout as NewRollout } from "@/types/proto-es/v1/rollout_service_pb";
-import { RolloutSchema } from "@/types/proto-es/v1/rollout_service_pb";
-import type { Plan as OldPlan } from "@/types/proto/v1/plan_service";
-import { Plan as OldPlanProto } from "@/types/proto/v1/plan_service";
-import type { Plan as NewPlan } from "@/types/proto-es/v1/plan_service_pb";
-import { PlanSchema } from "@/types/proto-es/v1/plan_service_pb";
-import type { Stage as OldStage } from "@/types/proto/v1/rollout_service";
-import { Stage as OldStageProto } from "@/types/proto/v1/rollout_service";
-import type { Stage as NewStage } from "@/types/proto-es/v1/rollout_service_pb";
-import { StageSchema } from "@/types/proto-es/v1/rollout_service_pb";
-import type { Task as OldTask } from "@/types/proto/v1/rollout_service";
-import { Task as OldTaskProto } from "@/types/proto/v1/rollout_service";
-import type { Task as NewTask } from "@/types/proto-es/v1/rollout_service_pb";
-import { TaskSchema } from "@/types/proto-es/v1/rollout_service_pb";
-import type { TaskRun as OldTaskRun } from "@/types/proto/v1/rollout_service";
-import { TaskRun as OldTaskRunProto } from "@/types/proto/v1/rollout_service";
-import type { TaskRun as NewTaskRun } from "@/types/proto-es/v1/rollout_service_pb";
-import { TaskRunSchema } from "@/types/proto-es/v1/rollout_service_pb";
-import type { TaskRunLog as OldTaskRunLog } from "@/types/proto/v1/rollout_service";
-import { TaskRunLog as OldTaskRunLogProto } from "@/types/proto/v1/rollout_service";
-import type { TaskRunLog as NewTaskRunLog } from "@/types/proto-es/v1/rollout_service_pb";
-import { TaskRunLogSchema } from "@/types/proto-es/v1/rollout_service_pb";
-import type { TaskRunSession as OldTaskRunSession } from "@/types/proto/v1/rollout_service";
-import { TaskRunSession as OldTaskRunSessionProto } from "@/types/proto/v1/rollout_service";
-import type { TaskRunSession as NewTaskRunSession } from "@/types/proto-es/v1/rollout_service_pb";
-import { TaskRunSessionSchema } from "@/types/proto-es/v1/rollout_service_pb";
-
-// Convert old proto Rollout to proto-es
-export const convertOldRolloutToNew = (oldRollout: OldRollout): NewRollout => {
- const json = OldRolloutProto.toJSON(oldRollout) as any;
- return fromJson(RolloutSchema, json);
-};
-
-// Convert proto-es Rollout to old proto
-export const convertNewRolloutToOld = (newRollout: NewRollout): OldRollout => {
- const json = toJson(RolloutSchema, newRollout);
- return OldRolloutProto.fromJSON(json);
-};
-
-// Convert old proto Stage to proto-es
-export const convertOldStageToNew = (oldStage: OldStage): NewStage => {
- const json = OldStageProto.toJSON(oldStage) as any;
- return fromJson(StageSchema, json);
-};
-
-// Convert proto-es Stage to old proto
-export const convertNewStageToOld = (newStage: NewStage): OldStage => {
- const json = toJson(StageSchema, newStage);
- return OldStageProto.fromJSON(json);
-};
-
-// Convert old proto Task to proto-es
-export const convertOldTaskToNew = (oldTask: OldTask): NewTask => {
- const json = OldTaskProto.toJSON(oldTask) as any;
- return fromJson(TaskSchema, json);
-};
-
-// Convert proto-es Task to old proto
-export const convertNewTaskToOld = (newTask: NewTask): OldTask => {
- const json = toJson(TaskSchema, newTask);
- return OldTaskProto.fromJSON(json);
-};
-
-// Convert old proto TaskRun to proto-es
-export const convertOldTaskRunToNew = (oldTaskRun: OldTaskRun): NewTaskRun => {
- const json = OldTaskRunProto.toJSON(oldTaskRun) as any;
- return fromJson(TaskRunSchema, json);
-};
-
-// Convert proto-es TaskRun to old proto
-export const convertNewTaskRunToOld = (newTaskRun: NewTaskRun): OldTaskRun => {
- const json = toJson(TaskRunSchema, newTaskRun);
- return OldTaskRunProto.fromJSON(json);
-};
-
-// Convert old proto TaskRunLog to proto-es
-export const convertOldTaskRunLogToNew = (oldTaskRunLog: OldTaskRunLog): NewTaskRunLog => {
- const json = OldTaskRunLogProto.toJSON(oldTaskRunLog) as any;
- return fromJson(TaskRunLogSchema, json);
-};
-
-// Convert proto-es TaskRunLog to old proto
-export const convertNewTaskRunLogToOld = (newTaskRunLog: NewTaskRunLog): OldTaskRunLog => {
- const json = toJson(TaskRunLogSchema, newTaskRunLog);
- return OldTaskRunLogProto.fromJSON(json);
-};
-
-// Convert old proto TaskRunSession to proto-es
-export const convertOldTaskRunSessionToNew = (oldTaskRunSession: OldTaskRunSession): NewTaskRunSession => {
- const json = OldTaskRunSessionProto.toJSON(oldTaskRunSession) as any;
- return fromJson(TaskRunSessionSchema, json);
-};
-
-// Convert proto-es TaskRunSession to old proto
-export const convertNewTaskRunSessionToOld = (newTaskRunSession: NewTaskRunSession): OldTaskRunSession => {
- const json = toJson(TaskRunSessionSchema, newTaskRunSession);
- return OldTaskRunSessionProto.fromJSON(json);
-};
-
-// Convert old proto Plan to proto-es (for previewRollout)
-export const convertOldPlanToNew = (oldPlan: OldPlan): NewPlan => {
- const json = OldPlanProto.toJSON(oldPlan) as any;
- return fromJson(PlanSchema, json);
-};
-
-// Convert proto-es Plan to old proto
-export const convertNewPlanToOld = (newPlan: NewPlan): OldPlan => {
- const json = toJson(PlanSchema, newPlan);
- return OldPlanProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/setting-conversions.ts b/frontend/src/utils/v1/setting-conversions.ts
deleted file mode 100644
index cbff9b1058..0000000000
--- a/frontend/src/utils/v1/setting-conversions.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Setting as NewSetting } from "@/types/proto-es/v1/setting_service_pb";
-import {
- SettingSchema,
- Setting_SettingName as NewSettingName,
-} from "@/types/proto-es/v1/setting_service_pb";
-import type { Setting as OldSetting } from "@/types/proto/v1/setting_service";
-import {
- Setting as OldSettingProto,
- Setting_SettingName as OldSettingName,
-} from "@/types/proto/v1/setting_service";
-
-// Convert old proto to proto-es
-export const convertOldSettingToNew = (oldSetting: OldSetting): NewSetting => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldSettingProto.toJSON(oldSetting) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(SettingSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewSettingToOld = (newSetting: NewSetting): OldSetting => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(SettingSchema, newSetting);
- return OldSettingProto.fromJSON(json);
-};
-
-// Convert old enum to new string format
-export const convertOldSettingNameToNew = (oldName: OldSettingName): string => {
- // Map string enum to numeric enum
- const mapping: Record<OldSettingName, NewSettingName> = {
- [OldSettingName.SETTING_NAME_UNSPECIFIED]:
- NewSettingName.SETTING_NAME_UNSPECIFIED,
- [OldSettingName.AUTH_SECRET]: NewSettingName.AUTH_SECRET,
- [OldSettingName.BRANDING_LOGO]: NewSettingName.BRANDING_LOGO,
- [OldSettingName.WORKSPACE_ID]: NewSettingName.WORKSPACE_ID,
- [OldSettingName.WORKSPACE_PROFILE]: NewSettingName.WORKSPACE_PROFILE,
- [OldSettingName.WORKSPACE_APPROVAL]: NewSettingName.WORKSPACE_APPROVAL,
- [OldSettingName.WORKSPACE_EXTERNAL_APPROVAL]:
- NewSettingName.WORKSPACE_EXTERNAL_APPROVAL,
- [OldSettingName.ENTERPRISE_LICENSE]: NewSettingName.ENTERPRISE_LICENSE,
- [OldSettingName.APP_IM]: NewSettingName.APP_IM,
- [OldSettingName.WATERMARK]: NewSettingName.WATERMARK,
- [OldSettingName.AI]: NewSettingName.AI,
- [OldSettingName.SCHEMA_TEMPLATE]: NewSettingName.SCHEMA_TEMPLATE,
- [OldSettingName.DATA_CLASSIFICATION]: NewSettingName.DATA_CLASSIFICATION,
- [OldSettingName.SEMANTIC_TYPES]: NewSettingName.SEMANTIC_TYPES,
- [OldSettingName.SQL_RESULT_SIZE_LIMIT]:
- NewSettingName.SQL_RESULT_SIZE_LIMIT,
- [OldSettingName.SCIM]: NewSettingName.SCIM,
- [OldSettingName.PASSWORD_RESTRICTION]: NewSettingName.PASSWORD_RESTRICTION,
- [OldSettingName.ENVIRONMENT]: NewSettingName.ENVIRONMENT,
- [OldSettingName.UNRECOGNIZED]: NewSettingName.SETTING_NAME_UNSPECIFIED,
- };
- const newEnumValue =
- mapping[oldName] ?? NewSettingName.SETTING_NAME_UNSPECIFIED;
- return NewSettingName[newEnumValue];
-};
-
-// Convert new string format to old enum
-export const convertNewSettingNameToOld = (
- newNameString: string
-): OldSettingName => {
- // Find the numeric enum value from the string
- const newEnumValue = Object.entries(NewSettingName).find(
- ([key]) => key === newNameString
- )?.[1] as NewSettingName | undefined;
- if (newEnumValue === undefined) {
- return OldSettingName.UNRECOGNIZED;
- }
- return convertNewSettingNameEnumToOld(newEnumValue);
-};
-
-// Convert new enum to old enum (internal helper)
-const convertNewSettingNameEnumToOld = (
- newName: NewSettingName
-): OldSettingName => {
- // Map numeric enum to string enum
- const mapping: Record<NewSettingName, OldSettingName> = {
- [NewSettingName.SETTING_NAME_UNSPECIFIED]:
- OldSettingName.SETTING_NAME_UNSPECIFIED,
- [NewSettingName.AUTH_SECRET]: OldSettingName.AUTH_SECRET,
- [NewSettingName.BRANDING_LOGO]: OldSettingName.BRANDING_LOGO,
- [NewSettingName.WORKSPACE_ID]: OldSettingName.WORKSPACE_ID,
- [NewSettingName.WORKSPACE_PROFILE]: OldSettingName.WORKSPACE_PROFILE,
- [NewSettingName.WORKSPACE_APPROVAL]: OldSettingName.WORKSPACE_APPROVAL,
- [NewSettingName.WORKSPACE_EXTERNAL_APPROVAL]:
- OldSettingName.WORKSPACE_EXTERNAL_APPROVAL,
- [NewSettingName.ENTERPRISE_LICENSE]: OldSettingName.ENTERPRISE_LICENSE,
- [NewSettingName.APP_IM]: OldSettingName.APP_IM,
- [NewSettingName.WATERMARK]: OldSettingName.WATERMARK,
- [NewSettingName.AI]: OldSettingName.AI,
- [NewSettingName.SCHEMA_TEMPLATE]: OldSettingName.SCHEMA_TEMPLATE,
- [NewSettingName.DATA_CLASSIFICATION]: OldSettingName.DATA_CLASSIFICATION,
- [NewSettingName.SEMANTIC_TYPES]: OldSettingName.SEMANTIC_TYPES,
- [NewSettingName.SQL_RESULT_SIZE_LIMIT]:
- OldSettingName.SQL_RESULT_SIZE_LIMIT,
- [NewSettingName.SCIM]: OldSettingName.SCIM,
- [NewSettingName.PASSWORD_RESTRICTION]: OldSettingName.PASSWORD_RESTRICTION,
- [NewSettingName.ENVIRONMENT]: OldSettingName.ENVIRONMENT,
- };
- return mapping[newName] ?? OldSettingName.UNRECOGNIZED;
-};
diff --git a/frontend/src/utils/v1/sheet-conversions.ts b/frontend/src/utils/v1/sheet-conversions.ts
deleted file mode 100644
index 9b78544d06..0000000000
--- a/frontend/src/utils/v1/sheet-conversions.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import { Sheet as OldSheet } from "@/types/proto/v1/sheet_service";
-import type { Sheet as NewSheet } from "@/types/proto-es/v1/sheet_service_pb";
-import { SheetSchema } from "@/types/proto-es/v1/sheet_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldSheetToNew = (oldSheet: OldSheet): NewSheet => {
- // Use toJSON to convert old proto to JSON, then fromJson to convert to proto-es
- const json = OldSheet.toJSON(oldSheet) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(SheetSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewSheetToOld = (newSheet: NewSheet): OldSheet => {
- // Use toJson to convert proto-es to JSON, then fromJSON to convert to old proto
- const json = toJson(SheetSchema, newSheet);
- return OldSheet.fromJSON(json);
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/sql-conversions.ts b/frontend/src/utils/v1/sql-conversions.ts
deleted file mode 100644
index 027fb620c7..0000000000
--- a/frontend/src/utils/v1/sql-conversions.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type {
- QueryRequest as OldQueryRequest,
- QueryResponse as OldQueryResponse,
- ExportRequest as OldExportRequest,
- ExportResponse as OldExportResponse,
- CheckRequest as OldCheckRequest,
- CheckResponse as OldCheckResponse,
- DiffMetadataRequest as OldDiffMetadataRequest,
- DiffMetadataResponse as OldDiffMetadataResponse,
- SearchQueryHistoriesRequest as OldSearchQueryHistoriesRequest,
- SearchQueryHistoriesResponse as OldSearchQueryHistoriesResponse,
- AICompletionRequest as OldAICompletionRequest,
- AICompletionResponse as OldAICompletionResponse,
- Advice as OldAdvice,
-} from "@/types/proto/v1/sql_service";
-import { Advice_Status as OldAdvice_Status } from "@/types/proto/v1/sql_service";
-import {
- QueryRequest as OldQueryRequestProto,
- QueryResponse as OldQueryResponseProto,
- ExportRequest as OldExportRequestProto,
- ExportResponse as OldExportResponseProto,
- CheckRequest as OldCheckRequestProto,
- CheckResponse as OldCheckResponseProto,
- DiffMetadataRequest as OldDiffMetadataRequestProto,
- DiffMetadataResponse as OldDiffMetadataResponseProto,
- SearchQueryHistoriesRequest as OldSearchQueryHistoriesRequestProto,
- SearchQueryHistoriesResponse as OldSearchQueryHistoriesResponseProto,
- AICompletionRequest as OldAICompletionRequestProto,
- AICompletionResponse as OldAICompletionResponseProto,
-} from "@/types/proto/v1/sql_service";
-import type {
- QueryRequest as NewQueryRequest,
- QueryResponse as NewQueryResponse,
- ExportRequest as NewExportRequest,
- ExportResponse as NewExportResponse,
- CheckRequest as NewCheckRequest,
- CheckResponse as NewCheckResponse,
- DiffMetadataRequest as NewDiffMetadataRequest,
- DiffMetadataResponse as NewDiffMetadataResponse,
- SearchQueryHistoriesRequest as NewSearchQueryHistoriesRequest,
- SearchQueryHistoriesResponse as NewSearchQueryHistoriesResponse,
- AICompletionRequest as NewAICompletionRequest,
- AICompletionResponse as NewAICompletionResponse,
- Advice as NewAdvice,
-} from "@/types/proto-es/v1/sql_service_pb";
-import { Advice_Status as NewAdvice_Status } from "@/types/proto-es/v1/sql_service_pb";
-import {
- QueryRequestSchema,
- QueryResponseSchema,
- ExportRequestSchema,
- ExportResponseSchema,
- CheckRequestSchema,
- CheckResponseSchema,
- DiffMetadataRequestSchema,
- DiffMetadataResponseSchema,
- SearchQueryHistoriesRequestSchema,
- SearchQueryHistoriesResponseSchema,
- AICompletionRequestSchema,
- AICompletionResponseSchema,
-} from "@/types/proto-es/v1/sql_service_pb";
-
-// Convert old QueryRequest to proto-es
-export const convertOldQueryRequestToNew = (oldRequest: OldQueryRequest): NewQueryRequest => {
- const json = OldQueryRequestProto.toJSON(oldRequest) as any;
- return fromJson(QueryRequestSchema, json);
-};
-
-// Convert proto-es QueryResponse to old
-export const convertNewQueryResponseToOld = (newResponse: NewQueryResponse): OldQueryResponse => {
- const json = toJson(QueryResponseSchema, newResponse);
- return OldQueryResponseProto.fromJSON(json);
-};
-
-// Convert old ExportRequest to proto-es
-export const convertOldExportRequestToNew = (oldRequest: OldExportRequest): NewExportRequest => {
- const json = OldExportRequestProto.toJSON(oldRequest) as any;
- return fromJson(ExportRequestSchema, json);
-};
-
-// Convert proto-es ExportResponse to old
-export const convertNewExportResponseToOld = (newResponse: NewExportResponse): OldExportResponse => {
- const json = toJson(ExportResponseSchema, newResponse);
- return OldExportResponseProto.fromJSON(json);
-};
-
-// Convert old CheckRequest to proto-es
-export const convertOldCheckRequestToNew = (oldRequest: OldCheckRequest): NewCheckRequest => {
- const json = OldCheckRequestProto.toJSON(oldRequest) as any;
- return fromJson(CheckRequestSchema, json);
-};
-
-// Convert proto-es CheckResponse to old
-export const convertNewCheckResponseToOld = (newResponse: NewCheckResponse): OldCheckResponse => {
- const json = toJson(CheckResponseSchema, newResponse);
- return OldCheckResponseProto.fromJSON(json);
-};
-
-// Convert old DiffMetadataRequest to proto-es
-export const convertOldDiffMetadataRequestToNew = (oldRequest: OldDiffMetadataRequest): NewDiffMetadataRequest => {
- const json = OldDiffMetadataRequestProto.toJSON(oldRequest) as any;
- return fromJson(DiffMetadataRequestSchema, json);
-};
-
-// Convert proto-es DiffMetadataResponse to old
-export const convertNewDiffMetadataResponseToOld = (newResponse: NewDiffMetadataResponse): OldDiffMetadataResponse => {
- const json = toJson(DiffMetadataResponseSchema, newResponse);
- return OldDiffMetadataResponseProto.fromJSON(json);
-};
-
-// Convert old SearchQueryHistoriesRequest to proto-es
-export const convertOldSearchQueryHistoriesRequestToNew = (oldRequest: OldSearchQueryHistoriesRequest): NewSearchQueryHistoriesRequest => {
- const json = OldSearchQueryHistoriesRequestProto.toJSON(oldRequest) as any;
- return fromJson(SearchQueryHistoriesRequestSchema, json);
-};
-
-// Convert proto-es SearchQueryHistoriesResponse to old
-export const convertNewSearchQueryHistoriesResponseToOld = (newResponse: NewSearchQueryHistoriesResponse): OldSearchQueryHistoriesResponse => {
- const json = toJson(SearchQueryHistoriesResponseSchema, newResponse);
- return OldSearchQueryHistoriesResponseProto.fromJSON(json);
-};
-
-// Convert old AICompletionRequest to proto-es
-export const convertOldAICompletionRequestToNew = (oldRequest: OldAICompletionRequest): NewAICompletionRequest => {
- const json = OldAICompletionRequestProto.toJSON(oldRequest) as any;
- return fromJson(AICompletionRequestSchema, json);
-};
-
-// Convert proto-es AICompletionResponse to old
-export const convertNewAICompletionResponseToOld = (newResponse: NewAICompletionResponse): OldAICompletionResponse => {
- const json = toJson(AICompletionResponseSchema, newResponse);
- return OldAICompletionResponseProto.fromJSON(json);
-};
-
-// Convert proto-es Advice_Status to old
-export const convertNewAdviceStatusToOld = (newStatus: NewAdvice_Status): OldAdvice_Status => {
- switch (newStatus) {
- case NewAdvice_Status.STATUS_UNSPECIFIED:
- return OldAdvice_Status.STATUS_UNSPECIFIED;
- case NewAdvice_Status.SUCCESS:
- return OldAdvice_Status.SUCCESS;
- case NewAdvice_Status.WARNING:
- return OldAdvice_Status.WARNING;
- case NewAdvice_Status.ERROR:
- return OldAdvice_Status.ERROR;
- default:
- return OldAdvice_Status.STATUS_UNSPECIFIED;
- }
-};
-
-// Convert old Advice_Status to proto-es
-export const convertOldAdviceStatusToNew = (oldStatus: OldAdvice_Status): NewAdvice_Status => {
- switch (oldStatus) {
- case OldAdvice_Status.STATUS_UNSPECIFIED:
- return NewAdvice_Status.STATUS_UNSPECIFIED;
- case OldAdvice_Status.SUCCESS:
- return NewAdvice_Status.SUCCESS;
- case OldAdvice_Status.WARNING:
- return NewAdvice_Status.WARNING;
- case OldAdvice_Status.ERROR:
- return NewAdvice_Status.ERROR;
- default:
- return NewAdvice_Status.STATUS_UNSPECIFIED;
- }
-};
-
-// Convert proto-es Advice array to old
-export const convertNewAdviceArrayToOld = (newAdvices: NewAdvice[]): OldAdvice[] => {
- return newAdvices.map(advice => {
- return {
- ...advice,
- status: convertNewAdviceStatusToOld(advice.status)
- } as OldAdvice;
- });
-};
-
-// Convert old Advice array to proto-es
-export const convertOldAdviceArrayToNew = (oldAdvices: OldAdvice[]): NewAdvice[] => {
- return oldAdvices.map(advice => {
- return {
- ...advice,
- status: convertOldAdviceStatusToNew(advice.status)
- } as NewAdvice;
- });
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/user-conversions.ts b/frontend/src/utils/v1/user-conversions.ts
deleted file mode 100644
index c9a508c972..0000000000
--- a/frontend/src/utils/v1/user-conversions.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { User as OldUser, UserType as OldUserType } from "@/types/proto/v1/user_service";
-import { User as OldUserProto, UserType } from "@/types/proto/v1/user_service";
-import type { User as NewUser, UserType as NewUserType } from "@/types/proto-es/v1/user_service_pb";
-import { UserSchema, UserType as NewUserTypeEnum } from "@/types/proto-es/v1/user_service_pb";
-
-// Convert old proto User to proto-es User
-export const convertOldUserToNew = (oldUser: OldUser): NewUser => {
- const json = OldUserProto.toJSON(oldUser) as any; // Type assertion needed due to proto type incompatibility
- return fromJson(UserSchema, json);
-};
-
-// Convert proto-es User to old proto User
-export const convertNewUserToOld = (newUser: NewUser): OldUser => {
- const json = toJson(UserSchema, newUser);
- return OldUserProto.fromJSON(json);
-};
-
-// Convert old UserType enum to new UserType enum
-export const convertOldUserTypeToNew = (oldType: OldUserType): NewUserType => {
- const mapping: Record<OldUserType, NewUserType> = {
- [UserType.USER_TYPE_UNSPECIFIED]: NewUserTypeEnum.USER_TYPE_UNSPECIFIED,
- [UserType.USER]: NewUserTypeEnum.USER,
- [UserType.SYSTEM_BOT]: NewUserTypeEnum.SYSTEM_BOT,
- [UserType.SERVICE_ACCOUNT]: NewUserTypeEnum.SERVICE_ACCOUNT,
- [UserType.UNRECOGNIZED]: NewUserTypeEnum.USER_TYPE_UNSPECIFIED,
- };
- return mapping[oldType] ?? NewUserTypeEnum.USER_TYPE_UNSPECIFIED;
-};
-
-// Convert new UserType enum to old UserType enum
-export const convertNewUserTypeToOld = (newType: NewUserType): OldUserType => {
- const mapping: Record<NewUserType, OldUserType> = {
- [NewUserTypeEnum.USER_TYPE_UNSPECIFIED]: UserType.USER_TYPE_UNSPECIFIED,
- [NewUserTypeEnum.USER]: UserType.USER,
- [NewUserTypeEnum.SYSTEM_BOT]: UserType.SYSTEM_BOT,
- [NewUserTypeEnum.SERVICE_ACCOUNT]: UserType.SERVICE_ACCOUNT,
- };
- return mapping[newType] ?? UserType.UNRECOGNIZED;
-};
-
-// Convert old UserType enum to string format for requests
-export const convertOldUserTypeToNewString = (oldType: OldUserType): string => {
- const newEnumValue = convertOldUserTypeToNew(oldType);
- return NewUserTypeEnum[newEnumValue]; // Convert numeric enum to string
-};
\ No newline at end of file
diff --git a/frontend/src/utils/v1/worksheet-conversions.ts b/frontend/src/utils/v1/worksheet-conversions.ts
deleted file mode 100644
index 9b5902f6b8..0000000000
--- a/frontend/src/utils/v1/worksheet-conversions.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Worksheet as OldWorksheet, WorksheetOrganizer as OldWorksheetOrganizer } from "@/types/proto/v1/worksheet_service";
-import { Worksheet as OldWorksheetProto, WorksheetOrganizer as OldWorksheetOrganizerProto, Worksheet_Visibility as OldVisibility } from "@/types/proto/v1/worksheet_service";
-import type { Worksheet as NewWorksheet, WorksheetOrganizer as NewWorksheetOrganizer } from "@/types/proto-es/v1/worksheet_service_pb";
-import { WorksheetSchema, WorksheetOrganizerSchema, Worksheet_Visibility as NewVisibility } from "@/types/proto-es/v1/worksheet_service_pb";
-
-// Convert old proto to proto-es
-export const convertOldWorksheetToNew = (oldWorksheet: OldWorksheet): NewWorksheet => {
- const json = OldWorksheetProto.toJSON(oldWorksheet) as any;
- return fromJson(WorksheetSchema, json);
-};
-
-// Convert proto-es to old proto
-export const convertNewWorksheetToOld = (newWorksheet: NewWorksheet): OldWorksheet => {
- const json = toJson(WorksheetSchema, newWorksheet);
- return OldWorksheetProto.fromJSON(json);
-};
-
-// Convert old WorksheetOrganizer to new
-export const convertOldWorksheetOrganizerToNew = (oldOrganizer: OldWorksheetOrganizer): NewWorksheetOrganizer => {
- const json = OldWorksheetOrganizerProto.toJSON(oldOrganizer) as any;
- return fromJson(WorksheetOrganizerSchema, json);
-};
-
-// Convert new WorksheetOrganizer to old
-export const convertNewWorksheetOrganizerToOld = (newOrganizer: NewWorksheetOrganizer): OldWorksheetOrganizer => {
- const json = toJson(WorksheetOrganizerSchema, newOrganizer);
- return OldWorksheetOrganizerProto.fromJSON(json);
-};
-
-// Convert visibility enum
-export const convertOldVisibilityToNew = (oldVisibility: OldVisibility): NewVisibility => {
- const mapping: Record<OldVisibility, NewVisibility> = {
- [OldVisibility.VISIBILITY_UNSPECIFIED]: NewVisibility.UNSPECIFIED,
- [OldVisibility.VISIBILITY_PROJECT_READ]: NewVisibility.PROJECT_READ,
- [OldVisibility.VISIBILITY_PROJECT_WRITE]: NewVisibility.PROJECT_WRITE,
- [OldVisibility.VISIBILITY_PRIVATE]: NewVisibility.PRIVATE,
- [OldVisibility.UNRECOGNIZED]: NewVisibility.UNSPECIFIED,
- };
- return mapping[oldVisibility] ?? NewVisibility.UNSPECIFIED;
-};
-
-export const convertNewVisibilityToOld = (newVisibility: NewVisibility): OldVisibility => {
- const mapping: Record<NewVisibility, OldVisibility> = {
- [NewVisibility.UNSPECIFIED]: OldVisibility.VISIBILITY_UNSPECIFIED,
- [NewVisibility.PROJECT_READ]: OldVisibility.VISIBILITY_PROJECT_READ,
- [NewVisibility.PROJECT_WRITE]: OldVisibility.VISIBILITY_PROJECT_WRITE,
- [NewVisibility.PRIVATE]: OldVisibility.VISIBILITY_PRIVATE,
- };
- return mapping[newVisibility] ?? OldVisibility.UNRECOGNIZED;
-};
\ No newline at end of file
diff --git a/frontend/src/utils/workspaceApprovalSetting-conversions.ts b/frontend/src/utils/workspaceApprovalSetting-conversions.ts
deleted file mode 100644
index b25d1f43fc..0000000000
--- a/frontend/src/utils/workspaceApprovalSetting-conversions.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import type { ApprovalTemplate as OldApprovalTemplate, ApprovalNode as OldApprovalNode } from "@/types/proto/v1/issue_service";
-import type { ApprovalTemplate as NewApprovalTemplate, ApprovalNode as NewApprovalNode } from "@/types/proto-es/v1/issue_service_pb";
-import { ApprovalTemplateSchema as NewApprovalTemplateSchema, ApprovalNodeSchema as NewApprovalNodeSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { ApprovalTemplate as OldApprovalTemplateProto, ApprovalNode as OldApprovalNodeProto } from "@/types/proto/v1/issue_service";
-import { fromJson, toJson } from "@bufbuild/protobuf";
-import type { Expr as OldExpr } from "@/types/proto/google/type/expr";
-import type { Expr as NewExpr } from "@/types/proto-es/google/type/expr_pb";
-import { ExprSchema as NewExprSchema } from "@/types/proto-es/google/type/expr_pb";
-import { Expr as OldExprProto } from "@/types/proto/google/type/expr";
-
-// Convert old ApprovalTemplate to new proto-es ApprovalTemplate
-export const convertOldApprovalTemplateToNew = (
- oldTemplate: OldApprovalTemplate
-): NewApprovalTemplate => {
- const json = OldApprovalTemplateProto.toJSON(oldTemplate) as any;
- return fromJson(NewApprovalTemplateSchema, json);
-};
-
-// Convert new proto-es ApprovalTemplate to old ApprovalTemplate
-export const convertNewApprovalTemplateToOld = (
- newTemplate: NewApprovalTemplate
-): OldApprovalTemplate => {
- const json = toJson(NewApprovalTemplateSchema, newTemplate);
- return OldApprovalTemplateProto.fromJSON(json);
-};
-
-// Convert old ApprovalNode to new proto-es ApprovalNode
-export const convertOldApprovalNodeToNew = (
- oldNode: OldApprovalNode
-): NewApprovalNode => {
- const json = OldApprovalNodeProto.toJSON(oldNode) as any;
- return fromJson(NewApprovalNodeSchema, json);
-};
-
-// Convert new proto-es ApprovalNode to old ApprovalNode
-export const convertNewApprovalNodeToOld = (
- newNode: NewApprovalNode
-): OldApprovalNode => {
- const json = toJson(NewApprovalNodeSchema, newNode);
- return OldApprovalNodeProto.fromJSON(json);
-};
-
-// Convert old Expr to new proto-es Expr
-export const convertOldExprToNew = (oldExpr: OldExpr): NewExpr => {
- const json = OldExprProto.toJSON(oldExpr) as any;
- return fromJson(NewExprSchema, json);
-};
-
-// Convert new proto-es Expr to old Expr
-export const convertNewExprToOld = (newExpr: NewExpr): OldExpr => {
- const json = toJson(NewExprSchema, newExpr);
- return OldExprProto.fromJSON(json);
-};
-
-// For WorkspaceApprovalSetting conversion
-import type { WorkspaceApprovalSetting as OldWorkspaceApprovalSetting } from "@/types/proto/v1/setting_service";
-import type { WorkspaceApprovalSetting as NewWorkspaceApprovalSetting } from "@/types/proto-es/v1/setting_service_pb";
-import { WorkspaceApprovalSettingSchema as NewWorkspaceApprovalSettingSchema } from "@/types/proto-es/v1/setting_service_pb";
-import { WorkspaceApprovalSetting as OldWorkspaceApprovalSettingProto } from "@/types/proto/v1/setting_service";
-
-// Convert old WorkspaceApprovalSetting to new proto-es WorkspaceApprovalSetting
-export const convertOldWorkspaceApprovalSettingToNew = (
- oldSetting: OldWorkspaceApprovalSetting
-): NewWorkspaceApprovalSetting => {
- const json = OldWorkspaceApprovalSettingProto.toJSON(oldSetting) as any;
- return fromJson(NewWorkspaceApprovalSettingSchema, json);
-};
-
-// Convert new proto-es WorkspaceApprovalSetting to old WorkspaceApprovalSetting
-export const convertNewWorkspaceApprovalSettingToOld = (
- newSetting: NewWorkspaceApprovalSetting
-): OldWorkspaceApprovalSetting => {
- const json = toJson(NewWorkspaceApprovalSettingSchema, newSetting);
- return OldWorkspaceApprovalSettingProto.fromJSON(json);
-};
\ No newline at end of file
diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml
index 41db2e0bb8..41f506c94e 100644
--- a/proto/buf.gen.yaml
+++ b/proto/buf.gen.yaml
@@ -22,18 +22,6 @@ plugins:
include_imports: true
types:
- bytebase.v1
- - remote: buf.build/community/stephenh-ts-proto:v2.3.0
- out: ../frontend/src/types/proto
- opt:
- - env=browser
- - outputServices=generic-definitions
- - useExactTypes=false
- - esModuleInterop=true
- - forceLong=long
- - stringEnums=true
- - useDate=false
- types:
- - bytebase.v1
- remote: buf.build/community/pseudomuto-doc:v1.5.1
out: gen/grpc-doc
opt: html,index.html,source_relative