Skip to content

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

chore: migrate subscription and feature to v1 API (#6297)

ecmadaoaf5cc4b736c7
diff --git a/backend/api/auth/config.go b/backend/api/auth/config.go
index 247c7c0687..675850a9af 100644
--- a/backend/api/auth/config.go
+++ b/backend/api/auth/config.go
@@ -3,6 +3,7 @@ package auth
var authenticationAllowlistMethods = map[string]bool{
"/bytebase.v1.ActuatorService/GetActuatorInfo": true,
"/bytebase.v1.SubscriptionService/GetSubscription": true,
+ "/bytebase.v1.SubscriptionService/GetFeatureMatrix": true,
"/bytebase.v1.AuthService/Login": true,
"/bytebase.v1.AuthService/Logout": true,
"/bytebase.v1.AuthService/CreateUser": true,
diff --git a/backend/api/v1/subscription_service.go b/backend/api/v1/subscription_service.go
index f66e893806..86dc73f6f5 100644
--- a/backend/api/v1/subscription_service.go
+++ b/backend/api/v1/subscription_service.go
@@ -49,6 +49,24 @@ func (s *SubscriptionService) GetSubscription(ctx context.Context, _ *v1pb.GetSu
return s.loadSubscription(ctx)
}
+// GetFeatureMatrix gets the feature metric.
+func (*SubscriptionService) GetFeatureMatrix(_ context.Context, _ *v1pb.GetFeatureMatrixRequest) (*v1pb.FeatureMatrix, error) {
+ resp := &v1pb.FeatureMatrix{}
+ for key, val := range api.FeatureMatrix {
+ matrix := map[string]bool{}
+ for i, enabled := range val {
+ plan := covertToV1PlanType(api.PlanType(i))
+ matrix[plan.String()] = enabled
+ }
+ resp.Features = append(resp.Features, &v1pb.Feature{
+ Name: string(key),
+ Matrix: matrix,
+ })
+ }
+
+ return resp, nil
+}
+
// UpdateSubscription updates the subscription license.
func (s *SubscriptionService) UpdateSubscription(ctx context.Context, request *v1pb.UpdateSubscriptionRequest) (*v1pb.Subscription, error) {
// clear the trialing setting for dev test
@@ -154,19 +172,9 @@ func (s *SubscriptionService) TrialSubscription(ctx context.Context, request *v1
func (s *SubscriptionService) loadSubscription(ctx context.Context) (*v1pb.Subscription, error) {
sub := s.licenseService.LoadSubscription(ctx)
- plan := v1pb.PlanType_PLAN_TYPE_UNSPECIFIED
- switch sub.Plan {
- case api.FREE:
- plan = v1pb.PlanType_FREE
- case api.TEAM:
- plan = v1pb.PlanType_TEAM
- case api.ENTERPRISE:
- plan = v1pb.PlanType_ENTERPRISE
- }
-
subscription := &v1pb.Subscription{
InstanceCount: int32(sub.InstanceCount),
- Plan: plan,
+ Plan: covertToV1PlanType(sub.Plan),
Trialing: sub.Trialing,
OrgId: sub.OrgID,
OrgName: sub.OrgName,
@@ -178,3 +186,16 @@ func (s *SubscriptionService) loadSubscription(ctx context.Context) (*v1pb.Subsc
return subscription, nil
}
+
+func covertToV1PlanType(planType api.PlanType) v1pb.PlanType {
+ switch planType {
+ case api.FREE:
+ return v1pb.PlanType_FREE
+ case api.TEAM:
+ return v1pb.PlanType_TEAM
+ case api.ENTERPRISE:
+ return v1pb.PlanType_ENTERPRISE
+ default:
+ return v1pb.PlanType_PLAN_TYPE_UNSPECIFIED
+ }
+}
diff --git a/backend/server/plan.go b/backend/server/plan.go
deleted file mode 100644
index ce2ffed1eb..0000000000
--- a/backend/server/plan.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package server
-
-import (
- "net/http"
-
- "github.com/labstack/echo/v4"
-
- api "github.com/bytebase/bytebase/backend/legacyapi"
-)
-
-func (*Server) registerPlanRoutes(g *echo.Group) {
- g.GET("/feature", func(c echo.Context) error {
- return c.JSON(http.StatusOK, api.FeatureMatrix)
- })
-}
diff --git a/backend/server/server.go b/backend/server/server.go
index f2368ca204..752c8375d7 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -522,7 +522,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
s.registerBookmarkRoutes(apiGroup)
s.registerSQLRoutes(apiGroup)
s.registerVCSRoutes(apiGroup)
- s.registerPlanRoutes(apiGroup)
s.registerSheetRoutes(apiGroup)
s.registerAnomalyRoutes(apiGroup)
diff --git a/frontend/src/components/BannersWrapper.vue b/frontend/src/components/BannersWrapper.vue
index fe5de102f2..ee96ceea22 100644
--- a/frontend/src/components/BannersWrapper.vue
+++ b/frontend/src/components/BannersWrapper.vue
@@ -28,7 +28,7 @@ import {
useActuatorStore,
useCurrentUserV1,
useDebugStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store/modules";
import { hasWorkspacePermissionV1, isDev } from "@/utils";
import BannerDemo from "@/views/BannerDemo.vue";
@@ -40,7 +40,7 @@ import BannerUpgradeSubscription from "@/views/BannerUpgradeSubscription.vue";
const actuatorStore = useActuatorStore();
const currentUserV1 = useCurrentUserV1();
const debugStore = useDebugStore();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const { isDemo, isReadonly, needConfigureExternalUrl } =
storeToRefs(actuatorStore);
diff --git a/frontend/src/components/FeatureAttention.vue b/frontend/src/components/FeatureAttention.vue
index 170a5954ba..c8fd0b86f7 100644
--- a/frontend/src/components/FeatureAttention.vue
+++ b/frontend/src/components/FeatureAttention.vue
@@ -14,7 +14,7 @@ import { PropType, computed } from "vue";
import { FeatureType, planTypeToString } from "@/types";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
-import { useSubscriptionStore, pushNotification } from "@/store";
+import { useSubscriptionV1Store, pushNotification } from "@/store";
import { PlanType } from "@/types/proto/v1/subscription_service";
const props = defineProps({
@@ -36,7 +36,7 @@ const props = defineProps({
const router = useRouter();
const { t } = useI18n();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const actionText = computed(() => {
if (!subscriptionStore.canTrial) {
diff --git a/frontend/src/components/FeatureModal.vue b/frontend/src/components/FeatureModal.vue
index b6a6f24471..b870796d90 100644
--- a/frontend/src/components/FeatureModal.vue
+++ b/frontend/src/components/FeatureModal.vue
@@ -103,7 +103,7 @@
import { PropType } from "vue";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
-import { useSubscriptionStore, pushNotification } from "@/store";
+import { useSubscriptionV1Store, pushNotification } from "@/store";
import { FeatureType, planTypeToString } from "@/types";
import { PlanType } from "@/types/proto/v1/subscription_service";
@@ -122,7 +122,7 @@ const ok = () => {
router.push({ name: "setting.workspace.subscription" });
};
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const isRequiredInPlan = Array.isArray(
subscriptionStore.featureMatrix.get(props.feature)
diff --git a/frontend/src/components/PricingTable/PricingTable.vue b/frontend/src/components/PricingTable/PricingTable.vue
index fef198f0de..545a6be70a 100644
--- a/frontend/src/components/PricingTable/PricingTable.vue
+++ b/frontend/src/components/PricingTable/PricingTable.vue
@@ -286,7 +286,7 @@
import { reactive, computed, watch } from "vue";
import { useI18n } from "vue-i18n";
import { Plan, PLANS, FEATURE_SECTIONS } from "@/types";
-import { useSubscriptionStore } from "@/store";
+import { useSubscriptionV1Store } from "@/store";
import { LocalPlan } from "./types";
import FeatureItem from "./FeatureItem.vue";
import { PlanType } from "@/types/proto/v1/subscription_service";
@@ -301,7 +301,7 @@ const emit = defineEmits(["on-trial"]);
const minimumInstanceCount = 5;
const { t } = useI18n();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const state = reactive<LocalState>({
isMonthly: false,
instanceCount:
diff --git a/frontend/src/components/QuickActionPanel.vue b/frontend/src/components/QuickActionPanel.vue
index 7508b1d537..748376b7af 100644
--- a/frontend/src/components/QuickActionPanel.vue
+++ b/frontend/src/components/QuickActionPanel.vue
@@ -316,7 +316,7 @@ import {
useInstanceV1Store,
useProjectV1ListByCurrentUser,
useRouterStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
import ProjectCreate from "../components/ProjectCreate.vue";
import InstanceForm from "../components/InstanceForm/";
@@ -347,7 +347,7 @@ const router = useRouter();
const route = useRoute();
const routerStore = useRouterStore();
const commandStore = useCommandStore();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const hasCustomRoleFeature = computed(() => {
return subscriptionStore.hasFeature("bb.feature.custom-role");
diff --git a/frontend/src/components/Quickstart.vue b/frontend/src/components/Quickstart.vue
index f6fd77662a..def51ba7a6 100644
--- a/frontend/src/components/Quickstart.vue
+++ b/frontend/src/components/Quickstart.vue
@@ -123,7 +123,7 @@ import {
pushNotification,
useActuatorStore,
useCurrentUserV1,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useUIStateStore,
} from "@/store";
import { PlanType } from "@/types/proto/v1/subscription_service";
@@ -137,7 +137,7 @@ type IntroItem = {
const actuatorStore = useActuatorStore();
const uiStateStore = useUIStateStore();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const { t } = useI18n();
const kbarHandler = useKBarHandler();
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index 6ee68e272f..7ee786a020 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -323,7 +323,7 @@ import {
VCSType,
} from "@/types";
import BBBetaBadge from "@/bbkit/BBBetaBadge.vue";
-import { hasFeature, useSubscriptionStore } from "@/store";
+import { hasFeature, useSubscriptionV1Store } from "@/store";
import LearnMoreLink from "./LearnMoreLink.vue";
const FILE_REQUIRED_PLACEHOLDER = "{{DB_NAME}}, {{VERSION}}, {{TYPE}}";
@@ -382,7 +382,7 @@ export default defineComponent({
showFeatureModal: false,
});
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
const isTenantProject = computed(() => {
return props.project.tenantMode === "TENANT";
diff --git a/frontend/src/components/SQLReview/SQLReviewCreation.vue b/frontend/src/components/SQLReview/SQLReviewCreation.vue
index 40f0b094b2..44120d674f 100644
--- a/frontend/src/components/SQLReview/SQLReviewCreation.vue
+++ b/frontend/src/components/SQLReview/SQLReviewCreation.vue
@@ -67,7 +67,7 @@ import {
useCurrentUserV1,
pushNotification,
useSQLReviewStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useEnvironmentV1List,
} from "@/store";
import { hasWorkspacePermissionV1 } from "@/utils";
@@ -105,7 +105,7 @@ const { t } = useI18n();
const router = useRouter();
const store = useSQLReviewStore();
const currentUserV1 = useCurrentUserV1();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const BASIC_INFO_STEP = 0;
const CONFIGURE_RULE_STEP = 1;
diff --git a/frontend/src/components/TrialModal.vue b/frontend/src/components/TrialModal.vue
index 90357c3c11..b3688cfc0e 100644
--- a/frontend/src/components/TrialModal.vue
+++ b/frontend/src/components/TrialModal.vue
@@ -55,14 +55,14 @@
<script lang="ts" setup>
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
-import { useSubscriptionStore, pushNotification } from "@/store";
+import { useSubscriptionV1Store, pushNotification } from "@/store";
import { planTypeToString } from "@/types";
import { PlanType } from "@/types/proto/v1/subscription_service";
const emit = defineEmits(["cancel"]);
const { t } = useI18n();
const router = useRouter();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const learnMore = () => {
router.push({ name: "setting.workspace.subscription" });
diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.ts
index 22912303eb..bf03dbbb24 100644
--- a/frontend/src/grpcweb/index.ts
+++ b/frontend/src/grpcweb/index.ts
@@ -18,6 +18,7 @@ import { DatabaseServiceDefinition } from "@/types/proto/v1/database_service";
import { SheetServiceDefinition } from "@/types/proto/v1/sheet_service";
import { InstanceRoleServiceDefinition } from "@/types/proto/v1/instance_role_service";
import { CelServiceDefinition } from "@/types/proto/v1/cel_service";
+import { SubscriptionServiceDefinition } from "@/types/proto/v1/subscription_service";
// Create each grpc service client.
// Reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md
@@ -109,6 +110,11 @@ export const celServiceClient = clientFactory.create(
channel
);
+export const subscriptionServiceClient = clientFactory.create(
+ SubscriptionServiceDefinition,
+ channel
+);
+
// e.g. How to use `authServiceClient`?
//
// await authServiceClient.login({
diff --git a/frontend/src/layouts/BodyLayout.vue b/frontend/src/layouts/BodyLayout.vue
index b2ffc91d72..4a0373de07 100644
--- a/frontend/src/layouts/BodyLayout.vue
+++ b/frontend/src/layouts/BodyLayout.vue
@@ -254,7 +254,7 @@ import { PlanType } from "@/types/proto/v1/subscription_service";
import {
useActuatorStore,
useCurrentUserV1,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
interface LocalState {
@@ -273,7 +273,7 @@ export default defineComponent({
},
setup() {
const actuatorStore = useActuatorStore();
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
const route = useRoute();
const router = useRouter();
diff --git a/frontend/src/layouts/SheetDashboardLayout.vue b/frontend/src/layouts/SheetDashboardLayout.vue
index 7d868d2edd..965c88f691 100644
--- a/frontend/src/layouts/SheetDashboardLayout.vue
+++ b/frontend/src/layouts/SheetDashboardLayout.vue
@@ -38,7 +38,7 @@ import { storeToRefs } from "pinia";
import {
pushNotification,
useActuatorStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
import { ServerInfo } from "@/types";
import BannerDemo from "@/views/BannerDemo.vue";
@@ -46,7 +46,7 @@ import BannerSubscription from "@/views/BannerSubscription.vue";
import EditorHeader from "@/views/sql-editor/EditorHeader.vue";
const actuatorStore = useActuatorStore();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const ping = () => {
actuatorStore.fetchServerInfo().then((info: ServerInfo) => {
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index b93bfda5c4..f3c758b90d 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -18,7 +18,7 @@ import {
pushNotification,
useActuatorStore,
useAuthStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "./store";
import {
databaseSlug,
@@ -171,11 +171,11 @@ const initActuator = () => {
return actuatorStore.fetchServerInfo();
};
const initSubscription = () => {
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
return subscriptionStore.fetchSubscription();
};
const initFeatureMatrix = () => {
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
return subscriptionStore.fetchFeatureMatrix();
};
const restoreUser = () => {
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index a143facd5b..b9ff4070d8 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -53,7 +53,7 @@ import {
useOnboardingStateStore,
useTabStore,
useIdentityProviderStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useUserStore,
useProjectV1Store,
useProjectWebhookV1Store,
@@ -740,7 +740,7 @@ const routes: Array<RouteRecordRaw> = [
);
if (
- useSubscriptionStore().currentPlan ===
+ useSubscriptionV1Store().currentPlan ===
PlanType.ENTERPRISE
) {
// in ENTERPRISE edition
diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.ts
index 5fccb7936f..10234b8201 100644
--- a/frontend/src/store/modules/index.ts
+++ b/frontend/src/store/modules/index.ts
@@ -29,7 +29,6 @@ export * from "./sql";
export * from "./sqlEditor";
export * from "./webTerminal";
export * from "./connectionTree";
-export * from "./subscription";
export * from "./tab";
export * from "./task";
export * from "./uistate";
diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.ts
index 65de2bf0ea..73ec97e2a3 100644
--- a/frontend/src/store/modules/v1/index.ts
+++ b/frontend/src/store/modules/v1/index.ts
@@ -10,3 +10,4 @@ export * from "./policy";
export * from "./dataSource";
export * from "./setting";
export * from "./instance";
+export * from "./subscription";
diff --git a/frontend/src/store/modules/subscription.ts b/frontend/src/store/modules/v1/subscription.ts
similarity index 78%
rename from frontend/src/store/modules/subscription.ts
rename to frontend/src/store/modules/v1/subscription.ts
index b6faa31448..c2f659a669 100644
--- a/frontend/src/store/modules/subscription.ts
+++ b/frontend/src/store/modules/v1/subscription.ts
@@ -1,20 +1,27 @@
import { defineStore } from "pinia";
-import axios from "axios";
import dayjs from "dayjs";
import { computed, Ref } from "vue";
import { useI18n } from "vue-i18n";
-import { FeatureType, SubscriptionState, planTypeToString } from "@/types";
+import { subscriptionServiceClient } from "@/grpcweb";
+import { FeatureType, planTypeToString } from "@/types";
import {
PlanType,
Subscription,
planTypeFromJSON,
+ planTypeToJSON,
} from "@/types/proto/v1/subscription_service";
-export const useSubscriptionStore = defineStore("subscription", {
+interface SubscriptionState {
+ subscription: Subscription | undefined;
+ trialingDays: number;
+ featureMatrix: Map<FeatureType, boolean[]>;
+}
+
+export const useSubscriptionV1Store = defineStore("subscription_v1", {
state: (): SubscriptionState => ({
- featureMatrix: new Map<FeatureType, boolean[]>(),
subscription: undefined,
trialingDays: 14,
+ featureMatrix: new Map<FeatureType, boolean[]>(),
}),
getters: {
instanceCount(state): number {
@@ -96,6 +103,9 @@ export const useSubscriptionStore = defineStore("subscription", {
},
},
actions: {
+ setSubscription(subscription: Subscription) {
+ this.subscription = subscription;
+ },
hasFeature(type: FeatureType) {
const matrix = this.featureMatrix.get(type);
if (!Array.isArray(matrix)) {
@@ -141,13 +151,10 @@ export const useSubscriptionStore = defineStore("subscription", {
requiredPlan,
});
},
- setSubscription(subscription: Subscription) {
- this.subscription = subscription;
- },
async fetchSubscription() {
try {
- const { data: subscription } = await axios.get<Subscription>(
- `/v1/subscription`
+ const subscription = await subscriptionServiceClient.getSubscription(
+ {}
);
this.setSubscription(subscription);
return subscription;
@@ -155,54 +162,62 @@ export const useSubscriptionStore = defineStore("subscription", {
console.error(e);
}
},
- async fetchFeatureMatrix() {
- try {
- const { data } = await axios.get<{
- [key: string]: boolean[];
- }>(`/api/feature`);
- for (const [key, value] of Object.entries(data)) {
- this.featureMatrix.set(key as FeatureType, value);
- }
- } catch (e) {
- console.error(e);
- }
- },
async patchSubscription(license: string) {
- const { data: subscription } = await axios.patch<Subscription>(
- `/v1/subscription`,
- {
+ const subscription = await subscriptionServiceClient.updateSubscription({
+ patch: {
license,
- }
- );
+ },
+ });
this.setSubscription(subscription);
return subscription;
},
async trialSubscription(planType: PlanType) {
- const { data: subscription } = await axios.post<Subscription>(
- `/v1/subscription/trial`,
- {
+ const subscription = await subscriptionServiceClient.trialSubscription({
+ trial: {
plan: planType,
days: this.trialingDays,
instanceCount: -1,
- }
- );
+ },
+ });
this.setSubscription(subscription);
return subscription;
},
+ async fetchFeatureMatrix() {
+ try {
+ const featureMatrix = await subscriptionServiceClient.getFeatureMatrix(
+ {}
+ );
+
+ const stateMatrix = new Map<FeatureType, boolean[]>();
+ for (const feature of featureMatrix.features) {
+ const featureType = feature.name as FeatureType;
+ stateMatrix.set(
+ featureType,
+ [PlanType.FREE, PlanType.TEAM, PlanType.ENTERPRISE].map((type) => {
+ return feature.matrix[planTypeToJSON(type)] ?? false;
+ })
+ );
+ }
+
+ this.featureMatrix = stateMatrix;
+ } catch (e) {
+ console.error(e);
+ }
+ },
},
});
export const hasFeature = (type: FeatureType) => {
- const store = useSubscriptionStore();
+ const store = useSubscriptionV1Store();
return store.hasFeature(type);
};
export const featureToRef = (type: FeatureType): Ref<boolean> => {
- const store = useSubscriptionStore();
+ const store = useSubscriptionV1Store();
return computed(() => store.hasFeature(type));
};
export const useCurrentPlan = () => {
- const store = useSubscriptionStore();
+ const store = useSubscriptionV1Store();
return computed(() => store.currentPlan);
};
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index 205c05f2f8..a8c2767b03 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -37,7 +37,6 @@ export * from "./sqlEditor";
export * from "./connectionTree";
export * from "./webTerminal";
export * from "./tab";
-export * from "./subscription";
export * from "./sheet";
export * from "./sqlReview";
export * from "./utils";
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 173a0ca719..091c10bc84 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -53,6 +53,9 @@ export function planTypeToJSON(object: PlanType): string {
export interface GetSubscriptionRequest {
}
+export interface GetFeatureMatrixRequest {
+}
+
export interface UpdateSubscriptionRequest {
patch?: PatchSubscription;
}
@@ -81,6 +84,22 @@ export interface Subscription {
orgName: string;
}
+export interface FeatureMatrix {
+ features: Feature[];
+}
+
+export interface Feature {
+ /** Name is the feature name. */
+ name: string;
+ /** Matrix is the feature matrix for different plan. The key is the plan enum in string value. */
+ matrix: { [key: string]: boolean };
+}
+
+export interface Feature_MatrixEntry {
+ key: string;
+ value: boolean;
+}
+
function createBaseGetSubscriptionRequest(): GetSubscriptionRequest {
return {};
}
@@ -125,6 +144,50 @@ export const GetSubscriptionRequest = {
},
};
+function createBaseGetFeatureMatrixRequest(): GetFeatureMatrixRequest {
+ return {};
+}
+
+export const GetFeatureMatrixRequest = {
+ encode(_: GetFeatureMatrixRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetFeatureMatrixRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseGetFeatureMatrixRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(_: any): GetFeatureMatrixRequest {
+ return {};
+ },
+
+ toJSON(_: GetFeatureMatrixRequest): unknown {
+ const obj: any = {};
+ return obj;
+ },
+
+ create(base?: DeepPartial<GetFeatureMatrixRequest>): GetFeatureMatrixRequest {
+ return GetFeatureMatrixRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(_: DeepPartial<GetFeatureMatrixRequest>): GetFeatureMatrixRequest {
+ const message = createBaseGetFeatureMatrixRequest();
+ return message;
+ },
+};
+
function createBaseUpdateSubscriptionRequest(): UpdateSubscriptionRequest {
return { patch: undefined };
}
@@ -525,6 +588,226 @@ export const Subscription = {
},
};
+function createBaseFeatureMatrix(): FeatureMatrix {
+ return { features: [] };
+}
+
+export const FeatureMatrix = {
+ encode(message: FeatureMatrix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.features) {
+ Feature.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): FeatureMatrix {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFeatureMatrix();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.features.push(Feature.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): FeatureMatrix {
+ return { features: Array.isArray(object?.features) ? object.features.map((e: any) => Feature.fromJSON(e)) : [] };
+ },
+
+ toJSON(message: FeatureMatrix): unknown {
+ const obj: any = {};
+ if (message.features) {
+ obj.features = message.features.map((e) => e ? Feature.toJSON(e) : undefined);
+ } else {
+ obj.features = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<FeatureMatrix>): FeatureMatrix {
+ return FeatureMatrix.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<FeatureMatrix>): FeatureMatrix {
+ const message = createBaseFeatureMatrix();
+ message.features = object.features?.map((e) => Feature.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseFeature(): Feature {
+ return { name: "", matrix: {} };
+}
+
+export const Feature = {
+ encode(message: Feature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ Object.entries(message.matrix).forEach(([key, value]) => {
+ Feature_MatrixEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim();
+ });
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Feature {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFeature();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ const entry2 = Feature_MatrixEntry.decode(reader, reader.uint32());
+ if (entry2.value !== undefined) {
+ message.matrix[entry2.key] = entry2.value;
+ }
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Feature {
+ return {
+ name: isSet(object.name) ? String(object.name) : "",
+ matrix: isObject(object.matrix)
+ ? Object.entries(object.matrix).reduce<{ [key: string]: boolean }>((acc, [key, value]) => {
+ acc[key] = Boolean(value);
+ return acc;
+ }, {})
+ : {},
+ };
+ },
+
+ toJSON(message: Feature): unknown {
+ const obj: any = {};
+ message.name !== undefined && (obj.name = message.name);
+ obj.matrix = {};
+ if (message.matrix) {
+ Object.entries(message.matrix).forEach(([k, v]) => {
+ obj.matrix[k] = v;
+ });
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<Feature>): Feature {
+ return Feature.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Feature>): Feature {
+ const message = createBaseFeature();
+ message.name = object.name ?? "";
+ message.matrix = Object.entries(object.matrix ?? {}).reduce<{ [key: string]: boolean }>((acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[key] = Boolean(value);
+ }
+ return acc;
+ }, {});
+ return message;
+ },
+};
+
+function createBaseFeature_MatrixEntry(): Feature_MatrixEntry {
+ return { key: "", value: false };
+}
+
+export const Feature_MatrixEntry = {
+ encode(message: Feature_MatrixEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.key !== "") {
+ writer.uint32(10).string(message.key);
+ }
+ if (message.value === true) {
+ writer.uint32(16).bool(message.value);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Feature_MatrixEntry {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFeature_MatrixEntry();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.key = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.value = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Feature_MatrixEntry {
+ return {
+ key: isSet(object.key) ? String(object.key) : "",
+ value: isSet(object.value) ? Boolean(object.value) : false,
+ };
+ },
+
+ toJSON(message: Feature_MatrixEntry): unknown {
+ const obj: any = {};
+ message.key !== undefined && (obj.key = message.key);
+ message.value !== undefined && (obj.value = message.value);
+ return obj;
+ },
+
+ create(base?: DeepPartial<Feature_MatrixEntry>): Feature_MatrixEntry {
+ return Feature_MatrixEntry.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Feature_MatrixEntry>): Feature_MatrixEntry {
+ const message = createBaseFeature_MatrixEntry();
+ message.key = object.key ?? "";
+ message.value = object.value ?? false;
+ return message;
+ },
+};
+
export type SubscriptionServiceDefinition = typeof SubscriptionServiceDefinition;
export const SubscriptionServiceDefinition = {
name: "SubscriptionService",
@@ -545,6 +828,19 @@ export const SubscriptionServiceDefinition = {
},
},
},
+ getFeatureMatrix: {
+ name: "GetFeatureMatrix",
+ requestType: GetFeatureMatrixRequest,
+ requestStream: false,
+ responseType: FeatureMatrix,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([0])],
+ 578365826: [new Uint8Array([13, 18, 11, 47, 118, 49, 47, 102, 101, 97, 116, 117, 114, 101])],
+ },
+ },
+ },
updateSubscription: {
name: "UpdateSubscription",
requestType: UpdateSubscriptionRequest,
@@ -643,6 +939,10 @@ export interface SubscriptionServiceImplementation<CallContextExt = {}> {
request: GetSubscriptionRequest,
context: CallContext & CallContextExt,
): Promise<DeepPartial<Subscription>>;
+ getFeatureMatrix(
+ request: GetFeatureMatrixRequest,
+ context: CallContext & CallContextExt,
+ ): Promise<DeepPartial<FeatureMatrix>>;
updateSubscription(
request: UpdateSubscriptionRequest,
context: CallContext & CallContextExt,
@@ -658,6 +958,10 @@ export interface SubscriptionServiceClient<CallOptionsExt = {}> {
request: DeepPartial<GetSubscriptionRequest>,
options?: CallOptions & CallOptionsExt,
): Promise<Subscription>;
+ getFeatureMatrix(
+ request: DeepPartial<GetFeatureMatrixRequest>,
+ options?: CallOptions & CallOptionsExt,
+ ): Promise<FeatureMatrix>;
updateSubscription(
request: DeepPartial<UpdateSubscriptionRequest>,
options?: CallOptions & CallOptionsExt,
@@ -697,6 +1001,10 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/subscription.ts b/frontend/src/types/subscription.ts
deleted file mode 100644
index 3713a6e3bd..0000000000
--- a/frontend/src/types/subscription.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { FeatureType } from "./plan";
-import { Subscription } from "@/types/proto/v1/subscription_service";
-
-export interface SubscriptionState {
- featureMatrix: Map<FeatureType, boolean[]>;
- subscription: Subscription | undefined;
- trialingDays: number;
-}
diff --git a/frontend/src/views/BannerSubscription.vue b/frontend/src/views/BannerSubscription.vue
index a970695b25..d0943f6708 100644
--- a/frontend/src/views/BannerSubscription.vue
+++ b/frontend/src/views/BannerSubscription.vue
@@ -44,13 +44,13 @@
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { PlanType } from "@/types/proto/v1/subscription_service";
-import { useSubscriptionStore } from "@/store";
+import { useSubscriptionV1Store } from "@/store";
import { storeToRefs } from "pinia";
export default {
name: "BannerSubscription",
setup() {
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
const { t } = useI18n();
const emailBody = [
diff --git a/frontend/src/views/BannerUpgradeSubscription.vue b/frontend/src/views/BannerUpgradeSubscription.vue
index 4bf7e5c37a..6ca1568bc8 100644
--- a/frontend/src/views/BannerUpgradeSubscription.vue
+++ b/frontend/src/views/BannerUpgradeSubscription.vue
@@ -64,7 +64,7 @@ import { reactive } from "vue";
import {
useIdentityProviderStore,
useInstanceStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
import { onMounted } from "vue";
import { computed } from "vue";
@@ -82,7 +82,7 @@ interface LocalState {
const { t } = useI18n();
const router = useRouter();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const state = reactive<LocalState>({
showModal: false,
});
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 0875aac0a8..74a0874ba3 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -214,7 +214,7 @@ import { useLanguage } from "../composables/useLanguage";
import {
useCurrentUser,
useDebugStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useInboxStore,
useCurrentUserV1,
} from "@/store";
@@ -237,7 +237,7 @@ export default defineComponent({
const { t, availableLocales } = useI18n();
const debugStore = useDebugStore();
const inboxStore = useInboxStore();
- const subscriptionStore = useSubscriptionStore();
+ const subscriptionStore = useSubscriptionV1Store();
const router = useRouter();
const route = useRoute();
const { setLocale, toggleLocales, locale } = useLanguage();
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index 29ead963ac..161ad5cc1c 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -199,7 +199,7 @@ import { UNKNOWN_ID, Issue, planTypeToString } from "../types";
import { EnvironmentTabFilter, SearchBox } from "@/components/v2";
import {
useEnvironmentV1Store,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useOnboardingStateStore,
featureToRef,
useCurrentUserV1,
@@ -219,7 +219,7 @@ const OPEN_ISSUE_LIST_PAGE_SIZE = 10;
const MAX_CLOSED_ISSUE = 5;
const environmentV1Store = useEnvironmentV1Store();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const onboardingStateStore = useOnboardingStateStore();
const router = useRouter();
const route = useRoute();
diff --git a/frontend/src/views/InstanceDashboard.vue b/frontend/src/views/InstanceDashboard.vue
index 20891b8001..6503219e17 100644
--- a/frontend/src/views/InstanceDashboard.vue
+++ b/frontend/src/views/InstanceDashboard.vue
@@ -36,7 +36,7 @@ import { UNKNOWN_ID } from "../types";
import { sortInstanceV1ListByEnvironmentV1 } from "../utils";
import {
useUIStateStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useEnvironmentV1Store,
useEnvironmentV1List,
useInstanceV1List,
@@ -46,7 +46,7 @@ interface LocalState {
searchText: string;
}
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const uiStateStore = useUIStateStore();
const router = useRouter();
const { t } = useI18n();
diff --git a/frontend/src/views/InstanceDetail.vue b/frontend/src/views/InstanceDetail.vue
index ae1d8f5405..fddd9b819d 100644
--- a/frontend/src/views/InstanceDetail.vue
+++ b/frontend/src/views/InstanceDetail.vue
@@ -132,7 +132,7 @@ import {
pushNotification,
useDatabaseStore,
useInstanceStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
useSQLStore,
useDBSchemaStore,
useCurrentUserV1,
@@ -161,7 +161,7 @@ const props = defineProps({
const instanceStore = useInstanceStore();
const instanceV1Store = useInstanceV1Store();
const databaseStore = useDatabaseV1Store();
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const { t } = useI18n();
const currentUserV1 = useCurrentUserV1();
diff --git a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
index cff9154499..e2653ba280 100644
--- a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
+++ b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
@@ -168,7 +168,7 @@ import {
pushNotification,
useCurrentUserV1,
useSQLReviewStore,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
import {
payloadValueListToComponentList,
@@ -203,7 +203,7 @@ const store = useSQLReviewStore();
const router = useRouter();
const currentUserV1 = useCurrentUserV1();
const ROUTE_NAME = "setting.workspace.sql-review";
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const state = reactive<LocalState>({
showDisableModal: false,
diff --git a/frontend/src/views/SettingWorkspaceSubscription.vue b/frontend/src/views/SettingWorkspaceSubscription.vue
index bbfdf42511..4c2e5a8b26 100644
--- a/frontend/src/views/SettingWorkspaceSubscription.vue
+++ b/frontend/src/views/SettingWorkspaceSubscription.vue
@@ -133,7 +133,7 @@ import { PlanType } from "@/types/proto/v1/subscription_service";
import {
pushNotification,
useCurrentUserV1,
- useSubscriptionStore,
+ useSubscriptionV1Store,
} from "@/store";
import { storeToRefs } from "pinia";
import { hasWorkspacePermissionV1 } from "@/utils";
@@ -144,7 +144,7 @@ interface LocalState {
showTrialModal: boolean;
}
-const subscriptionStore = useSubscriptionStore();
+const subscriptionStore = useSubscriptionV1Store();
const { t } = useI18n();
const currentUserV1 = useCurrentUserV1();
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 2aa20a2c2d..1831954bb8 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -403,6 +403,10 @@
- [RolloutService](#bytebase-v1-RolloutService)
- [v1/subscription_service.proto](#v1_subscription_service-proto)
+ - [Feature](#bytebase-v1-Feature)
+ - [Feature.MatrixEntry](#bytebase-v1-Feature-MatrixEntry)
+ - [FeatureMatrix](#bytebase-v1-FeatureMatrix)
+ - [GetFeatureMatrixRequest](#bytebase-v1-GetFeatureMatrixRequest)
- [GetSubscriptionRequest](#bytebase-v1-GetSubscriptionRequest)
- [PatchSubscription](#bytebase-v1-PatchSubscription)
- [Subscription](#bytebase-v1-Subscription)
@@ -6393,6 +6397,63 @@ Type is the database change type.
+<a name="bytebase-v1-Feature"></a>
+
+### Feature
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | Name is the feature name. |
+| matrix | [Feature.MatrixEntry](#bytebase-v1-Feature-MatrixEntry) | repeated | Matrix is the feature matrix for different plan. The key is the plan enum in string value. |
+
+
+
+
+
+
+<a name="bytebase-v1-Feature-MatrixEntry"></a>
+
+### Feature.MatrixEntry
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| key | [string](#string) | | |
+| value | [bool](#bool) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-FeatureMatrix"></a>
+
+### FeatureMatrix
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| features | [Feature](#bytebase-v1-Feature) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-v1-GetFeatureMatrixRequest"></a>
+
+### GetFeatureMatrixRequest
+
+
+
+
+
+
+
<a name="bytebase-v1-GetSubscriptionRequest"></a>
### GetSubscriptionRequest
@@ -6514,6 +6575,7 @@ Type is the database change type.
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetSubscription | [GetSubscriptionRequest](#bytebase-v1-GetSubscriptionRequest) | [Subscription](#bytebase-v1-Subscription) | |
+| GetFeatureMatrix | [GetFeatureMatrixRequest](#bytebase-v1-GetFeatureMatrixRequest) | [FeatureMatrix](#bytebase-v1-FeatureMatrix) | |
| UpdateSubscription | [UpdateSubscriptionRequest](#bytebase-v1-UpdateSubscriptionRequest) | [Subscription](#bytebase-v1-Subscription) | |
| TrialSubscription | [TrialSubscriptionRequest](#bytebase-v1-TrialSubscriptionRequest) | [Subscription](#bytebase-v1-Subscription) | |
diff --git a/proto/generated-go/v1/subscription_service.pb.go b/proto/generated-go/v1/subscription_service.pb.go
index 6f42177842..23ee77477b 100644
--- a/proto/generated-go/v1/subscription_service.pb.go
+++ b/proto/generated-go/v1/subscription_service.pb.go
@@ -112,6 +112,44 @@ func (*GetSubscriptionRequest) Descriptor() ([]byte, []int) {
return file_v1_subscription_service_proto_rawDescGZIP(), []int{0}
}
+type GetFeatureMatrixRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *GetFeatureMatrixRequest) Reset() {
+ *x = GetFeatureMatrixRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_subscription_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetFeatureMatrixRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetFeatureMatrixRequest) ProtoMessage() {}
+
+func (x *GetFeatureMatrixRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_subscription_service_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GetFeatureMatrixRequest.ProtoReflect.Descriptor instead.
+func (*GetFeatureMatrixRequest) Descriptor() ([]byte, []int) {
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{1}
+}
+
type UpdateSubscriptionRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -123,7 +161,7 @@ type UpdateSubscriptionRequest struct {
func (x *UpdateSubscriptionRequest) Reset() {
*x = UpdateSubscriptionRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_subscription_service_proto_msgTypes[1]
+ mi := &file_v1_subscription_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -136,7 +174,7 @@ func (x *UpdateSubscriptionRequest) String() string {
func (*UpdateSubscriptionRequest) ProtoMessage() {}
func (x *UpdateSubscriptionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_subscription_service_proto_msgTypes[1]
+ mi := &file_v1_subscription_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -149,7 +187,7 @@ func (x *UpdateSubscriptionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateSubscriptionRequest.ProtoReflect.Descriptor instead.
func (*UpdateSubscriptionRequest) Descriptor() ([]byte, []int) {
- return file_v1_subscription_service_proto_rawDescGZIP(), []int{1}
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{2}
}
func (x *UpdateSubscriptionRequest) GetPatch() *PatchSubscription {
@@ -170,7 +208,7 @@ type TrialSubscriptionRequest struct {
func (x *TrialSubscriptionRequest) Reset() {
*x = TrialSubscriptionRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_subscription_service_proto_msgTypes[2]
+ mi := &file_v1_subscription_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -183,7 +221,7 @@ func (x *TrialSubscriptionRequest) String() string {
func (*TrialSubscriptionRequest) ProtoMessage() {}
func (x *TrialSubscriptionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_subscription_service_proto_msgTypes[2]
+ mi := &file_v1_subscription_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -196,7 +234,7 @@ func (x *TrialSubscriptionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrialSubscriptionRequest.ProtoReflect.Descriptor instead.
func (*TrialSubscriptionRequest) Descriptor() ([]byte, []int) {
- return file_v1_subscription_service_proto_rawDescGZIP(), []int{2}
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{3}
}
func (x *TrialSubscriptionRequest) GetTrial() *TrialSubscription {
@@ -217,7 +255,7 @@ type PatchSubscription struct {
func (x *PatchSubscription) Reset() {
*x = PatchSubscription{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_subscription_service_proto_msgTypes[3]
+ mi := &file_v1_subscription_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -230,7 +268,7 @@ func (x *PatchSubscription) String() string {
func (*PatchSubscription) ProtoMessage() {}
func (x *PatchSubscription) ProtoReflect() protoreflect.Message {
- mi := &file_v1_subscription_service_proto_msgTypes[3]
+ mi := &file_v1_subscription_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -243,7 +281,7 @@ func (x *PatchSubscription) ProtoReflect() protoreflect.Message {
// Deprecated: Use PatchSubscription.ProtoReflect.Descriptor instead.
func (*PatchSubscription) Descriptor() ([]byte, []int) {
- return file_v1_subscription_service_proto_rawDescGZIP(), []int{3}
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{4}
}
func (x *PatchSubscription) GetLicense() string {
@@ -266,7 +304,7 @@ type TrialSubscription struct {
func (x *TrialSubscription) Reset() {
*x = TrialSubscription{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_subscription_service_proto_msgTypes[4]
+ mi := &file_v1_subscription_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -279,7 +317,7 @@ func (x *TrialSubscription) String() string {
func (*TrialSubscription) ProtoMessage() {}
func (x *TrialSubscription) ProtoReflect() protoreflect.Message {
- mi := &file_v1_subscription_service_proto_msgTypes[4]
+ mi := &file_v1_subscription_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -292,7 +330,7 @@ func (x *TrialSubscription) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrialSubscription.ProtoReflect.Descriptor instead.
func (*TrialSubscription) Descriptor() ([]byte, []int) {
- return file_v1_subscription_service_proto_rawDescGZIP(), []int{4}
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{5}
}
func (x *TrialSubscription) GetPlan() PlanType {
@@ -333,7 +371,7 @@ type Subscription struct {
func (x *Subscription) Reset() {
*x = Subscription{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_subscription_service_proto_msgTypes[5]
+ mi := &file_v1_subscription_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -346,7 +384,7 @@ func (x *Subscription) String() string {
func (*Subscription) ProtoMessage() {}
func (x *Subscription) ProtoReflect() protoreflect.Message {
- mi := &file_v1_subscription_service_proto_msgTypes[5]
+ mi := &file_v1_subscription_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -359,7 +397,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message {
// Deprecated: Use Subscription.ProtoReflect.Descriptor instead.
func (*Subscription) Descriptor() ([]byte, []int) {
- return file_v1_subscription_service_proto_rawDescGZIP(), []int{5}
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{6}
}
func (x *Subscription) GetInstanceCount() int32 {
@@ -411,6 +449,110 @@ func (x *Subscription) GetOrgName() string {
return ""
}
+type FeatureMatrix struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Features []*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"`
+}
+
+func (x *FeatureMatrix) Reset() {
+ *x = FeatureMatrix{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_subscription_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FeatureMatrix) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FeatureMatrix) ProtoMessage() {}
+
+func (x *FeatureMatrix) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_subscription_service_proto_msgTypes[7]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use FeatureMatrix.ProtoReflect.Descriptor instead.
+func (*FeatureMatrix) Descriptor() ([]byte, []int) {
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *FeatureMatrix) GetFeatures() []*Feature {
+ if x != nil {
+ return x.Features
+ }
+ return nil
+}
+
+type Feature struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Name is the feature name.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Matrix is the feature matrix for different plan. The key is the plan enum in string value.
+ Matrix map[string]bool `protobuf:"bytes,2,rep,name=matrix,proto3" json:"matrix,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+}
+
+func (x *Feature) Reset() {
+ *x = Feature{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_subscription_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Feature) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Feature) ProtoMessage() {}
+
+func (x *Feature) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_subscription_service_proto_msgTypes[8]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Feature.ProtoReflect.Descriptor instead.
+func (*Feature) Descriptor() ([]byte, []int) {
+ return file_v1_subscription_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *Feature) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Feature) GetMatrix() map[string]bool {
+ if x != nil {
+ return x.Matrix
+ }
+ return nil
+}
+
var File_v1_subscription_service_proto protoreflect.FileDescriptor
var file_v1_subscription_service_proto_rawDesc = []byte{
@@ -426,80 +568,102 @@ var file_v1_subscription_service_proto_rawDesc = []byte{
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
- 0x51, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05,
- 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53,
- 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x22, 0x50, 0x0a, 0x18, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63,
- 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34,
- 0x0a, 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x61,
- 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x74,
- 0x72, 0x69, 0x61, 0x6c, 0x22, 0x2d, 0x0a, 0x11, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62,
- 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63,
- 0x65, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65,
- 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x11, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x73,
- 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x70,
- 0x6c, 0x61, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x05, 0x52, 0x04, 0x64, 0x61, 0x79, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61,
- 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
- 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xcf,
- 0x02, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12,
- 0x2a, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x69, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x65,
- 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 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, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12,
- 0x42, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
- 0x04, 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, 0x03, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x54,
- 0x69, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x19, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74,
+ 0x72, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x19, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0x50, 0x0a,
+ 0x18, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x74, 0x72, 0x69,
+ 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x22,
+ 0x2d, 0x0a, 0x11, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x22, 0x79,
+ 0x0a, 0x11, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70,
- 0x6c, 0x61, 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x74, 0x72, 0x69, 0x61,
- 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x1a, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64,
- 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65,
- 0x2a, 0x49, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15,
- 0x50, 0x4c, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x52, 0x45, 0x45, 0x10,
- 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x45,
- 0x4e, 0x54, 0x45, 0x52, 0x50, 0x52, 0x49, 0x53, 0x45, 0x10, 0x03, 0x32, 0x8f, 0x03, 0x0a, 0x13,
- 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76,
- 0x69, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
- 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
- 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1b, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75,
- 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
- 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27, 0xda,
- 0x41, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x05, 0x70,
- 0x61, 0x74, 0x63, 0x68, 0x32, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
- 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x84, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x69, 0x61, 0x6c,
- 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x61, 0x6c,
+ 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x12,
+ 0x0a, 0x04, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x64, 0x61,
+ 0x79, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74,
+ 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x0c, 0x53, 0x75,
+ 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x0e, 0x69, 0x6e,
+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
+ 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65,
+ 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 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, 0x03, 0x52, 0x0b, 0x65,
+ 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 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,
+ 0x03, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2e,
+ 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x54,
+ 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x1f,
+ 0x0a, 0x08, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x12,
+ 0x1a, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x08, 0x6f,
+ 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x41, 0x0a, 0x0d, 0x46,
+ 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x30, 0x0a, 0x08,
+ 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61,
+ 0x74, 0x75, 0x72, 0x65, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x92,
+ 0x01, 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38,
+ 0x0a, 0x06, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61,
+ 0x74, 0x75, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79,
+ 0x52, 0x06, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x1a, 0x39, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x72,
+ 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
+ 0x02, 0x38, 0x01, 0x2a, 0x49, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x19, 0x0a, 0x15, 0x50, 0x4c, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x52,
+ 0x45, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x0e,
+ 0x0a, 0x0a, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x50, 0x52, 0x49, 0x53, 0x45, 0x10, 0x03, 0x32, 0xfd,
+ 0x03, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1b, 0xda, 0x41, 0x00, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61,
+ 0x74, 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x24, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74,
+ 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46,
+ 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x22, 0x16, 0xda, 0x41,
+ 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x61,
+ 0x74, 0x75, 0x72, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
+ 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2d,
- 0xda, 0x41, 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x05,
- 0x74, 0x72, 0x69, 0x61, 0x6c, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63,
- 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x72, 0x69, 0x61, 0x6c, 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,
+ 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27,
+ 0xda, 0x41, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x05,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x32, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x84, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x69, 0x61,
+ 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x61,
+ 0x6c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22,
+ 0x2d, 0xda, 0x41, 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a,
+ 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x72, 0x69, 0x61, 0x6c, 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 (
@@ -515,35 +679,43 @@ func file_v1_subscription_service_proto_rawDescGZIP() []byte {
}
var file_v1_subscription_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_v1_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_v1_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_v1_subscription_service_proto_goTypes = []interface{}{
(PlanType)(0), // 0: bytebase.v1.PlanType
(*GetSubscriptionRequest)(nil), // 1: bytebase.v1.GetSubscriptionRequest
- (*UpdateSubscriptionRequest)(nil), // 2: bytebase.v1.UpdateSubscriptionRequest
- (*TrialSubscriptionRequest)(nil), // 3: bytebase.v1.TrialSubscriptionRequest
- (*PatchSubscription)(nil), // 4: bytebase.v1.PatchSubscription
- (*TrialSubscription)(nil), // 5: bytebase.v1.TrialSubscription
- (*Subscription)(nil), // 6: bytebase.v1.Subscription
- (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp
+ (*GetFeatureMatrixRequest)(nil), // 2: bytebase.v1.GetFeatureMatrixRequest
+ (*UpdateSubscriptionRequest)(nil), // 3: bytebase.v1.UpdateSubscriptionRequest
+ (*TrialSubscriptionRequest)(nil), // 4: bytebase.v1.TrialSubscriptionRequest
+ (*PatchSubscription)(nil), // 5: bytebase.v1.PatchSubscription
+ (*TrialSubscription)(nil), // 6: bytebase.v1.TrialSubscription
+ (*Subscription)(nil), // 7: bytebase.v1.Subscription
+ (*FeatureMatrix)(nil), // 8: bytebase.v1.FeatureMatrix
+ (*Feature)(nil), // 9: bytebase.v1.Feature
+ nil, // 10: bytebase.v1.Feature.MatrixEntry
+ (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
}
var file_v1_subscription_service_proto_depIdxs = []int32{
- 4, // 0: bytebase.v1.UpdateSubscriptionRequest.patch:type_name -> bytebase.v1.PatchSubscription
- 5, // 1: bytebase.v1.TrialSubscriptionRequest.trial:type_name -> bytebase.v1.TrialSubscription
- 0, // 2: bytebase.v1.TrialSubscription.plan:type_name -> bytebase.v1.PlanType
- 7, // 3: bytebase.v1.Subscription.expires_time:type_name -> google.protobuf.Timestamp
- 7, // 4: bytebase.v1.Subscription.started_time:type_name -> google.protobuf.Timestamp
- 0, // 5: bytebase.v1.Subscription.plan:type_name -> bytebase.v1.PlanType
- 1, // 6: bytebase.v1.SubscriptionService.GetSubscription:input_type -> bytebase.v1.GetSubscriptionRequest
- 2, // 7: bytebase.v1.SubscriptionService.UpdateSubscription:input_type -> bytebase.v1.UpdateSubscriptionRequest
- 3, // 8: bytebase.v1.SubscriptionService.TrialSubscription:input_type -> bytebase.v1.TrialSubscriptionRequest
- 6, // 9: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription
- 6, // 10: bytebase.v1.SubscriptionService.UpdateSubscription:output_type -> bytebase.v1.Subscription
- 6, // 11: bytebase.v1.SubscriptionService.TrialSubscription:output_type -> bytebase.v1.Subscription
- 9, // [9:12] is the sub-list for method output_type
- 6, // [6:9] is the sub-list for method input_type
- 6, // [6:6] is the sub-list for extension type_name
- 6, // [6:6] is the sub-list for extension extendee
- 0, // [0:6] is the sub-list for field type_name
+ 5, // 0: bytebase.v1.UpdateSubscriptionRequest.patch:type_name -> bytebase.v1.PatchSubscription
+ 6, // 1: bytebase.v1.TrialSubscriptionRequest.trial:type_name -> bytebase.v1.TrialSubscription
+ 0, // 2: bytebase.v1.TrialSubscription.plan:type_name -> bytebase.v1.PlanType
+ 11, // 3: bytebase.v1.Subscription.expires_time:type_name -> google.protobuf.Timestamp
+ 11, // 4: bytebase.v1.Subscription.started_time:type_name -> google.protobuf.Timestamp
+ 0, // 5: bytebase.v1.Subscription.plan:type_name -> bytebase.v1.PlanType
+ 9, // 6: bytebase.v1.FeatureMatrix.features:type_name -> bytebase.v1.Feature
+ 10, // 7: bytebase.v1.Feature.matrix:type_name -> bytebase.v1.Feature.MatrixEntry
+ 1, // 8: bytebase.v1.SubscriptionService.GetSubscription:input_type -> bytebase.v1.GetSubscriptionRequest
+ 2, // 9: bytebase.v1.SubscriptionService.GetFeatureMatrix:input_type -> bytebase.v1.GetFeatureMatrixRequest
+ 3, // 10: bytebase.v1.SubscriptionService.UpdateSubscription:input_type -> bytebase.v1.UpdateSubscriptionRequest
+ 4, // 11: bytebase.v1.SubscriptionService.TrialSubscription:input_type -> bytebase.v1.TrialSubscriptionRequest
+ 7, // 12: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription
+ 8, // 13: bytebase.v1.SubscriptionService.GetFeatureMatrix:output_type -> bytebase.v1.FeatureMatrix
+ 7, // 14: bytebase.v1.SubscriptionService.UpdateSubscription:output_type -> bytebase.v1.Subscription
+ 7, // 15: bytebase.v1.SubscriptionService.TrialSubscription:output_type -> bytebase.v1.Subscription
+ 12, // [12:16] is the sub-list for method output_type
+ 8, // [8:12] is the sub-list for method input_type
+ 8, // [8:8] is the sub-list for extension type_name
+ 8, // [8:8] is the sub-list for extension extendee
+ 0, // [0:8] is the sub-list for field type_name
}
func init() { file_v1_subscription_service_proto_init() }
@@ -565,7 +737,7 @@ func file_v1_subscription_service_proto_init() {
}
}
file_v1_subscription_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateSubscriptionRequest); i {
+ switch v := v.(*GetFeatureMatrixRequest); i {
case 0:
return &v.state
case 1:
@@ -577,7 +749,7 @@ func file_v1_subscription_service_proto_init() {
}
}
file_v1_subscription_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*TrialSubscriptionRequest); i {
+ switch v := v.(*UpdateSubscriptionRequest); i {
case 0:
return &v.state
case 1:
@@ -589,7 +761,7 @@ func file_v1_subscription_service_proto_init() {
}
}
file_v1_subscription_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PatchSubscription); i {
+ switch v := v.(*TrialSubscriptionRequest); i {
case 0:
return &v.state
case 1:
@@ -601,7 +773,7 @@ func file_v1_subscription_service_proto_init() {
}
}
file_v1_subscription_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*TrialSubscription); i {
+ switch v := v.(*PatchSubscription); i {
case 0:
return &v.state
case 1:
@@ -613,6 +785,18 @@ func file_v1_subscription_service_proto_init() {
}
}
file_v1_subscription_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TrialSubscription); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_subscription_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Subscription); i {
case 0:
return &v.state
@@ -624,6 +808,30 @@ func file_v1_subscription_service_proto_init() {
return nil
}
}
+ file_v1_subscription_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FeatureMatrix); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_subscription_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Feature); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -631,7 +839,7 @@ func file_v1_subscription_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_subscription_service_proto_rawDesc,
NumEnums: 1,
- NumMessages: 6,
+ NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/generated-go/v1/subscription_service.pb.gw.go b/proto/generated-go/v1/subscription_service.pb.gw.go
index d8fb15866e..c4e5015c4a 100644
--- a/proto/generated-go/v1/subscription_service.pb.gw.go
+++ b/proto/generated-go/v1/subscription_service.pb.gw.go
@@ -49,6 +49,24 @@ func local_request_SubscriptionService_GetSubscription_0(ctx context.Context, ma
}
+func request_SubscriptionService_GetFeatureMatrix_0(ctx context.Context, marshaler runtime.Marshaler, client SubscriptionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetFeatureMatrixRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := client.GetFeatureMatrix(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SubscriptionService_GetFeatureMatrix_0(ctx context.Context, marshaler runtime.Marshaler, server SubscriptionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetFeatureMatrixRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.GetFeatureMatrix(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_SubscriptionService_UpdateSubscription_0(ctx context.Context, marshaler runtime.Marshaler, client SubscriptionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateSubscriptionRequest
var metadata runtime.ServerMetadata
@@ -148,6 +166,31 @@ func RegisterSubscriptionServiceHandlerServer(ctx context.Context, mux *runtime.
})
+ mux.Handle("GET", pattern_SubscriptionService_GetFeatureMatrix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SubscriptionService/GetFeatureMatrix", runtime.WithHTTPPathPattern("/v1/feature"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SubscriptionService_GetFeatureMatrix_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SubscriptionService_GetFeatureMatrix_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("PATCH", pattern_SubscriptionService_UpdateSubscription_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -261,6 +304,28 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.
})
+ mux.Handle("GET", pattern_SubscriptionService_GetFeatureMatrix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SubscriptionService/GetFeatureMatrix", runtime.WithHTTPPathPattern("/v1/feature"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SubscriptionService_GetFeatureMatrix_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SubscriptionService_GetFeatureMatrix_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("PATCH", pattern_SubscriptionService_UpdateSubscription_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -311,6 +376,8 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.
var (
pattern_SubscriptionService_GetSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, ""))
+ pattern_SubscriptionService_GetFeatureMatrix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "feature"}, ""))
+
pattern_SubscriptionService_UpdateSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "subscription"}, ""))
pattern_SubscriptionService_TrialSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "subscription", "trial"}, ""))
@@ -319,6 +386,8 @@ var (
var (
forward_SubscriptionService_GetSubscription_0 = runtime.ForwardResponseMessage
+ forward_SubscriptionService_GetFeatureMatrix_0 = runtime.ForwardResponseMessage
+
forward_SubscriptionService_UpdateSubscription_0 = runtime.ForwardResponseMessage
forward_SubscriptionService_TrialSubscription_0 = runtime.ForwardResponseMessage
diff --git a/proto/generated-go/v1/subscription_service_grpc.pb.go b/proto/generated-go/v1/subscription_service_grpc.pb.go
index a4b8a5ea91..f016a0548c 100644
--- a/proto/generated-go/v1/subscription_service_grpc.pb.go
+++ b/proto/generated-go/v1/subscription_service_grpc.pb.go
@@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7
const (
SubscriptionService_GetSubscription_FullMethodName = "/bytebase.v1.SubscriptionService/GetSubscription"
+ SubscriptionService_GetFeatureMatrix_FullMethodName = "/bytebase.v1.SubscriptionService/GetFeatureMatrix"
SubscriptionService_UpdateSubscription_FullMethodName = "/bytebase.v1.SubscriptionService/UpdateSubscription"
SubscriptionService_TrialSubscription_FullMethodName = "/bytebase.v1.SubscriptionService/TrialSubscription"
)
@@ -29,6 +30,7 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SubscriptionServiceClient interface {
GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
+ GetFeatureMatrix(ctx context.Context, in *GetFeatureMatrixRequest, opts ...grpc.CallOption) (*FeatureMatrix, error)
UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
TrialSubscription(ctx context.Context, in *TrialSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
}
@@ -50,6 +52,15 @@ func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, in *Get
return out, nil
}
+func (c *subscriptionServiceClient) GetFeatureMatrix(ctx context.Context, in *GetFeatureMatrixRequest, opts ...grpc.CallOption) (*FeatureMatrix, error) {
+ out := new(FeatureMatrix)
+ err := c.cc.Invoke(ctx, SubscriptionService_GetFeatureMatrix_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *subscriptionServiceClient) UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
out := new(Subscription)
err := c.cc.Invoke(ctx, SubscriptionService_UpdateSubscription_FullMethodName, in, out, opts...)
@@ -73,6 +84,7 @@ func (c *subscriptionServiceClient) TrialSubscription(ctx context.Context, in *T
// for forward compatibility
type SubscriptionServiceServer interface {
GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error)
+ GetFeatureMatrix(context.Context, *GetFeatureMatrixRequest) (*FeatureMatrix, error)
UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*Subscription, error)
TrialSubscription(context.Context, *TrialSubscriptionRequest) (*Subscription, error)
mustEmbedUnimplementedSubscriptionServiceServer()
@@ -85,6 +97,9 @@ type UnimplementedSubscriptionServiceServer struct {
func (UnimplementedSubscriptionServiceServer) GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSubscription not implemented")
}
+func (UnimplementedSubscriptionServiceServer) GetFeatureMatrix(context.Context, *GetFeatureMatrixRequest) (*FeatureMatrix, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetFeatureMatrix not implemented")
+}
func (UnimplementedSubscriptionServiceServer) UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*Subscription, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSubscription not implemented")
}
@@ -122,6 +137,24 @@ func _SubscriptionService_GetSubscription_Handler(srv interface{}, ctx context.C
return interceptor(ctx, in, info, handler)
}
+func _SubscriptionService_GetFeatureMatrix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetFeatureMatrixRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SubscriptionServiceServer).GetFeatureMatrix(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SubscriptionService_GetFeatureMatrix_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SubscriptionServiceServer).GetFeatureMatrix(ctx, req.(*GetFeatureMatrixRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _SubscriptionService_UpdateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSubscriptionRequest)
if err := dec(in); err != nil {
@@ -169,6 +202,10 @@ var SubscriptionService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetSubscription",
Handler: _SubscriptionService_GetSubscription_Handler,
},
+ {
+ MethodName: "GetFeatureMatrix",
+ Handler: _SubscriptionService_GetFeatureMatrix_Handler,
+ },
{
MethodName: "UpdateSubscription",
Handler: _SubscriptionService_UpdateSubscription_Handler,
diff --git a/proto/v1/subscription_service.proto b/proto/v1/subscription_service.proto
index 9a9ea7398f..309ca094dc 100644
--- a/proto/v1/subscription_service.proto
+++ b/proto/v1/subscription_service.proto
@@ -14,6 +14,10 @@ service SubscriptionService {
option (google.api.http) = {get: "/v1/subscription"};
option (google.api.method_signature) = "";
}
+ rpc GetFeatureMatrix(GetFeatureMatrixRequest) returns (FeatureMatrix) {
+ option (google.api.http) = {get: "/v1/feature"};
+ option (google.api.method_signature) = "";
+ }
rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) {
option (google.api.http) = {
patch: "/v1/subscription"
@@ -32,6 +36,8 @@ service SubscriptionService {
message GetSubscriptionRequest {}
+message GetFeatureMatrixRequest {}
+
message UpdateSubscriptionRequest {
PatchSubscription patch = 1;
}
@@ -77,3 +83,15 @@ message Subscription {
string org_name = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}
+
+message FeatureMatrix {
+ repeated Feature features = 1;
+}
+
+message Feature {
+ // Name is the feature name.
+ string name = 1;
+
+ // Matrix is the feature matrix for different plan. The key is the plan enum in string value.
+ map<string, bool> matrix = 2;
+}