Skip to content

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

chore: migrate vcs to v1 (#6403)

ecmadaoc7c320cfb6cc
diff --git a/backend/api/v1/externalvs_service.go b/backend/api/v1/externalvs_service.go
index 91c7da80dc..a271394976 100644
--- a/backend/api/v1/externalvs_service.go
+++ b/backend/api/v1/externalvs_service.go
@@ -216,15 +216,15 @@ func convertToExternalVersionControl(externalVersionControl *store.ExternalVersi
tp := v1pb.ExternalVersionControl_TYPE_UNSPECIFIED
switch externalVersionControl.Type {
case vcs.GitHub:
- tp = v1pb.ExternalVersionControl_TYPE_GITHUB
+ tp = v1pb.ExternalVersionControl_GITHUB
case vcs.GitLab:
- tp = v1pb.ExternalVersionControl_TYPE_GITLAB
+ tp = v1pb.ExternalVersionControl_GITLAB
case vcs.Bitbucket:
- tp = v1pb.ExternalVersionControl_TYPE_BITBUCKET
+ tp = v1pb.ExternalVersionControl_BITBUCKET
}
return &v1pb.ExternalVersionControl{
- Name: fmt.Sprintf("%s/%d", externalVersionControlPrefix, externalVersionControl.ID),
+ Name: fmt.Sprintf("%s%d", externalVersionControlPrefix, externalVersionControl.ID),
Title: externalVersionControl.Name,
Type: tp,
Url: externalVersionControl.InstanceURL,
@@ -268,11 +268,11 @@ func checkAndConvertToStoreVersionControl(externalVersionControl *v1pb.ExternalV
func convertExternalVersionControlTypeToVCSType(tp v1pb.ExternalVersionControl_Type) (vcs.Type, error) {
switch tp {
- case v1pb.ExternalVersionControl_TYPE_GITHUB:
+ case v1pb.ExternalVersionControl_GITHUB:
return vcs.GitHub, nil
- case v1pb.ExternalVersionControl_TYPE_GITLAB:
+ case v1pb.ExternalVersionControl_GITLAB:
return vcs.GitLab, nil
- case v1pb.ExternalVersionControl_TYPE_BITBUCKET:
+ case v1pb.ExternalVersionControl_BITBUCKET:
return vcs.Bitbucket, nil
}
return "", errors.Errorf("unknown external version control type: %v", tp)
diff --git a/frontend/src/components/ProjectVersionControlPanel.vue b/frontend/src/components/ProjectVersionControlPanel.vue
index a4140636ad..43561f022a 100644
--- a/frontend/src/components/ProjectVersionControlPanel.vue
+++ b/frontend/src/components/ProjectVersionControlPanel.vue
@@ -89,8 +89,9 @@
import { reactive, watchEffect, watch } from "vue";
import { computed, PropType } from "vue";
import { useI18n } from "vue-i18n";
-import { pushNotification, useRepositoryV1Store, useVCSStore } from "@/store";
+import { pushNotification, useRepositoryV1Store, useVCSV1Store } from "@/store";
import { Project, Workflow } from "@/types/proto/v1/project_service";
+import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";
interface LocalState {
workflowType: Workflow;
@@ -112,7 +113,7 @@ const props = defineProps({
const { t } = useI18n();
const repositoryV1Store = useRepositoryV1Store();
-const vcsStore = useVCSStore();
+const vcsV1Store = useVCSV1Store();
const state = reactive<LocalState>({
workflowType: props.project.workflow,
@@ -120,14 +121,13 @@ const state = reactive<LocalState>({
showWizardForChange: false,
});
-watchEffect(() => {
- repositoryV1Store
- .getOrFetchRepositoryByProject(props.project.name)
- .then((repo) => {
- if (repo) {
- return vcsStore.fetchVCSById(repo.vcsUid);
- }
- });
+watchEffect(async () => {
+ const repo = await repositoryV1Store.getOrFetchRepositoryByProject(
+ props.project.name
+ );
+ if (repo) {
+ await vcsV1Store.fetchVCSByUid(repo.vcsUid);
+ }
});
watch(
@@ -142,7 +142,10 @@ const repository = computed(() => {
});
const vcs = computed(() => {
- return vcsStore.getVCSById(repository.value?.vcsUid ?? "");
+ return (
+ vcsV1Store.getVCSByUid(repository.value?.vcsUid ?? "") ??
+ ({} as ExternalVersionControl)
+ );
});
const enterWizard = (create: boolean) => {
diff --git a/frontend/src/components/RepositoryConfigPanel.vue b/frontend/src/components/RepositoryConfigPanel.vue
index 1bb9c320bb..78e352763f 100644
--- a/frontend/src/components/RepositoryConfigPanel.vue
+++ b/frontend/src/components/RepositoryConfigPanel.vue
@@ -2,7 +2,7 @@
<RepositoryForm
:create="true"
:vcs-type="config.vcs.type"
- :vcs-name="config.vcs.name"
+ :vcs-name="config.vcs.title"
:repository-info="config.repositoryInfo"
:repository-config="config.repositoryConfig"
:schema-change-type="config.schemaChangeType"
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index ccd97c4591..5d59caffee 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -6,13 +6,13 @@
<label for="gitprovider" class="textlabel">
{{ $t("repository.git-provider") }}
</label>
- <template v-if="vcsType.startsWith('GITLAB')">
+ <template v-if="vcsType === ExternalVersionControl_Type.GITLAB">
<img class="h-4 w-auto" src="../assets/gitlab-logo.svg" />
</template>
- <template v-if="vcsType.startsWith('GITHUB')">
+ <template v-if="vcsType === ExternalVersionControl_Type.GITHUB">
<img class="h-4 w-auto" src="../assets/github-logo.svg" />
</template>
- <template v-if="vcsType.startsWith('BITBUCKET')">
+ <template v-if="vcsType === ExternalVersionControl_Type.BITBUCKET">
<img class="h-4 w-auto" src="../assets/bitbucket-logo.svg" />
</template>
</div>
@@ -294,9 +294,10 @@
<div class="mt-1 textinfolabel">
{{
$t("repository.sql-review-ci-description", {
- pr: vcsType.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ vcsType === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
pathTemplate:
schemaChangeType == SchemaChange.DDL
? $t("repository.file-path-template")
@@ -327,7 +328,7 @@
<script lang="ts" setup>
import { reactive, PropType, computed } from "vue";
import { useI18n } from "vue-i18n";
-import { ExternalRepositoryInfo, RepositoryConfig, VCSType } from "@/types";
+import { ExternalRepositoryInfo, RepositoryConfig } from "@/types";
import { hasFeature, useSubscriptionV1Store } from "@/store";
import {
Project,
@@ -335,6 +336,7 @@ import {
SchemaChange,
schemaChangeToJSON,
} from "@/types/proto/v1/project_service";
+import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
const FILE_REQUIRED_PLACEHOLDER = "{{DB_NAME}}, {{VERSION}}, {{TYPE}}";
const SCHEMA_REQUIRED_PLACEHOLDER = "{{DB_NAME}}";
@@ -363,7 +365,7 @@ const props = defineProps({
},
vcsType: {
required: true,
- type: String as PropType<VCSType>,
+ type: Object as PropType<ExternalVersionControl_Type>,
},
vcsName: {
required: true,
@@ -406,11 +408,12 @@ const isProjectSchemaChangeTypeSDL = computed(() => {
});
const canEnableSQLReview = computed(() => {
return (
- props.vcsType.startsWith("GITLAB") || props.vcsType.startsWith("GITHUB")
+ props.vcsType == ExternalVersionControl_Type.GITHUB ||
+ props.vcsType === ExternalVersionControl_Type.GITLAB
);
});
const enableSQLReviewTitle = computed(() => {
- return props.vcsType.startsWith("GITLAB")
+ return props.vcsType === ExternalVersionControl_Type.GITLAB
? t("repository.sql-review-ci-enable-gitlab")
: t("repository.sql-review-ci-enable-github");
});
diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vue
index 8b6f8e80a1..274618bc47 100644
--- a/frontend/src/components/RepositoryPanel.vue
+++ b/frontend/src/components/RepositoryPanel.vue
@@ -82,7 +82,7 @@
class="mt-4"
:allow-edit="allowEdit"
:vcs-type="vcs.type"
- :vcs-name="vcs.name"
+ :vcs-name="vcs.title"
:repository-info="repositoryInfo"
:repository-config="state.repositoryConfig"
:project="project"
@@ -112,7 +112,7 @@
</div>
</div>
<BBModal
- v-if="state.showSetupSQLReviewCIModal"
+ v-if="supportSQLReviewCI && state.showSetupSQLReviewCIModal"
class="relative overflow-hidden"
:title="$t('repository.sql-review-ci-setup')"
@close="state.showSetupSQLReviewCIModal = false"
@@ -121,9 +121,10 @@
<div class="whitespace-pre-wrap">
{{
$t("repository.sql-review-ci-setup-modal", {
- pr: vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</div>
@@ -136,9 +137,10 @@
>
{{
$t("repository.sql-review-ci-setup-pr", {
- pr: vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</a>
@@ -146,7 +148,7 @@
</div>
</BBModal>
<BBAlert
- v-if="state.showSetupSQLReviewCIFailureModal"
+ v-if="supportSQLReviewCI && state.showSetupSQLReviewCIFailureModal"
:style="'CRITICAL'"
:ok-text="$t('common.retry')"
:title="$t('repository.sql-review-ci-setup-failed')"
@@ -164,7 +166,7 @@
>
</BBAlert>
<BBModal
- v-if="state.showLoadingSQLReviewPRModal"
+ v-if="supportSQLReviewCI && state.showLoadingSQLReviewPRModal"
class="relative overflow-hidden"
:show-close="false"
:esc-closable="false"
@@ -176,15 +178,16 @@
<BBSpin class="mt-1" />
{{
$t("repository.sql-review-ci-loading-modal", {
- pr: vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</div>
</BBModal>
<BBModal
- v-if="state.showRestoreSQLReviewCIModal"
+ v-if="supportSQLReviewCI && state.showRestoreSQLReviewCIModal"
class="relative overflow-hidden"
:title="$t('repository.sql-review-ci-remove')"
@close="onSQLReviewCIModalClose"
@@ -193,7 +196,11 @@
<div class="whitespace-pre-wrap">
<i18n-t keypath="repository.sql-review-ci-restore-modal">
<template #vcs>
- {{ vcs.type.startsWith("GITLAB") ? "GitLab CI" : "GitHub Action" }}
+ {{
+ vcs.type === ExternalVersionControl_Type.GITLAB
+ ? "GitLab CI"
+ : "GitHub Action"
+ }}
</template>
<template #repository>
<a class="normal-link" :href="repository.webUrl" target="_blank">{{
@@ -215,7 +222,7 @@
</div>
</BBModal>
<BBModal
- v-if="state.showDisableSQLReviewCIModal"
+ v-if="supportSQLReviewCI && state.showDisableSQLReviewCIModal"
class="relative overflow-hidden"
:title="$t('repository.sql-review-ci-remove')"
@close="state.showDisableSQLReviewCIModal = false"
@@ -224,7 +231,11 @@
<div class="whitespace-pre-wrap">
<i18n-t keypath="repository.sql-review-ci-remove-modal">
<template #vcs>
- {{ vcs.type.startsWith("GITLAB") ? "GitLab CI" : "GitHub Action" }}
+ {{
+ vcs.type === ExternalVersionControl_Type.GITLAB
+ ? "GitLab CI"
+ : "GitHub Action"
+ }}
</template>
<template #repository>
<a class="normal-link" :href="repository.webUrl" target="_blank">{{
@@ -255,7 +266,7 @@
<script lang="ts" setup>
import { computed, PropType, reactive, watch } from "vue";
import isEmpty from "lodash-es/isEmpty";
-import { VCS, ExternalRepositoryInfo, RepositoryConfig } from "../types";
+import { ExternalRepositoryInfo, RepositoryConfig } from "../types";
import { useI18n } from "vue-i18n";
import {
hasFeature,
@@ -269,7 +280,11 @@ import {
Workflow,
} from "@/types/proto/v1/project_service";
import { cloneDeep } from "lodash-es";
-import { ProjectGitOpsInfo } from "@/types/proto/v1/externalvs_service";
+import {
+ ProjectGitOpsInfo,
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
interface LocalState {
repositoryConfig: RepositoryConfig;
@@ -294,7 +309,7 @@ const props = defineProps({
},
vcs: {
required: true,
- type: Object as PropType<VCS>,
+ type: Object as PropType<ExternalVersionControl>,
},
allowEdit: {
default: true,
@@ -358,6 +373,14 @@ const isProjectSchemaChangeTypeSDL = computed(() => {
return state.schemaChangeType === SchemaChange.SDL;
});
+const supportSQLReviewCI = computed(() => {
+ const { type } = props.vcs;
+ return (
+ type == ExternalVersionControl_Type.GITHUB ||
+ type === ExternalVersionControl_Type.GITLAB
+ );
+});
+
const allowUpdate = computed(() => {
return (
!isEmpty(state.repositoryConfig.branchFilter) &&
diff --git a/frontend/src/components/RepositorySelectionPanel.vue b/frontend/src/components/RepositorySelectionPanel.vue
index 8eeaa54f6e..c44a255405 100644
--- a/frontend/src/components/RepositorySelectionPanel.vue
+++ b/frontend/src/components/RepositorySelectionPanel.vue
@@ -47,6 +47,8 @@ import {
ProjectRepositoryConfig,
} from "../types";
import { useOAuthStore, useGitlabStore } from "@/store";
+import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
+import { getVCSUid } from "@/store/modules/v1/common";
interface LocalState {
repositoryList: ExternalRepositoryInfo[];
@@ -74,14 +76,14 @@ onMounted(() => {
const prepareRepositoryList = () => {
useOAuthStore()
.exchangeVCSTokenWithID({
- vcsId: props.config.vcs.id,
+ vcsId: getVCSUid(props.config.vcs.name),
code: props.config.code,
})
.then((token: OAuthToken) => {
emit("set-token", token);
gitlabStore
.fetchProjectList({
- vcs: props.config.vcs,
+ vcsId: getVCSUid(props.config.vcs.name),
token: token,
})
.then((list) => {
@@ -91,10 +93,10 @@ const prepareRepositoryList = () => {
};
const refreshRepositoryList = () => {
- if (props.config.vcs.type == "GITLAB") {
+ if (props.config.vcs.type == ExternalVersionControl_Type.GITLAB) {
gitlabStore
.fetchProjectList({
- vcs: props.config.vcs,
+ vcsId: getVCSUid(props.config.vcs.name),
token: props.config.token,
})
.then((list) => {
@@ -113,11 +115,11 @@ const repositoryList = computed(() => {
});
const attentionText = computed((): string => {
- if (props.config.vcs.type == "GITLAB") {
+ if (props.config.vcs.type === ExternalVersionControl_Type.GITLAB) {
return "repository.select-repository-attention-gitlab";
- } else if (props.config.vcs.type == "GITHUB") {
+ } else if (props.config.vcs.type === ExternalVersionControl_Type.GITHUB) {
return "repository.select-repository-attention-github";
- } else if (props.config.vcs.type == "BITBUCKET") {
+ } else if (props.config.vcs.type === ExternalVersionControl_Type.BITBUCKET) {
return "repository.select-repository-attention-bitbucket";
}
return "";
diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vue
index 977fe492bb..6fa13d90b5 100644
--- a/frontend/src/components/RepositorySetupWizard.vue
+++ b/frontend/src/components/RepositorySetupWizard.vue
@@ -54,9 +54,10 @@
<div class="whitespace-pre-wrap">
{{
$t("repository.sql-review-ci-setup-modal", {
- pr: state.config.vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ state.config.vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</div>
@@ -69,9 +70,10 @@
>
{{
$t("repository.sql-review-ci-setup-pr", {
- pr: state.config.vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ state.config.vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</a>
@@ -110,9 +112,10 @@
<BBSpin class="mt-1" />
{{
$t("repository.sql-review-ci-loading-modal", {
- pr: state.config.vcs.type.startsWith("GITLAB")
- ? $t("repository.merge-request")
- : $t("repository.pull-request"),
+ pr:
+ state.config.vcs.type === ExternalVersionControl_Type.GITLAB
+ ? $t("repository.merge-request")
+ : $t("repository.pull-request"),
})
}}
</div>
@@ -135,19 +138,22 @@ import {
ExternalRepositoryInfo,
OAuthToken,
ProjectRepositoryConfig,
- unknown,
- VCS,
} from "../types";
import { projectSlugV1 } from "../utils";
import { useI18n } from "vue-i18n";
import { useRepositoryV1Store, hasFeature, useProjectV1Store } from "@/store";
+import { getVCSUid } from "@/store/modules/v1/common";
import {
Project,
Workflow,
TenantMode,
SchemaChange,
} from "@/types/proto/v1/project_service";
-import { ProjectGitOpsInfo } from "@/types/proto/v1/externalvs_service";
+import {
+ ProjectGitOpsInfo,
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
// Default file path template is to organize migration files from different environments under separate directories.
const DEFAULT_FILE_PATH_TEMPLATE =
@@ -212,7 +218,7 @@ const isTenantProject = computed(() => {
const state = reactive<LocalState>({
config: {
- vcs: unknown("VCS") as VCS,
+ vcs: {} as ExternalVersionControl,
code: "",
token: {
accessToken: "",
@@ -297,8 +303,8 @@ const tryFinishSetup = (allowFinishCallback: () => void) => {
const createFunc = async () => {
let externalId = state.config.repositoryInfo.externalId;
if (
- state.config.vcs.type == "GITHUB" ||
- state.config.vcs.type == "BITBUCKET"
+ state.config.vcs.type === ExternalVersionControl_Type.GITHUB ||
+ state.config.vcs.type === ExternalVersionControl_Type.BITBUCKET
) {
externalId = state.config.repositoryInfo.fullPath;
}
@@ -314,7 +320,7 @@ const tryFinishSetup = (allowFinishCallback: () => void) => {
await useProjectV1Store().updateProject(projectPatch, updateMask);
const repositoryCreate: Partial<ProjectGitOpsInfo> = {
- vcsUid: `${state.config.vcs.id}`,
+ vcsUid: `${getVCSUid(state.config.vcs.name)}`,
title: state.config.repositoryInfo.name,
fullPath: state.config.repositoryInfo.fullPath,
webUrl: state.config.repositoryInfo.webUrl,
@@ -379,7 +385,7 @@ const setToken = (token: OAuthToken) => {
state.config.token = token;
};
-const setVCS = (vcs: VCS) => {
+const setVCS = (vcs: ExternalVersionControl) => {
state.config.vcs = vcs;
};
diff --git a/frontend/src/components/RepositoryVCSProviderPanel.vue b/frontend/src/components/RepositoryVCSProviderPanel.vue
index e89686908e..5421aa625d 100644
--- a/frontend/src/components/RepositoryVCSProviderPanel.vue
+++ b/frontend/src/components/RepositoryVCSProviderPanel.vue
@@ -9,16 +9,16 @@
class="btn-normal items-center space-x-2 mx-2 my-2"
@click.prevent="selectVCS(vcs)"
>
- <template v-if="vcs.type.startsWith('GITLAB')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.GITLAB">
<img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />
</template>
- <template v-if="vcs.type.startsWith('GITHUB')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.GITHUB">
<img class="h-6 w-auto" src="../assets/github-logo.svg" />
</template>
- <template v-if="vcs.type.startsWith('BITBUCKET')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.BITBUCKET">
<img class="h-6 w-auto" src="../assets/bitbucket-logo.svg" />
</template>
- <span>{{ vcs.name }}</span>
+ <span>{{ vcs.title }}</span>
</button>
</template>
</div>
@@ -46,27 +46,31 @@ export default { name: "RepositoryVCSProviderPanel" };
<script setup lang="ts">
import { reactive, computed, watchEffect, onUnmounted, onMounted } from "vue";
import isEmpty from "lodash-es/isEmpty";
-import { OAuthWindowEventPayload, openWindowForOAuth, VCS } from "../types";
+import { OAuthWindowEventPayload, openWindowForOAuth } from "../types";
import { hasWorkspacePermissionV1 } from "../utils";
-import { pushNotification, useCurrentUserV1, useVCSStore } from "@/store";
+import { pushNotification, useCurrentUserV1, useVCSV1Store } from "@/store";
+import {
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
interface LocalState {
- selectedVCS?: VCS;
+ selectedVCS?: ExternalVersionControl;
}
const emit = defineEmits<{
(event: "next"): void;
- (event: "set-vcs", payload: VCS): void;
+ (event: "set-vcs", payload: ExternalVersionControl): void;
(event: "set-code", payload: string): void;
}>();
-const vcsStore = useVCSStore();
+const vcsV1Store = useVCSV1Store();
const state = reactive<LocalState>({});
const currentUserV1 = useCurrentUserV1();
const prepareVCSList = () => {
- vcsStore.fetchVCSList();
+ vcsV1Store.fetchVCSList();
};
watchEffect(prepareVCSList);
@@ -79,7 +83,7 @@ onUnmounted(() => {
});
const vcsList = computed(() => {
- return vcsStore.getVCSList();
+ return vcsV1Store.getVCSList();
});
const eventListener = (event: Event) => {
@@ -103,14 +107,14 @@ const canManageVCSProvider = computed(() => {
);
});
-const selectVCS = (vcs: VCS) => {
+const selectVCS = (vcs: ExternalVersionControl) => {
state.selectedVCS = vcs;
emit("set-vcs", vcs);
- let authorizeUrl = `${vcs.instanceUrl}/oauth/authorize`;
- if (vcs.type == "GITHUB") {
+ let authorizeUrl = `${vcs.url}/oauth/authorize`;
+ if (vcs.type === ExternalVersionControl_Type.GITHUB) {
authorizeUrl = `https://github.com/login/oauth/authorize`;
- } else if (vcs.type == "BITBUCKET") {
+ } else if (vcs.type === ExternalVersionControl_Type.BITBUCKET) {
authorizeUrl = `https://bitbucket.org/site/oauth2/authorize`;
}
openWindowForOAuth(
diff --git a/frontend/src/components/VCSCard.vue b/frontend/src/components/VCSCard.vue
index b279d6a357..fe9ff0f290 100644
--- a/frontend/src/components/VCSCard.vue
+++ b/frontend/src/components/VCSCard.vue
@@ -4,17 +4,17 @@
>
<div class="flex py-2 px-4 justify-between">
<div class="flex flex-row space-x-2 items-center">
- <template v-if="vcs.type.startsWith('GITLAB')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.GITLAB">
<img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />
</template>
- <template v-if="vcs.type.startsWith('GITHUB')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.GITHUB">
<img class="h-6 w-auto" src="../assets/github-logo.svg" />
</template>
- <template v-if="vcs.type.startsWith('BITBUCKET')">
+ <template v-if="vcs.type === ExternalVersionControl_Type.BITBUCKET">
<img class="h-6 w-auto" src="../assets/bitbucket-logo.svg" />
</template>
<h3 class="text-lg leading-6 font-medium text-main">
- {{ vcs.name }}
+ {{ vcs.title }}
</h3>
</div>
<button
@@ -32,7 +32,7 @@
{{ $t("common.instance") }} URL
</dt>
<dd class="mt-1 flex text-sm text-main col-span-2">
- {{ vcs.instanceUrl }}
+ {{ vcs.url }}
</dd>
</div>
<div class="grid grid-cols-4 gap-4 px-4 py-2 items-center">
@@ -48,43 +48,30 @@
</div>
</template>
-<script lang="ts">
-import { reactive, PropType, defineComponent } from "vue";
+<script lang="ts" setup>
+import { PropType } from "vue";
import { useRouter } from "vue-router";
-import { VCS, redirectUrl } from "../types";
-import { vcsSlug } from "../utils";
+import { vcsSlugV1 } from "../utils";
+import {
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-interface LocalState {}
-
-export default defineComponent({
- name: "VCSCard",
- components: {},
- props: {
- vcs: {
- required: true,
- type: Object as PropType<VCS>,
- },
+const props = defineProps({
+ vcs: {
+ required: true,
+ type: Object as PropType<ExternalVersionControl>,
},
- setup(props) {
- const router = useRouter();
-
- const state = reactive<LocalState>({});
+});
- const editVCS = () => {
- router.push({
- name: "setting.workspace.gitops.detail",
- params: {
- vcsSlug: vcsSlug(props.vcs),
- },
- });
- };
+const router = useRouter();
- return {
- state,
- redirectUrl,
- editVCS,
- };
- },
-});
+const editVCS = () => {
+ router.push({
+ name: "setting.workspace.gitops.detail",
+ params: {
+ vcsSlug: vcsSlugV1(props.vcs),
+ },
+ });
+};
</script>
diff --git a/frontend/src/components/VCSProviderBasicInfoPanel.vue b/frontend/src/components/VCSProviderBasicInfoPanel.vue
index 914d0f1368..fc3cf34b0e 100644
--- a/frontend/src/components/VCSProviderBasicInfoPanel.vue
+++ b/frontend/src/components/VCSProviderBasicInfoPanel.vue
@@ -119,6 +119,7 @@ import isEmpty from "lodash-es/isEmpty";
import { TEXT_VALIDATION_DELAY, VCSConfig } from "../types";
import { isUrl } from "../utils";
import { useI18n } from "vue-i18n";
+import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
interface LocalState {
urlValidationTimer?: ReturnType<typeof setTimeout>;
@@ -147,30 +148,30 @@ export default defineComponent({
});
const namePlaceholder = computed((): string => {
- if (props.config.type == "GITLAB") {
+ if (props.config.type === ExternalVersionControl_Type.GITLAB) {
if (props.config.uiType == "GITLAB_SELF_HOST") {
return t("gitops.setting.add-git-provider.gitlab-self-host");
} else if (props.config.uiType == "GITLAB_COM") {
return "GitLab.com";
}
- } else if (props.config.type == "GITHUB") {
+ } else if (props.config.type === ExternalVersionControl_Type.GITHUB) {
return "GitHub.com";
- } else if (props.config.type == "BITBUCKET") {
+ } else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return "Bitbucket.org";
}
return "";
});
const instanceUrlLabel = computed((): string => {
- if (props.config.type == "GITLAB") {
+ if (props.config.type === ExternalVersionControl_Type.GITLAB) {
return t(
"gitops.setting.add-git-provider.basic-info.gitlab-instance-url"
);
- } else if (props.config.type == "GITHUB") {
+ } else if (props.config.type === ExternalVersionControl_Type.GITHUB) {
return t(
"gitops.setting.add-git-provider.basic-info.github-instance-url"
);
- } else if (props.config.type == "BITBUCKET") {
+ } else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return t(
"gitops.setting.add-git-provider.basic-info.bitbucket-instance-url"
);
@@ -179,15 +180,15 @@ export default defineComponent({
});
const instanceUrlPlaceholder = computed((): string => {
- if (props.config.type == "GITLAB") {
+ if (props.config.type === ExternalVersionControl_Type.GITLAB) {
if (props.config.uiType == "GITLAB_SELF_HOST") {
return "https://gitlab.example.com";
} else if (props.config.uiType == "GITLAB_COM") {
return "https://gitlab.com";
}
- } else if (props.config.type == "GITHUB") {
+ } else if (props.config.type === ExternalVersionControl_Type.GITHUB) {
return "https://github.com";
- } else if (props.config.type == "BITBUCKET") {
+ } else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return "https://bitbucket.org";
}
return "";
@@ -196,9 +197,10 @@ export default defineComponent({
// github.com instance url is always https://github.com
const instanceUrlDisabled = computed((): boolean => {
return (
- props.config.type == "GITHUB" ||
- props.config.type == "BITBUCKET" ||
- (props.config.type == "GITLAB" && props.config.uiType == "GITLAB_COM")
+ props.config.type === ExternalVersionControl_Type.GITHUB ||
+ props.config.type === ExternalVersionControl_Type.BITBUCKET ||
+ (props.config.type === ExternalVersionControl_Type.GITLAB &&
+ props.config.uiType == "GITLAB_COM")
);
});
@@ -232,7 +234,7 @@ export default defineComponent({
const changeUIType = () => {
if (props.config.uiType == "GITLAB_SELF_HOST") {
// eslint-disable-next-line vue/no-mutating-props
- props.config.type = "GITLAB";
+ props.config.type = ExternalVersionControl_Type.GITLAB;
// eslint-disable-next-line vue/no-mutating-props
props.config.instanceUrl = "";
// eslint-disable-next-line vue/no-mutating-props
@@ -241,21 +243,21 @@ export default defineComponent({
);
} else if (props.config.uiType == "GITLAB_COM") {
// eslint-disable-next-line vue/no-mutating-props
- props.config.type = "GITLAB";
+ props.config.type = ExternalVersionControl_Type.GITLAB;
// eslint-disable-next-line vue/no-mutating-props
props.config.instanceUrl = "https://gitlab.com";
// eslint-disable-next-line vue/no-mutating-props
props.config.name = "GitLab.com";
} else if (props.config.uiType == "GITHUB_COM") {
// eslint-disable-next-line vue/no-mutating-props
- props.config.type = "GITHUB";
+ props.config.type = ExternalVersionControl_Type.GITHUB;
// eslint-disable-next-line vue/no-mutating-props
props.config.instanceUrl = "https://github.com";
// eslint-disable-next-line vue/no-mutating-props
props.config.name = "GitHub.com";
} else if (props.config.uiType == "BITBUCKET_ORG") {
// eslint-disable-next-line vue/no-mutating-props
- props.config.type = "BITBUCKET";
+ props.config.type = ExternalVersionControl_Type.BITBUCKET;
// eslint-disable-next-line vue/no-mutating-props
props.config.instanceUrl = "https://bitbucket.org";
// eslint-disable-next-line vue/no-mutating-props
diff --git a/frontend/src/components/VCSProviderOAuthPanel.vue b/frontend/src/components/VCSProviderOAuthPanel.vue
index 4ab62424c2..3ed5405ecb 100644
--- a/frontend/src/components/VCSProviderOAuthPanel.vue
+++ b/frontend/src/components/VCSProviderOAuthPanel.vue
@@ -376,6 +376,7 @@ import {
} from "../types";
import { useI18n } from "vue-i18n";
import { pushNotification } from "@/store";
+import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
interface LocalState {
applicationIdValidationTimer?: ReturnType<typeof setTimeout>;
@@ -528,15 +529,15 @@ export default defineComponent({
};
const applicationIdErrorDescription = computed((): string => {
- if (props.config.type == "GITLAB") {
+ if (props.config.type === ExternalVersionControl_Type.GITLAB) {
return t(
"gitops.setting.add-git-provider.oauth-info.gitlab-application-id-error"
);
- } else if (props.config.type == "GITHUB") {
+ } else if (props.config.type === ExternalVersionControl_Type.GITHUB) {
return t(
"gitops.setting.add-git-provider.oauth-info.github-application-id-error"
);
- } else if (props.config.type == "BITBUCKET") {
+ } else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return t(
"gitops.setting.add-git-provider.oauth-info.bitbucket-application-id-error"
);
@@ -545,15 +546,15 @@ export default defineComponent({
});
const secretErrorDescription = computed((): string => {
- if (props.config.type == "GITLAB") {
+ if (props.config.type === ExternalVersionControl_Type.GITLAB) {
return t(
"gitops.setting.add-git-provider.oauth-info.gitlab-secret-error"
);
- } else if (props.config.type == "GITHUB") {
+ } else if (props.config.type === ExternalVersionControl_Type.GITHUB) {
return t(
"gitops.setting.add-git-provider.oauth-info.github-secret-error"
);
- } else if (props.config.type == "BITBUCKET") {
+ } else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return t(
"gitops.setting.add-git-provider.oauth-info.bitbucket-secret-error"
);
diff --git a/frontend/src/components/VCSSetupWizard.vue b/frontend/src/components/VCSSetupWizard.vue
index ec6fd68108..9b517ecf8a 100644
--- a/frontend/src/components/VCSSetupWizard.vue
+++ b/frontend/src/components/VCSSetupWizard.vue
@@ -25,14 +25,8 @@
</BBStepTab>
</template>
-<script lang="ts">
-import {
- reactive,
- computed,
- onUnmounted,
- onMounted,
- defineComponent,
-} from "vue";
+<script lang="ts" setup>
+import { reactive, computed, onUnmounted, onMounted } from "vue";
import { useRouter } from "vue-router";
import isEmpty from "lodash-es/isEmpty";
import { BBStepTabItem } from "../bbkit/types";
@@ -42,15 +36,17 @@ import VCSProviderConfirmPanel from "./VCSProviderConfirmPanel.vue";
import {
isValidVCSApplicationIdOrSecret,
VCSConfig,
- VCSCreate,
- VCS,
openWindowForOAuth,
OAuthWindowEventPayload,
OAuthToken,
} from "../types";
import { isUrl } from "../utils";
import { useI18n } from "vue-i18n";
-import { pushNotification, useOAuthStore, useVCSStore } from "@/store";
+import { pushNotification, useOAuthStore, useVCSV1Store } from "@/store";
+import {
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
const BASIC_INFO_STEP = 0;
const OAUTH_INFO_STEP = 1;
@@ -62,206 +58,185 @@ interface LocalState {
oAuthResultCallback?: (token: OAuthToken | undefined) => void;
}
-export default defineComponent({
- name: "VCSSetupWizard",
- components: {
- VCSProviderBasicInfoPanel,
- VCSProviderOAuthPanel,
- VCSProviderConfirmPanel,
+const { t } = useI18n();
+const router = useRouter();
+const vcsV1Store = useVCSV1Store();
+
+const stepList: BBStepTabItem[] = [
+ { title: t("gitops.setting.add-git-provider.basic-info.self") },
+ { title: t("gitops.setting.add-git-provider.oauth-info.self") },
+ { title: t("common.confirm") },
+];
+
+const state = reactive<LocalState>({
+ config: {
+ type: ExternalVersionControl_Type.GITLAB,
+ uiType: "GITLAB_SELF_HOST",
+ name: t("gitops.setting.add-git-provider.gitlab-self-host"),
+ instanceUrl: "",
+ applicationId: "",
+ secret: "",
},
- setup() {
- const { t } = useI18n();
- const router = useRouter();
- const vcsStore = useVCSStore();
-
- const stepList: BBStepTabItem[] = [
- { title: t("gitops.setting.add-git-provider.basic-info.self") },
- { title: t("gitops.setting.add-git-provider.oauth-info.self") },
- { title: t("common.confirm") },
- ];
-
- const state = reactive<LocalState>({
- config: {
- type: "GITLAB",
- uiType: "GITLAB_SELF_HOST",
- name: t("gitops.setting.add-git-provider.gitlab-self-host"),
- instanceUrl: "",
- applicationId: "",
- secret: "",
- },
- currentStep: 0,
- });
-
- onMounted(() => {
- window.addEventListener("bb.oauth.register-vcs", eventListener, false);
- });
+ currentStep: 0,
+});
- onUnmounted(() => {
- window.removeEventListener("bb.oauth.register-vcs", eventListener);
- });
+onMounted(() => {
+ window.addEventListener("bb.oauth.register-vcs", eventListener, false);
+});
- const eventListener = (event: Event) => {
- const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
- if (isEmpty(payload.error)) {
- if (
- state.config.type == "GITLAB" ||
- state.config.type == "GITHUB" ||
- state.config.type == "BITBUCKET"
- ) {
- useOAuthStore()
- .exchangeVCSToken({
- vcsType: state.config.type,
- instanceUrl: state.config.instanceUrl,
- clientId: state.config.applicationId,
- clientSecret: state.config.secret,
- code: payload.code,
- })
- .then((token: OAuthToken) => {
- state.oAuthResultCallback!(token);
- })
- .catch(() => {
- state.oAuthResultCallback!(undefined);
- });
- }
- } else {
- state.oAuthResultCallback!(undefined);
- }
- };
+onUnmounted(() => {
+ window.removeEventListener("bb.oauth.register-vcs", eventListener);
+});
- const allowNext = computed((): boolean => {
- if (state.currentStep == BASIC_INFO_STEP) {
- return isUrl(state.config.instanceUrl);
- } else if (state.currentStep == OAUTH_INFO_STEP) {
- return (
- isValidVCSApplicationIdOrSecret(
- state.config.type,
- state.config.applicationId
- ) &&
- isValidVCSApplicationIdOrSecret(
- state.config.type,
- state.config.secret
- )
- );
- }
- return true;
- });
+const eventListener = (event: Event) => {
+ const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
+ if (isEmpty(payload.error)) {
+ if (
+ state.config.type === ExternalVersionControl_Type.GITLAB ||
+ state.config.type === ExternalVersionControl_Type.GITHUB ||
+ state.config.type === ExternalVersionControl_Type.BITBUCKET
+ ) {
+ useOAuthStore()
+ .exchangeVCSToken({
+ vcsType: state.config.type,
+ instanceUrl: state.config.instanceUrl,
+ clientId: state.config.applicationId,
+ clientSecret: state.config.secret,
+ code: payload.code,
+ })
+ .then((token: OAuthToken) => {
+ state.oAuthResultCallback!(token);
+ })
+ .catch(() => {
+ state.oAuthResultCallback!(undefined);
+ });
+ }
+ } else {
+ state.oAuthResultCallback!(undefined);
+ }
+};
+
+const allowNext = computed((): boolean => {
+ if (state.currentStep == BASIC_INFO_STEP) {
+ return isUrl(state.config.instanceUrl);
+ } else if (state.currentStep == OAUTH_INFO_STEP) {
+ return (
+ isValidVCSApplicationIdOrSecret(
+ state.config.type,
+ state.config.applicationId
+ ) &&
+ isValidVCSApplicationIdOrSecret(state.config.type, state.config.secret)
+ );
+ }
+ return true;
+});
- const attentionText = computed((): string => {
- if (state.config.type == "GITLAB") {
- if (state.config.uiType == "GITLAB_SELF_HOST") {
- return t(
- "gitops.setting.add-git-provider.gitlab-self-host-admin-requirement"
- );
- }
- return t(
- "gitops.setting.add-git-provider.gitlab-com-admin-requirement"
- );
- } else if (state.config.type == "GITHUB") {
- return t(
- "gitops.setting.add-git-provider.github-com-admin-requirement"
- );
- } else if (state.config.type == "BITBUCKET") {
- return t("gitops.setting.add-git-provider.bitbucket-admin-requirement");
- }
- return "";
- });
+const attentionText = computed((): string => {
+ if (state.config.type === ExternalVersionControl_Type.GITLAB) {
+ if (state.config.uiType == "GITLAB_SELF_HOST") {
+ return t(
+ "gitops.setting.add-git-provider.gitlab-self-host-admin-requirement"
+ );
+ }
+ return t("gitops.setting.add-git-provider.gitlab-com-admin-requirement");
+ } else if (state.config.type === ExternalVersionControl_Type.GITHUB) {
+ return t("gitops.setting.add-git-provider.github-com-admin-requirement");
+ } else if (state.config.type === ExternalVersionControl_Type.BITBUCKET) {
+ return t("gitops.setting.add-git-provider.bitbucket-admin-requirement");
+ }
+ return "";
+});
- const showAttention = computed((): boolean => {
- return state.currentStep != CONFIRM_STEP;
- });
+const showAttention = computed((): boolean => {
+ return state.currentStep != CONFIRM_STEP;
+});
- const tryChangeStep = (
- oldStep: number,
- newStep: number,
- allowChangeCallback: () => void
- ) => {
- // If we are trying to move from OAuth step to Confirm step, we first verify
- // the OAuth info is correct. We achieve this by:
- // 1. Kicking of the OAuth workflow to verify the current user can login to the GitLab instance and the application id is correct.
- // 2. If step 1 succeeds, we will get a code, we use this code together with the secret to exchange for the access token. (see eventListener)
- if (state.currentStep == OAUTH_INFO_STEP && newStep > oldStep) {
- let authorizeUrl = `${state.config.instanceUrl}/oauth/authorize`;
- if (state.config.type == "GITHUB") {
- authorizeUrl = `https://github.com/login/oauth/authorize`;
- } else if (state.config.type == "BITBUCKET") {
- authorizeUrl = `https://bitbucket.org/site/oauth2/authorize`;
- }
- const newWindow = openWindowForOAuth(
- authorizeUrl,
- state.config.applicationId,
- "bb.oauth.register-vcs",
- state.config.type
- );
- if (newWindow) {
- state.oAuthResultCallback = (token: OAuthToken | undefined) => {
- if (token) {
- state.currentStep = newStep;
- allowChangeCallback();
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("gitops.setting.add-git-provider.oauth-info-correct"),
- });
- } else {
- let description = "";
- if (state.config.type == "GITLAB") {
- // If application id mismatches, the OAuth workflow will stop early.
- // So the only possibility to reach here is we have a matching application id, while
- // we failed to exchange a token, and it's likely we are requesting with a wrong secret.
- description = t(
- "gitops.setting.add-git-provider.check-oauth-info-match"
- );
- }
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Failed to setup OAuth",
- description: description,
- });
- }
- };
+const tryChangeStep = (
+ oldStep: number,
+ newStep: number,
+ allowChangeCallback: () => void
+) => {
+ // If we are trying to move from OAuth step to Confirm step, we first verify
+ // the OAuth info is correct. We achieve this by:
+ // 1. Kicking of the OAuth workflow to verify the current user can login to the GitLab instance and the application id is correct.
+ // 2. If step 1 succeeds, we will get a code, we use this code together with the secret to exchange for the access token. (see eventListener)
+ if (state.currentStep == OAUTH_INFO_STEP && newStep > oldStep) {
+ let authorizeUrl = `${state.config.instanceUrl}/oauth/authorize`;
+ if (state.config.type === ExternalVersionControl_Type.GITHUB) {
+ authorizeUrl = `https://github.com/login/oauth/authorize`;
+ } else if (state.config.type === ExternalVersionControl_Type.BITBUCKET) {
+ authorizeUrl = `https://bitbucket.org/site/oauth2/authorize`;
+ }
+ const newWindow = openWindowForOAuth(
+ authorizeUrl,
+ state.config.applicationId,
+ "bb.oauth.register-vcs",
+ state.config.type
+ );
+ if (newWindow) {
+ state.oAuthResultCallback = (token: OAuthToken | undefined) => {
+ if (token) {
+ state.currentStep = newStep;
+ allowChangeCallback();
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("gitops.setting.add-git-provider.oauth-info-correct"),
+ });
+ } else {
+ let description = "";
+ if (state.config.type == ExternalVersionControl_Type.GITLAB) {
+ // If application id mismatches, the OAuth workflow will stop early.
+ // So the only possibility to reach here is we have a matching application id, while
+ // we failed to exchange a token, and it's likely we are requesting with a wrong secret.
+ description = t(
+ "gitops.setting.add-git-provider.check-oauth-info-match"
+ );
+ }
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: "Failed to setup OAuth",
+ description: description,
+ });
}
- } else {
- state.currentStep = newStep;
- allowChangeCallback();
- }
- };
-
- const tryFinishSetup = (allowChangeCallback: () => void) => {
- const vcsCreate: VCSCreate = {
- ...state.config,
};
- vcsStore.createVCS(vcsCreate).then((vcs: VCS) => {
- allowChangeCallback();
- router.push({
- name: "setting.workspace.gitops",
- });
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("gitops.setting.add-git-provider.add-success", {
- vcs: vcs.name,
- }),
- });
- });
- };
-
- const cancelSetup = () => {
+ }
+ } else {
+ state.currentStep = newStep;
+ allowChangeCallback();
+ }
+};
+
+const tryFinishSetup = (allowChangeCallback: () => void) => {
+ vcsV1Store
+ .createVCS({
+ name: "",
+ title: state.config.name,
+ type: state.config.type,
+ url: state.config.instanceUrl,
+ applicationId: state.config.applicationId,
+ secret: state.config.secret,
+ apiUrl: "",
+ })
+ .then((vcs: ExternalVersionControl) => {
+ allowChangeCallback();
router.push({
name: "setting.workspace.gitops",
});
- };
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("gitops.setting.add-git-provider.add-success", {
+ vcs: vcs.title,
+ }),
+ });
+ });
+};
- return {
- stepList,
- state,
- allowNext,
- attentionText,
- showAttention,
- tryChangeStep,
- tryFinishSetup,
- cancelSetup,
- };
- },
-});
+const cancelSetup = () => {
+ router.push({
+ name: "setting.workspace.gitops",
+ });
+};
</script>
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 31617e5793..d83dec31a5 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -38,7 +38,7 @@ import DashboardSidebar from "@/views/DashboardSidebar.vue";
import Home from "@/views/Home.vue";
import {
hasFeature,
- useVCSStore,
+ useVCSV1Store,
useDataSourceStore,
useSQLReviewStore,
useLegacyProjectStore,
@@ -471,7 +471,9 @@ const routes: Array<RouteRecordRaw> = [
meta: {
title: (route: RouteLocationNormalized) => {
const slug = route.params.vcsSlug as string;
- return useVCSStore().getVCSById(idFromSlug(slug)).name;
+ return (
+ useVCSV1Store().getVCSByUid(idFromSlug(slug))?.title ?? ""
+ );
},
},
component: () =>
@@ -1502,8 +1504,8 @@ router.beforeEach((to, from, next) => {
}
if (vcsSlug) {
- useVCSStore()
- .fetchVCSById(idFromSlug(vcsSlug))
+ useVCSV1Store()
+ .fetchVCSByUid(idFromSlug(vcsSlug))
.then(() => {
next();
})
diff --git a/frontend/src/store/modules/gitlab.ts b/frontend/src/store/modules/gitlab.ts
index 083428a01b..d6af9161ba 100644
--- a/frontend/src/store/modules/gitlab.ts
+++ b/frontend/src/store/modules/gitlab.ts
@@ -1,6 +1,11 @@
import { defineStore } from "pinia";
import axios from "axios";
-import { ExternalRepositoryInfo, VCS, OAuthConfig, OAuthToken } from "@/types";
+import {
+ ExternalRepositoryInfo,
+ VCSId,
+ OAuthConfig,
+ OAuthToken,
+} from "@/types";
function convertGitLabProject(project: any): ExternalRepositoryInfo {
const attributes = project.attributes;
@@ -41,14 +46,14 @@ export const useGitlabStore = defineStore("gitlab", {
// TODO(zilong): here we still store the access token at the frontend, we may move this to the backend
async fetchProjectList({
- vcs,
+ vcsId,
token,
}: {
- vcs: VCS;
+ vcsId: VCSId;
token: OAuthToken;
}): Promise<ExternalRepositoryInfo[]> {
const data = (
- await axios.get(`/api/vcs/${vcs.id}/external-repository`, {
+ await axios.get(`/api/vcs/${vcsId}/external-repository`, {
headers: {
accessToken: token.accessToken,
refreshToken: token.refreshToken,
diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.ts
index 3b019b9b38..db1bcf651f 100644
--- a/frontend/src/store/modules/index.ts
+++ b/frontend/src/store/modules/index.ts
@@ -29,7 +29,6 @@ export * from "./connectionTree";
export * from "./tab";
export * from "./task";
export * from "./uistate";
-export * from "./vcs";
export * from "./sqlReview";
export * from "./onboardingState";
export * from "./onboardingGuide";
diff --git a/frontend/src/store/modules/oauth.ts b/frontend/src/store/modules/oauth.ts
index d60d0042b3..73e8c5e602 100644
--- a/frontend/src/store/modules/oauth.ts
+++ b/frontend/src/store/modules/oauth.ts
@@ -1,6 +1,10 @@
import { defineStore } from "pinia";
import axios from "axios";
-import { VCSId, OAuthToken, ResourceObject, VCSType } from "@/types";
+import { VCSId, OAuthToken, ResourceObject } from "@/types";
+import {
+ ExternalVersionControl_Type,
+ externalVersionControl_TypeToJSON,
+} from "@/types/proto/v1/externalvs_service";
const convert = (raw: ResourceObject): OAuthToken => {
const attr = raw.attributes;
@@ -52,7 +56,7 @@ export const useOAuthStore = defineStore("oauth", {
clientSecret,
code,
}: {
- vcsType: VCSType;
+ vcsType: ExternalVersionControl_Type;
instanceUrl: string;
clientId: string;
clientSecret: string;
@@ -63,7 +67,8 @@ export const useOAuthStore = defineStore("oauth", {
data: {
type: "exchangeToken",
attributes: {
- vcsType,
+ // TODO(ed): change vcs type
+ vcsType: externalVersionControl_TypeToJSON(vcsType),
instanceUrl,
clientId,
clientSecret,
diff --git a/frontend/src/store/modules/v1/common.ts b/frontend/src/store/modules/v1/common.ts
index ee3def7246..d4e8cb446f 100644
--- a/frontend/src/store/modules/v1/common.ts
+++ b/frontend/src/store/modules/v1/common.ts
@@ -148,3 +148,9 @@ export const getSheetPathByLegacyProject = (
export const getProjectPathFromRepoName = (repoName: string): string => {
return repoName.split("/gitOpsInfo")[0];
};
+
+export const getVCSUid = (name: string): number => {
+ const tokens = getNameParentTokens(name, [externalVersionControlPrefix]);
+ const vcsUid = Number(tokens[0] || UNKNOWN_ID);
+ return vcsUid;
+};
diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.ts
index deac00b14f..b504be99dc 100644
--- a/frontend/src/store/modules/v1/index.ts
+++ b/frontend/src/store/modules/v1/index.ts
@@ -13,4 +13,5 @@ export * from "./instance";
export * from "./subscription";
export * from "./actuator";
export * from "./repository";
+export * from "./vcs";
export * from "./changeHistory";
diff --git a/frontend/src/store/modules/v1/repository.ts b/frontend/src/store/modules/v1/repository.ts
index 9884e94bc3..64f3dbd44e 100644
--- a/frontend/src/store/modules/v1/repository.ts
+++ b/frontend/src/store/modules/v1/repository.ts
@@ -6,18 +6,13 @@ import {
externalVersionControlServiceClient,
} from "@/grpcweb";
import { ProjectGitOpsInfo } from "@/types/proto/v1/externalvs_service";
-import { VCSId, ComposedRepository } from "@/types";
-import {
- externalVersionControlPrefix,
- getProjectPathFromRepoName,
-} from "./common";
+import { ComposedRepository } from "@/types";
+import { getProjectPathFromRepoName } from "./common";
import { useProjectV1Store } from "./project";
export const useRepositoryV1Store = defineStore("repository_v1", () => {
const repositoryMapByProject = reactive(new Map<string, ProjectGitOpsInfo>());
- const repositoryMapByVCSId = reactive(
- new Map<string, ComposedRepository[]>()
- );
+ const repositoryMapByVCS = reactive(new Map<string, ComposedRepository[]>());
const fetchRepositoryByProject = async (
project: string
@@ -91,12 +86,12 @@ export const useRepositoryV1Store = defineStore("repository_v1", () => {
return resp.pullRequestUrl;
};
- const fetchRepositoryListByVCSId = async (
- vcsId: VCSId
+ const fetchRepositoryListByVCS = async (
+ vcsName: string
): Promise<ProjectGitOpsInfo[]> => {
const resp =
await externalVersionControlServiceClient.listProjectGitOpsInfo({
- name: `${externalVersionControlPrefix}${vcsId}`,
+ name: vcsName,
});
const projectV1Store = useProjectV1Store();
@@ -112,12 +107,12 @@ export const useRepositoryV1Store = defineStore("repository_v1", () => {
})
);
- repositoryMapByVCSId.set(`${vcsId}`, repoList);
+ repositoryMapByVCS.set(vcsName, repoList);
return repoList;
};
- const getRepositoryListByVCSId = (vcsId: VCSId): ComposedRepository[] => {
- return repositoryMapByVCSId.get(`${vcsId}`) || [];
+ const getRepositoryListByVCS = (vcsName: string): ComposedRepository[] => {
+ return repositoryMapByVCS.get(vcsName) || [];
};
return {
@@ -126,8 +121,8 @@ export const useRepositoryV1Store = defineStore("repository_v1", () => {
deleteRepository,
getRepositoryByProject,
getOrFetchRepositoryByProject,
- fetchRepositoryListByVCSId,
- getRepositoryListByVCSId,
+ fetchRepositoryListByVCS,
+ getRepositoryListByVCS,
};
});
diff --git a/frontend/src/store/modules/v1/vcs.ts b/frontend/src/store/modules/v1/vcs.ts
new file mode 100644
index 0000000000..ec280bf5bc
--- /dev/null
+++ b/frontend/src/store/modules/v1/vcs.ts
@@ -0,0 +1,103 @@
+import { defineStore } from "pinia";
+import { reactive } from "vue";
+import { isEqual, isUndefined } from "lodash-es";
+import { externalVersionControlServiceClient } from "@/grpcweb";
+import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";
+import { externalVersionControlPrefix } from "./common";
+import { VCSId } from "@/types";
+
+export const useVCSV1Store = defineStore("vcs_v1", () => {
+ const vcsMapByName = reactive(new Map<string, ExternalVersionControl>());
+
+ const fetchVCSList = async () => {
+ const resp =
+ await externalVersionControlServiceClient.listExternalVersionControls({});
+ for (const vcs of resp.externalVersionControls) {
+ vcsMapByName.set(vcs.name, vcs);
+ }
+ return resp.externalVersionControls;
+ };
+
+ const fetchVCSByName = async (name: string) => {
+ const vcs =
+ await externalVersionControlServiceClient.getExternalVersionControl({
+ name,
+ });
+
+ vcsMapByName.set(vcs.name, vcs);
+ return vcs;
+ };
+
+ const fetchVCSByUid = async (vcsId: VCSId) => {
+ return fetchVCSByName(`${externalVersionControlPrefix}${vcsId}`);
+ };
+
+ const getVCSByUid = (vcsId: VCSId) => {
+ return vcsMapByName.get(`${externalVersionControlPrefix}${vcsId}`);
+ };
+
+ const getVCSList = () => {
+ return [...vcsMapByName.values()];
+ };
+
+ const deleteVCS = async (name: string) => {
+ await externalVersionControlServiceClient.deleteExternalVersionControl({
+ name,
+ });
+ };
+
+ const createVCS = async (vcs: ExternalVersionControl) => {
+ const resp =
+ await externalVersionControlServiceClient.createExternalVersionControl({
+ externalVersionControl: vcs,
+ });
+ vcsMapByName.set(resp.name, resp);
+ return resp;
+ };
+
+ const updateVCS = async (vcs: Partial<ExternalVersionControl>) => {
+ if (!vcs.name) {
+ return;
+ }
+ const existed = await fetchVCSByName(vcs.name);
+ const updateMask = getUpdateMaskForVCS(existed, vcs);
+ if (updateMask.length === 0) {
+ return existed;
+ }
+ const resp =
+ await externalVersionControlServiceClient.updateExternalVersionControl({
+ externalVersionControl: vcs,
+ updateMask,
+ });
+ vcsMapByName.set(resp.name, resp);
+ return resp;
+ };
+
+ return {
+ getVCSByUid,
+ getVCSList,
+ fetchVCSByName,
+ fetchVCSByUid,
+ fetchVCSList,
+ deleteVCS,
+ createVCS,
+ updateVCS,
+ };
+});
+
+const getUpdateMaskForVCS = (
+ origin: ExternalVersionControl,
+ update: Partial<ExternalVersionControl>
+): string[] => {
+ const updateMask: string[] = [];
+ if (!isUndefined(update.title) && !isEqual(origin.title, update.title)) {
+ updateMask.push("title");
+ }
+ if (
+ !isUndefined(update.applicationId) &&
+ !isEqual(origin.applicationId, update.applicationId)
+ ) {
+ updateMask.push("application_id");
+ }
+ return updateMask;
+};
diff --git a/frontend/src/store/modules/vcs.ts b/frontend/src/store/modules/vcs.ts
deleted file mode 100644
index 39b578d1fc..0000000000
--- a/frontend/src/store/modules/vcs.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-import { defineStore } from "pinia";
-import axios from "axios";
-import {
- VCSId,
- VCS,
- VCSCreate,
- VCSState,
- ResourceObject,
- unknown,
- VCSPatch,
- empty,
- EMPTY_ID,
- VCSUIType,
-} from "@/types";
-
-function convert(vcs: ResourceObject, includedList: ResourceObject[]): VCS {
- let uiType: VCSUIType = "GITLAB_SELF_HOST";
- if (vcs.attributes.type == "GITLAB") {
- if (vcs.attributes.instanceUrl == "https://gitlab.com") {
- uiType = "GITLAB_COM";
- }
- } else if (vcs.attributes.type == "GITHUB") {
- uiType = "GITHUB_COM";
- } else if (vcs.attributes.type == "BITBUCKET") {
- uiType = "BITBUCKET_ORG";
- }
- return {
- ...(vcs.attributes as Omit<VCS, "id">),
- id: parseInt(vcs.id),
- uiType,
- };
-}
-
-export const useVCSStore = defineStore("vcs", {
- state: (): VCSState => ({
- vcsById: new Map(),
- // repositoryListByVCSId: new Map(),
- }),
-
- actions: {
- convert(vcs: ResourceObject, includedList: ResourceObject[]): VCS {
- return convert(vcs, includedList);
- },
-
- getVCSList(): VCS[] {
- const list = [];
- for (const [_, vcs] of this.vcsById) {
- list.push(vcs);
- }
- return list;
- },
-
- getVCSById(vcsId: VCSId): VCS {
- if (vcsId == EMPTY_ID) {
- return empty("VCS") as VCS;
- }
-
- return this.vcsById.get(vcsId) || (unknown("VCS") as VCS);
- },
-
- setVCSList(vcsList: VCS[]) {
- vcsList.forEach((vcs) => {
- this.vcsById.set(vcs.id, vcs);
- });
- },
-
- setVCSById({ vcsId, vcs }: { vcsId: VCSId; vcs: VCS }) {
- this.vcsById.set(vcsId, vcs);
- },
-
- async fetchVCSList() {
- const path = "/api/vcs";
- const data = (await axios.get(path)).data;
- const vcsList = data.data
- .map((vcs: ResourceObject) => {
- return convert(vcs, data.included);
- })
- .sort((a: VCS, b: VCS) => {
- return b.id - a.id;
- });
-
- this.setVCSList(vcsList);
-
- return vcsList;
- },
-
- async fetchVCSById(vcsId: VCSId) {
- const data = (await axios.get(`/api/vcs/${vcsId}`)).data;
- const vcs = convert(data.data, data.included);
-
- this.setVCSById({
- vcsId: vcs.id,
- vcs,
- });
- return vcs;
- },
-
- async createVCS(newVCS: VCSCreate) {
- const data = (
- await axios.post(`/api/vcs`, {
- data: {
- type: "VCSCreate",
- attributes: newVCS,
- },
- })
- ).data;
- const createdVCS = convert(data.data, data.included);
-
- this.setVCSById({
- vcsId: createdVCS.id,
- vcs: createdVCS,
- });
-
- return createdVCS;
- },
-
- async patchVCS({ vcsId, vcsPatch }: { vcsId: VCSId; vcsPatch: VCSPatch }) {
- const data = (
- await axios.patch(`/api/vcs/${vcsId}`, {
- data: {
- type: "VCSPatch",
- attributes: vcsPatch,
- },
- })
- ).data;
- const updatedVCS = convert(data.data, data.included);
-
- this.setVCSById({
- vcsId: updatedVCS.id,
- vcs: updatedVCS,
- });
-
- return updatedVCS;
- },
-
- async deleteVCSById(vcsId: VCSId) {
- await axios.delete(`/api/vcs/${vcsId}`);
-
- this.vcsById.delete(vcsId);
- },
- },
-});
diff --git a/frontend/src/types/oauth.ts b/frontend/src/types/oauth.ts
index 58eb562607..5a915ca467 100644
--- a/frontend/src/types/oauth.ts
+++ b/frontend/src/types/oauth.ts
@@ -1,4 +1,7 @@
-import { VCSType } from ".";
+import {
+ ExternalVersionControl_Type,
+ externalVersionControl_TypeToJSON,
+} from "@/types/proto/v1/externalvs_service";
export type OAuthConfig = {
endpoint: string;
@@ -37,13 +40,15 @@ export function openWindowForOAuth(
endpoint: string,
applicationId: string,
type: OAuthType,
- vcsType: VCSType
+ vcsType: ExternalVersionControl_Type
): Window | null {
// we use type to determine oauth type when receiving the callback
- const stateQueryParameter = `${type}.${vcsType}-${applicationId}`;
+ const stateQueryParameter = `${type}.${externalVersionControl_TypeToJSON(
+ vcsType
+ )}-${applicationId}`;
sessionStorage.setItem(OAuthStateSessionKey, stateQueryParameter);
- if (vcsType == "GITHUB") {
+ if (vcsType == ExternalVersionControl_Type.GITHUB) {
// GitHub OAuth App scopes: https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps
// We need the workflow scope to update GitHub action files.
return window.open(
@@ -53,7 +58,7 @@ export function openWindowForOAuth(
"oauth",
"location=yes,left=200,top=200,height=640,width=480,scrollbars=yes,status=yes"
);
- } else if (vcsType == "BITBUCKET") {
+ } else if (vcsType == ExternalVersionControl_Type.BITBUCKET) {
// Bitbucket OAuth App scopes: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication
return window.open(
`${endpoint}?client_id=${applicationId}&redirect_uri=${encodeURIComponent(
diff --git a/frontend/src/types/project.ts b/frontend/src/types/project.ts
index 697a3dd677..bf23b6b3cd 100644
--- a/frontend/src/types/project.ts
+++ b/frontend/src/types/project.ts
@@ -3,8 +3,8 @@ import { ProjectId } from "./id";
import { OAuthToken } from "./oauth";
import { Principal } from "./principal";
import { ExternalRepositoryInfo, RepositoryConfig } from "./repository";
-import { VCS } from "./vcs";
import { SchemaChange } from "@/types/proto/v1/project_service";
+import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";
export type ProjectRoleType =
| "OWNER"
@@ -66,7 +66,7 @@ export type ProjectMember = {
};
export type ProjectRepositoryConfig = {
- vcs: VCS;
+ vcs: ExternalVersionControl;
// TODO(zilong): get rid of the token in the frontend.
token: OAuthToken;
code: string;
diff --git a/frontend/src/types/proto/v1/externalvs_service.ts b/frontend/src/types/proto/v1/externalvs_service.ts
index c62a4d3d34..d5b9e99937 100644
--- a/frontend/src/types/proto/v1/externalvs_service.ts
+++ b/frontend/src/types/proto/v1/externalvs_service.ts
@@ -120,12 +120,12 @@ export interface ExternalVersionControl {
export enum ExternalVersionControl_Type {
TYPE_UNSPECIFIED = 0,
- /** TYPE_GITHUB - GitHub type. Using for GitHub community edition(ce). */
- TYPE_GITHUB = 1,
- /** TYPE_GITLAB - GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). */
- TYPE_GITLAB = 2,
- /** TYPE_BITBUCKET - BitBucket type. Using for BitBucket cloud or BitBucket server. */
- TYPE_BITBUCKET = 3,
+ /** GITHUB - GitHub type. Using for GitHub community edition(ce). */
+ GITHUB = 1,
+ /** GITLAB - GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). */
+ GITLAB = 2,
+ /** BITBUCKET - BitBucket type. Using for BitBucket cloud or BitBucket server. */
+ BITBUCKET = 3,
UNRECOGNIZED = -1,
}
@@ -135,14 +135,14 @@ export function externalVersionControl_TypeFromJSON(object: any): ExternalVersio
case "TYPE_UNSPECIFIED":
return ExternalVersionControl_Type.TYPE_UNSPECIFIED;
case 1:
- case "TYPE_GITHUB":
- return ExternalVersionControl_Type.TYPE_GITHUB;
+ case "GITHUB":
+ return ExternalVersionControl_Type.GITHUB;
case 2:
- case "TYPE_GITLAB":
- return ExternalVersionControl_Type.TYPE_GITLAB;
+ case "GITLAB":
+ return ExternalVersionControl_Type.GITLAB;
case 3:
- case "TYPE_BITBUCKET":
- return ExternalVersionControl_Type.TYPE_BITBUCKET;
+ case "BITBUCKET":
+ return ExternalVersionControl_Type.BITBUCKET;
case -1:
case "UNRECOGNIZED":
default:
@@ -154,12 +154,12 @@ export function externalVersionControl_TypeToJSON(object: ExternalVersionControl
switch (object) {
case ExternalVersionControl_Type.TYPE_UNSPECIFIED:
return "TYPE_UNSPECIFIED";
- case ExternalVersionControl_Type.TYPE_GITHUB:
- return "TYPE_GITHUB";
- case ExternalVersionControl_Type.TYPE_GITLAB:
- return "TYPE_GITLAB";
- case ExternalVersionControl_Type.TYPE_BITBUCKET:
- return "TYPE_BITBUCKET";
+ case ExternalVersionControl_Type.GITHUB:
+ return "GITHUB";
+ case ExternalVersionControl_Type.GITLAB:
+ return "GITLAB";
+ case ExternalVersionControl_Type.BITBUCKET:
+ return "BITBUCKET";
case ExternalVersionControl_Type.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
diff --git a/frontend/src/types/store.ts b/frontend/src/types/store.ts
index b371f19b02..be059ce0e1 100644
--- a/frontend/src/types/store.ts
+++ b/frontend/src/types/store.ts
@@ -23,7 +23,6 @@ import { IssueSubscriber } from "./issueSubscriber";
import { Notification } from "./notification";
import { Principal } from "./principal";
import { Project } from "./project";
-import { Repository } from "./repository";
import { VCS } from "./vcs";
import { Label } from "./label";
import type { AuditLog } from "@/types/auditLog";
@@ -113,12 +112,6 @@ export interface VCSState {
vcsById: Map<VCSId, VCS>;
}
-export interface RepositoryState {
- // repositoryListByVCSId are used in workspace GitOps panel, while repositoryByProjectId are used in project GitOps panel.
- // Because they are used separately, so we don't need to worry about repository inconsistency issue between them.
- repositoryListByVCSId: Map<VCSId, Repository[]>;
-}
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AnomalyState {}
diff --git a/frontend/src/types/vcs.ts b/frontend/src/types/vcs.ts
index 6643b70763..f4f512b39a 100644
--- a/frontend/src/types/vcs.ts
+++ b/frontend/src/types/vcs.ts
@@ -1,4 +1,5 @@
import { VCSId } from "./id";
+import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
// Backend uses the same ENUM for GitLab/GitHub SaaS and self-hosted. Because they are based on the
// same codebase.
@@ -12,7 +13,7 @@ export type VCSUIType =
| "BITBUCKET_ORG";
export interface VCSConfig {
- type: VCSType;
+ type: ExternalVersionControl_Type;
uiType: VCSUIType;
name: string;
instanceUrl: string;
@@ -33,22 +34,6 @@ export type VCS = {
secret: string;
};
-export type VCSCreate = {
- // Domain specific fields
- name: string;
- type: VCSType;
- instanceUrl: string;
- applicationId: string;
- secret: string;
-};
-
-export type VCSPatch = {
- // Domain specific fields
- name?: string;
- applicationId?: string;
- secret?: string;
-};
-
export type VCSTokenCreate = {
code: string;
redirectUrl: string;
@@ -88,14 +73,14 @@ export type VCSPushEvent = {
};
export function isValidVCSApplicationIdOrSecret(
- vcsType: VCSType,
+ vcsType: ExternalVersionControl_Type,
str: string
): boolean {
- if (vcsType == "GITLAB") {
+ if (vcsType == ExternalVersionControl_Type.GITLAB) {
return /^[a-zA-Z0-9_]{64}$/.test(str);
- } else if (vcsType == "GITHUB") {
+ } else if (vcsType == ExternalVersionControl_Type.GITHUB) {
return /^[a-zA-Z0-9_]{20}$|^[a-zA-Z0-9_]{40}$/.test(str);
- } else if (vcsType == "BITBUCKET") {
+ } else if (vcsType == ExternalVersionControl_Type.BITBUCKET) {
return /^[a-zA-Z0-9_]{18}$|^[a-zA-Z0-9_]{32}$/.test(str);
}
return false;
diff --git a/frontend/src/utils/slug.ts b/frontend/src/utils/slug.ts
index 99c2b631ba..de8b6c863a 100644
--- a/frontend/src/utils/slug.ts
+++ b/frontend/src/utils/slug.ts
@@ -6,17 +6,18 @@ import {
Instance,
IssueId,
Project,
- VCS,
SQLReviewPolicy,
UNKNOWN_ID,
} from "../types";
import { IdType } from "../types/id";
import { Sheet as SheetV1 } from "@/types/proto/v1/sheet_service";
import { Project as ProjectV1 } from "@/types/proto/v1/project_service";
+import { ExternalVersionControl as VCSV1 } from "@/types/proto/v1/externalvs_service";
import {
getProjectAndSheetId,
projectNamePrefix,
sheetNamePrefix,
+ getVCSUid,
} from "@/store/modules/v1/common";
export function idFromSlug(slug: string): IdType {
@@ -81,8 +82,8 @@ export function fullDatabasePath(database: Database): string {
return `/db/${databaseSlug(database)}`;
}
-export function vcsSlug(vcs: VCS): string {
- return [slug(vcs.name), vcs.id].join("-");
+export function vcsSlugV1(vcs: VCSV1): string {
+ return [slug(vcs.title), getVCSUid(vcs.name)].join("-");
}
export function sqlReviewPolicySlug(reviewPolicy: SQLReviewPolicy): string {
diff --git a/frontend/src/utils/v1/index.ts b/frontend/src/utils/v1/index.ts
index 53c60ba6ef..c1fb3d0849 100644
--- a/frontend/src/utils/v1/index.ts
+++ b/frontend/src/utils/v1/index.ts
@@ -12,5 +12,6 @@ export * from "./user";
export * from "./instance";
export * from "./sqlEditor";
export * from "./sheet";
+export * from "./vcs";
export * from "./review";
export * from "./changeHistory";
diff --git a/frontend/src/utils/v1/vcs.ts b/frontend/src/utils/v1/vcs.ts
new file mode 100644
index 0000000000..49241fe209
--- /dev/null
+++ b/frontend/src/utils/v1/vcs.ts
@@ -0,0 +1,21 @@
+import { VCSUIType } from "@/types";
+import {
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
+
+export const getVCSUIType = (vcs: ExternalVersionControl): VCSUIType => {
+ switch (vcs.type) {
+ case ExternalVersionControl_Type.GITHUB:
+ return "GITHUB_COM";
+ case ExternalVersionControl_Type.BITBUCKET:
+ return "BITBUCKET_ORG";
+ case ExternalVersionControl_Type.GITLAB:
+ if (vcs.url === "https://gitlab.com") {
+ return "GITLAB_COM";
+ }
+ return "GITLAB_SELF_HOST";
+ default:
+ return "GITLAB_SELF_HOST";
+ }
+};
diff --git a/frontend/src/views/SettingWorkspaceVCS.vue b/frontend/src/views/SettingWorkspaceVCS.vue
index 226ab6328a..ce1fc7ba81 100644
--- a/frontend/src/views/SettingWorkspaceVCS.vue
+++ b/frontend/src/views/SettingWorkspaceVCS.vue
@@ -35,7 +35,7 @@ import { reactive, computed, watchEffect, defineComponent } from "vue";
import { useRouter } from "vue-router";
import VCSCard from "../components/VCSCard.vue";
import VCSSetupWizard from "../components/VCSSetupWizard.vue";
-import { useVCSStore } from "@/store";
+import { useVCSV1Store } from "@/store";
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface LocalState {}
@@ -47,18 +47,18 @@ export default defineComponent({
VCSSetupWizard,
},
setup() {
- const vcsStore = useVCSStore();
+ const vcsV1Store = useVCSV1Store();
const router = useRouter();
const state = reactive<LocalState>({});
const prepareVCSList = () => {
- vcsStore.fetchVCSList();
+ vcsV1Store.fetchVCSList();
};
watchEffect(prepareVCSList);
const vcsList = computed(() => {
- return vcsStore.getVCSList();
+ return vcsV1Store.getVCSList();
});
const addVCSProvider = () => {
diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vue
index 92d9c9e894..034eb0ce34 100644
--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue
+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue
@@ -2,7 +2,7 @@
<div class="mt-4 space-y-4">
<div class="flex justify-end">
<div
- v-if="vcs.uiType == 'GITLAB_SELF_HOST'"
+ v-if="vcsUIType == 'GITLAB_SELF_HOST'"
class="flex flex-row items-center space-x-2"
>
<div class="textlabel whitespace-nowrap">
@@ -11,21 +11,21 @@
<img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />
</div>
<div
- v-else-if="vcs.uiType == 'GITLAB_COM'"
+ v-else-if="vcsUIType == 'GITLAB_COM'"
class="flex flex-row items-center space-x-2"
>
<div class="textlabel whitespace-nowrap">GitLab.com</div>
<img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />
</div>
<div
- v-else-if="vcs.uiType == 'GITHUB_COM'"
+ v-else-if="vcsUIType == 'GITHUB_COM'"
class="flex flex-row items-center space-x-2"
>
<div class="textlabel whitespace-nowrap">GitHub.com</div>
<img class="h-6 w-auto" src="../assets/github-logo.svg" />
</div>
<div
- v-else-if="vcs.uiType == 'BITBUCKET_ORG'"
+ v-else-if="vcsUIType == 'BITBUCKET_ORG'"
class="flex flex-row items-center space-x-2"
>
<div class="textlabel whitespace-nowrap">Bitbucket.org</div>
@@ -43,7 +43,7 @@
type="text"
class="textfield mt-1 w-full"
disabled="true"
- :value="vcs.instanceUrl"
+ :value="vcs?.url"
/>
</div>
@@ -58,7 +58,7 @@
</p>
<input
id="name"
- v-model="state.name"
+ v-model="state.title"
name="name"
type="text"
class="textfield mt-1 w-full"
@@ -70,7 +70,7 @@
{{ $t("common.application") }} ID
</label>
<p class="mt-1 textinfolabel">
- <template v-if="vcs.uiType == 'GITLAB_SELF_HOST'">
+ <template v-if="vcsUIType == 'GITLAB_SELF_HOST'">
{{
$t(
"gitops.setting.git-provider.gitlab-self-host-application-id-label"
@@ -80,7 +80,7 @@
$t("gitops.setting.git-provider.view-in-gitlab")
}}</a>
</template>
- <template v-else-if="vcs.uiType == 'GITLAB_COM'">
+ <template v-else-if="vcsUIType == 'GITLAB_COM'">
{{
$t("gitops.setting.git-provider.gitlab-com-application-id-label")
}}
@@ -88,7 +88,7 @@
$t("gitops.setting.git-provider.view-in-gitlab")
}}</a>
</template>
- <template v-else-if="vcs.uiType == 'GITHUB_COM'">
+ <template v-else-if="vcsUIType == 'GITHUB_COM'">
{{ $t("gitops.setting.git-provider.github-application-id-label") }}
</template>
</p>
@@ -104,13 +104,13 @@
<div>
<label for="secret" class="textlabel"> Secret </label>
<p class="mt-1 textinfolabel">
- <template v-if="vcs.uiType == 'GITLAB_SELF_HOST'">
+ <template v-if="vcsUIType == 'GITLAB_SELF_HOST'">
{{ $t("gitops.setting.git-provider.gitlab-self-host-secret-label") }}
</template>
- <template v-else-if="vcs.uiType == 'GITLAB_COM'">
+ <template v-else-if="vcsUIType == 'GITLAB_COM'">
{{ $t("gitops.setting.git-provider.gitlab-com-secret-label") }}
</template>
- <template v-else-if="vcs.uiType == 'GITHUB_COM'">
+ <template v-else-if="vcsUIType == 'GITHUB_COM'">
{{ $t("gitops.setting.git-provider.secret-label-github") }}
</template>
</p>
@@ -132,7 +132,7 @@
:ok-text="$t('common.delete')"
:confirm-title="
$t('gitops.setting.git-provider.delete-confirm', {
- name: vcs.name,
+ name: vcs?.title,
})
"
:require-confirm="true"
@@ -174,241 +174,241 @@
</div>
</template>
-<script lang="ts">
-import {
- reactive,
- computed,
- watchEffect,
- onMounted,
- onUnmounted,
- defineComponent,
-} from "vue";
+<script lang="ts" setup>
+import { reactive, computed, watchEffect, onMounted, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import RepositoryTable from "../components/RepositoryTable.vue";
import isEmpty from "lodash-es/isEmpty";
-import { idFromSlug } from "../utils";
+import { idFromSlug, getVCSUIType } from "../utils";
import {
- VCS,
- VCSPatch,
openWindowForOAuth,
OAuthWindowEventPayload,
OAuthToken,
+ VCSUIType,
} from "../types";
import {
pushNotification,
useOAuthStore,
useRepositoryV1Store,
- useVCSStore,
+ useVCSV1Store,
} from "@/store";
+import {
+ ExternalVersionControl,
+ ExternalVersionControl_Type,
+} from "@/types/proto/v1/externalvs_service";
interface LocalState {
- name: string;
+ title: string;
applicationId: string;
secret: string;
oAuthResultCallback?: (token: OAuthToken | undefined) => void;
}
-export default defineComponent({
- name: "SettingWorkspaceVCSDetail",
- components: { RepositoryTable },
- props: {
- vcsSlug: {
- required: true,
- type: String,
- },
+const props = defineProps({
+ vcsSlug: {
+ required: true,
+ type: String,
},
- setup(props) {
- const vcsStore = useVCSStore();
- const repositoryV1Store = useRepositoryV1Store();
- const router = useRouter();
+});
- const vcs = computed((): VCS => {
- return vcsStore.getVCSById(idFromSlug(props.vcsSlug));
- });
+const vcsV1Store = useVCSV1Store();
+const repositoryV1Store = useRepositoryV1Store();
+const router = useRouter();
- const state = reactive<LocalState>({
- name: vcs.value.name,
- applicationId: vcs.value.applicationId,
- secret: "",
- });
+const vcs = computed((): ExternalVersionControl | undefined => {
+ return vcsV1Store.getVCSByUid(idFromSlug(props.vcsSlug));
+});
- onMounted(() => {
- window.addEventListener("bb.oauth.register-vcs", eventListener, false);
- });
+const vcsUIType = computed((): VCSUIType => {
+ if (vcs.value) {
+ return getVCSUIType(vcs.value);
+ }
+ return "GITLAB_SELF_HOST";
+});
- onUnmounted(() => {
- window.removeEventListener("bb.oauth.register-vcs", eventListener);
- });
+const state = reactive<LocalState>({
+ title: vcs.value?.title ?? "",
+ applicationId: vcs.value?.applicationId ?? "",
+ secret: "",
+});
- const eventListener = (event: Event) => {
- const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
- if (isEmpty(payload.error)) {
- if (
- vcs.value.type == "GITLAB" ||
- vcs.value.type == "GITHUB" ||
- vcs.value.type == "BITBUCKET"
- ) {
- useOAuthStore()
- .exchangeVCSTokenWithID({
- code: payload.code,
- vcsId: idFromSlug(props.vcsSlug),
- clientId: state.applicationId,
- clientSecret: state.secret,
- })
- .then((token: OAuthToken) => {
- state.oAuthResultCallback!(token);
- })
- .catch(() => {
- state.oAuthResultCallback!(undefined);
- });
- }
- } else {
- state.oAuthResultCallback!(undefined);
- }
- };
+onMounted(() => {
+ window.addEventListener("bb.oauth.register-vcs", eventListener, false);
+});
- const prepareRepositoryList = () => {
- repositoryV1Store.fetchRepositoryListByVCSId(vcs.value.id);
- };
+onUnmounted(() => {
+ window.removeEventListener("bb.oauth.register-vcs", eventListener);
+});
- watchEffect(prepareRepositoryList);
+const eventListener = (event: Event) => {
+ const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
+ if (isEmpty(payload.error)) {
+ if (
+ vcs.value?.type === ExternalVersionControl_Type.GITLAB ||
+ vcs.value?.type === ExternalVersionControl_Type.GITHUB ||
+ vcs.value?.type === ExternalVersionControl_Type.BITBUCKET
+ ) {
+ useOAuthStore()
+ .exchangeVCSTokenWithID({
+ code: payload.code,
+ vcsId: idFromSlug(props.vcsSlug),
+ clientId: state.applicationId,
+ clientSecret: state.secret,
+ })
+ .then((token: OAuthToken) => {
+ state.oAuthResultCallback!(token);
+ })
+ .catch(() => {
+ state.oAuthResultCallback!(undefined);
+ });
+ }
+ } else {
+ state.oAuthResultCallback!(undefined);
+ }
+};
- const adminApplicationUrl = computed(() => {
- if (vcs.value.uiType == "GITLAB_SELF_HOST") {
- return `${vcs.value.instanceUrl}/admin/applications`;
- } else if (vcs.value.uiType == "GITLAB_COM") {
- return "https://gitlab.com/-/profile/applications";
- }
- return "";
- });
+watchEffect(async () => {
+ if (vcs.value) {
+ await repositoryV1Store.fetchRepositoryListByVCS(vcs.value.name);
+ }
+});
- const repositoryList = computed(() =>
- repositoryV1Store.getRepositoryListByVCSId(vcs.value.id)
- );
+const adminApplicationUrl = computed(() => {
+ if (vcsUIType.value == "GITLAB_SELF_HOST") {
+ return `${vcs.value?.url}/admin/applications`;
+ } else if (vcsUIType.value == "GITLAB_COM") {
+ return "https://gitlab.com/-/profile/applications";
+ }
+ return "";
+});
- const allowUpdate = computed(() => {
- return (
- state.name != vcs.value.name ||
- state.applicationId != vcs.value.applicationId ||
- !isEmpty(state.secret)
- );
- });
+const repositoryList = computed(() =>
+ repositoryV1Store.getRepositoryListByVCS(vcs.value?.name ?? "")
+);
- const doUpdate = () => {
- if (
- state.applicationId != vcs.value.applicationId ||
- !isEmpty(state.secret)
- ) {
- let authorizeUrl = `${vcs.value.instanceUrl}/oauth/authorize`;
- if (vcs.value.type == "GITHUB") {
- authorizeUrl = `https://github.com/login/oauth/authorize`;
- } else if (vcs.value.type == "BITBUCKET") {
- authorizeUrl = `https://bitbucket.org/site/oauth2/authorize`;
+const allowUpdate = computed(() => {
+ return (
+ state.title != vcs.value?.title ||
+ state.applicationId != vcs.value?.applicationId ||
+ !isEmpty(state.secret)
+ );
+});
+
+const doUpdate = () => {
+ if (!vcs.value) {
+ return;
+ }
+
+ if (
+ state.applicationId != vcs.value.applicationId ||
+ !isEmpty(state.secret)
+ ) {
+ let authorizeUrl = `${vcs.value.url}/oauth/authorize`;
+ if (vcs.value.type === ExternalVersionControl_Type.GITHUB) {
+ authorizeUrl = `https://github.com/login/oauth/authorize`;
+ } else if (vcs.value.type === ExternalVersionControl_Type.BITBUCKET) {
+ authorizeUrl = `https://bitbucket.org/site/oauth2/authorize`;
+ }
+ const newWindow = openWindowForOAuth(
+ authorizeUrl,
+ state.applicationId,
+ "bb.oauth.register-vcs",
+ vcs.value.type
+ );
+ if (newWindow) {
+ state.oAuthResultCallback = (token: OAuthToken | undefined) => {
+ if (!vcs.value) {
+ return;
}
- const newWindow = openWindowForOAuth(
- authorizeUrl,
- state.applicationId,
- "bb.oauth.register-vcs",
- vcs.value.type
- );
- if (newWindow) {
- state.oAuthResultCallback = (token: OAuthToken | undefined) => {
- if (token) {
- const vcsPatch: VCSPatch = {};
- if (state.name != vcs.value.name) {
- vcsPatch.name = state.name;
- }
- if (state.applicationId != vcs.value.applicationId) {
- vcsPatch.applicationId = state.applicationId;
- }
- if (!isEmpty(state.secret)) {
- vcsPatch.secret = state.secret;
- }
- vcsStore
- .patchVCS({
- vcsId: vcs.value.id,
- vcsPatch,
- })
- .then((vcs: VCS) => {
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: `Successfully updated '${vcs.name}'`,
- });
- });
- } else {
- // If the application ID mismatches, the OAuth workflow will stop early.
- // So the only possibility to reach here is we have a matching application ID, while
- // we failed to exchange a token, and it's likely we are requesting with a wrong secret.
- let description = "";
- if (vcs.value.type == "GITLAB") {
- description =
- "Please make sure Secret matches the one from your GitLab instance Application.";
- } else if (vcs.value.type == "GITHUB") {
- description =
- "Please make sure Client secret matches the one from your GitHub.com Application.";
- } else if (vcs.value.type == "BITBUCKET") {
- description =
- "Please make sure Secret matches the one from your Bitbucket.org consumer.";
+ if (token) {
+ const vcsPatch: Partial<ExternalVersionControl> = {
+ name: vcs.value.name,
+ };
+ if (state.title != vcs.value.title) {
+ vcsPatch.title = state.title;
+ }
+ if (state.applicationId != vcs.value.applicationId) {
+ vcsPatch.applicationId = state.applicationId;
+ }
+ if (!isEmpty(state.secret)) {
+ vcsPatch.secret = state.secret;
+ }
+ vcsV1Store
+ .updateVCS(vcsPatch)
+ .then((vcs: ExternalVersionControl | undefined) => {
+ if (!vcs) {
+ return;
}
pushNotification({
module: "bytebase",
- style: "CRITICAL",
- title: `Failed to update '${vcs.value.name}'`,
- description: description,
+ style: "SUCCESS",
+ title: `Successfully updated '${vcs.title}'`,
});
- }
- };
- }
- } else if (state.name != vcs.value.name) {
- const vcsPatch: VCSPatch = {
- name: state.name,
- };
- vcsStore
- .patchVCS({
- vcsId: vcs.value.id,
- vcsPatch,
- })
- .then((updatedVCS: VCS) => {
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: `Successfully updated '${updatedVCS.name}'`,
});
+ } else {
+ // If the application ID mismatches, the OAuth workflow will stop early.
+ // So the only possibility to reach here is we have a matching application ID, while
+ // we failed to exchange a token, and it's likely we are requesting with a wrong secret.
+ let description = "";
+ if (vcs.value.type == ExternalVersionControl_Type.GITLAB) {
+ description =
+ "Please make sure Secret matches the one from your GitLab instance Application.";
+ } else if (vcs.value.type == ExternalVersionControl_Type.GITHUB) {
+ description =
+ "Please make sure Client secret matches the one from your GitHub.com Application.";
+ } else if (vcs.value.type == ExternalVersionControl_Type.BITBUCKET) {
+ description =
+ "Please make sure Secret matches the one from your Bitbucket.org consumer.";
+ }
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: `Failed to update '${vcs.value.title}'`,
+ description: description,
});
- }
- };
-
- const cancel = () => {
- router.push({
- name: "setting.workspace.gitops",
- });
+ }
+ };
+ }
+ } else if (state.title != vcs.value.title) {
+ const vcsPatch: Partial<ExternalVersionControl> = {
+ name: vcs.value.name,
+ title: state.title,
};
-
- const deleteVCS = () => {
- const name = vcs.value.name;
- vcsStore.deleteVCSById(vcs.value.id).then(() => {
+ vcsV1Store
+ .updateVCS(vcsPatch)
+ .then((updatedVCS: ExternalVersionControl | undefined) => {
+ if (!updatedVCS) {
+ return;
+ }
pushNotification({
module: "bytebase",
style: "SUCCESS",
- title: `Successfully deleted '${name}'`,
- });
- router.push({
- name: "setting.workspace.gitops",
+ title: `Successfully updated '${updatedVCS.title}'`,
});
});
- };
+ }
+};
- return {
- state,
- vcs,
- repositoryList,
- adminApplicationUrl,
- allowUpdate,
- doUpdate,
- cancel,
- deleteVCS,
- };
- },
-});
+const cancel = () => {
+ router.push({
+ name: "setting.workspace.gitops",
+ });
+};
+
+const deleteVCS = () => {
+ if (!vcs.value) {
+ return;
+ }
+ const title = vcs.value.title;
+ vcsV1Store.deleteVCS(vcs.value.name).then(() => {
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: `Successfully deleted '${title}'`,
+ });
+ router.push({
+ name: "setting.workspace.gitops",
+ });
+ });
+};
</script>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index e3c10383fd..3d6ecfc6e6 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -2925,9 +2925,9 @@ The environment&#39;s `name` field is used to identify the environment to update
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNSPECIFIED | 0 | |
-| TYPE_GITHUB | 1 | GitHub type. Using for GitHub community edition(ce). |
-| TYPE_GITLAB | 2 | GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). |
-| TYPE_BITBUCKET | 3 | BitBucket type. Using for BitBucket cloud or BitBucket server. |
+| GITHUB | 1 | GitHub type. Using for GitHub community edition(ce). |
+| GITLAB | 2 | GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). |
+| BITBUCKET | 3 | BitBucket type. Using for BitBucket cloud or BitBucket server. |
diff --git a/proto/generated-go/v1/externalvs_service.pb.go b/proto/generated-go/v1/externalvs_service.pb.go
index 1a30b9e319..cdd787c320 100644
--- a/proto/generated-go/v1/externalvs_service.pb.go
+++ b/proto/generated-go/v1/externalvs_service.pb.go
@@ -29,26 +29,26 @@ type ExternalVersionControl_Type int32
const (
ExternalVersionControl_TYPE_UNSPECIFIED ExternalVersionControl_Type = 0
// GitHub type. Using for GitHub community edition(ce).
- ExternalVersionControl_TYPE_GITHUB ExternalVersionControl_Type = 1
+ ExternalVersionControl_GITHUB ExternalVersionControl_Type = 1
// GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee).
- ExternalVersionControl_TYPE_GITLAB ExternalVersionControl_Type = 2
+ ExternalVersionControl_GITLAB ExternalVersionControl_Type = 2
// BitBucket type. Using for BitBucket cloud or BitBucket server.
- ExternalVersionControl_TYPE_BITBUCKET ExternalVersionControl_Type = 3
+ ExternalVersionControl_BITBUCKET ExternalVersionControl_Type = 3
)
// Enum value maps for ExternalVersionControl_Type.
var (
ExternalVersionControl_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
- 1: "TYPE_GITHUB",
- 2: "TYPE_GITLAB",
- 3: "TYPE_BITBUCKET",
+ 1: "GITHUB",
+ 2: "GITLAB",
+ 3: "BITBUCKET",
}
ExternalVersionControl_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
- "TYPE_GITHUB": 1,
- "TYPE_GITLAB": 2,
- "TYPE_BITBUCKET": 3,
+ "GITHUB": 1,
+ "GITLAB": 2,
+ "BITBUCKET": 3,
}
)
@@ -1072,7 +1072,7 @@ var file_v1_externalvs_service_proto_rawDesc = []byte{
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74,
- 0x6f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe1, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x74, 0x65,
+ 0x6f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xd2, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x74,
@@ -1089,140 +1089,139 @@ var file_v1_externalvs_service_proto_rawDesc = []byte{
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x61, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x65,
0x63, 0x72, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52,
- 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x52, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x43, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
- 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x49,
- 0x54, 0x48, 0x55, 0x42, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47,
- 0x49, 0x54, 0x4c, 0x41, 0x42, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x42, 0x49, 0x54, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x03, 0x22, 0x8f, 0x05, 0x0a, 0x11,
- 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66,
- 0x6f, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x63,
- 0x73, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x63, 0x73,
- 0x55, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c,
- 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75,
- 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72,
- 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12,
- 0x23, 0x0a, 0x0d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x46, 0x69,
- 0x6c, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61,
- 0x73, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x12, 0x66,
- 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
- 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x10, 0x66, 0x69,
- 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x30,
- 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65,
- 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
- 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74,
- 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73,
- 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
- 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18,
- 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49,
- 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x71, 0x6c, 0x5f,
- 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x69, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52,
- 0x11, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,
- 0x43, 0x69, 0x12, 0x33, 0x0a, 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x6e,
- 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x6e, 0x64,
- 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73,
- 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
- 0x41, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
- 0x42, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
- 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
- 0x70, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x54,
- 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74,
- 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52,
- 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xcb, 0x0a,
- 0x0a, 0x1d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
- 0xa4, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x2d, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45,
- 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
- 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72,
- 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
- 0x6c, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26,
- 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10,
+ 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x4c, 0x41, 0x42, 0x10, 0x02, 0x12, 0x0d, 0x0a,
+ 0x09, 0x42, 0x49, 0x54, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x03, 0x22, 0x8f, 0x05, 0x0a,
+ 0x11, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e,
+ 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x76,
+ 0x63, 0x73, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x63,
+ 0x73, 0x55, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75,
+ 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66,
+ 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75,
+ 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c,
+ 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65,
+ 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x46,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62,
+ 0x61, 0x73, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x12,
+ 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
+ 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x10, 0x66,
+ 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12,
+ 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
+ 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f,
+ 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
+ 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64,
+ 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x71, 0x6c,
+ 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x69, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08,
+ 0x52, 0x11, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x43, 0x69, 0x12, 0x33, 0x0a, 0x13, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65,
+ 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x6e,
+ 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65,
+ 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x12, 0x42, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73,
+ 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f,
+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04,
+ 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xcb,
+ 0x0a, 0x0a, 0x1d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x12, 0xa4, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x2d,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,
+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
- 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45,
- 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
- 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0x2f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x6f, 0x6c, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74,
+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,
+ 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74,
+ 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,
+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0x2f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
- 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x00, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e,
- 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
- 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65,
- 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
- 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x40, 0xda, 0x41, 0x00, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x37, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x1b,
- 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0xfe, 0x01, 0x0a, 0x1c,
- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65,
- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
- 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
+ 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x00, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
+ 0x6c, 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74,
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,
- 0x72, 0x6f, 0x6c, 0x22, 0x86, 0x01, 0xda, 0x41, 0x24, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
- 0x6c, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x59, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65,
- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x32, 0x3d, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x96, 0x01, 0x0a,
- 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,
+ 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,
+ 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x40, 0xda, 0x41, 0x00, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f,
+ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22,
+ 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72,
+ 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0xfe, 0x01, 0x0a,
+ 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a,
- 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72,
+ 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78,
+ 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,
+ 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x86, 0x01, 0xda, 0x41, 0x24, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e,
+ 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72,
+ 0x6f, 0x6c, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x59, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76,
+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x32, 0x3d,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x96, 0x01,
+ 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26,
+ 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
+ 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xdb, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x61, 0x72, 0x63,
+ 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
+ 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12,
+ 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
+ 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,
+ 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78,
+ 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,
+ 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x01, 0x2a, 0x22,
+ 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
- 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xdb, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
- 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,
- 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x38,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61,
- 0x72, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,
- 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x01, 0x2a, 0x22, 0x33,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e,
- 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
- 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65,
- 0x63, 0x74, 0x73, 0x12, 0xa5, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66,
- 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65,
- 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f,
- 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x11, 0x5a, 0x0f, 0x67,
- 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x12, 0xa5, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
+ 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e,
+ 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,
+ 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x11, 0x5a, 0x0f,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62,
+ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/v1/externalvs_service.proto b/proto/v1/externalvs_service.proto
index 95e372a7b7..7a686995ca 100644
--- a/proto/v1/externalvs_service.proto
+++ b/proto/v1/externalvs_service.proto
@@ -144,11 +144,11 @@ message ExternalVersionControl {
enum Type {
TYPE_UNSPECIFIED = 0;
// GitHub type. Using for GitHub community edition(ce).
- TYPE_GITHUB = 1;
+ GITHUB = 1;
// GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee).
- TYPE_GITLAB = 2;
+ GITLAB = 2;
// BitBucket type. Using for BitBucket cloud or BitBucket server.
- TYPE_BITBUCKET = 3;
+ BITBUCKET = 3;
}
Type type = 3 [(google.api.field_behavior) = REQUIRED];