Skip to content

Commit

Permalink
feat: billing and limit refactoring (wundergraph#371)
Browse files Browse the repository at this point in the history
Co-authored-by: StarpTech <deusdustin@gmail.com>
  • Loading branch information
Pagebakers and StarpTech authored Dec 28, 2023
1 parent 413a1f8 commit 0adfee1
Show file tree
Hide file tree
Showing 80 changed files with 7,087 additions and 751 deletions.
6 changes: 6 additions & 0 deletions connect/src/wg/cosmo/common/common_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ export enum EnumStatusCode {
* @generated from enum value: ERROR_NOT_AUTHORIZED = 12;
*/
ERROR_NOT_AUTHORIZED = 12,

/**
* @generated from enum value: ERR_LIMIT_REACHED = 13;
*/
ERR_LIMIT_REACHED = 13,
}
// Retrieve enum metadata with: proto3.getEnumType(EnumStatusCode)
proto3.util.setEnumType(EnumStatusCode, "wg.cosmo.common.EnumStatusCode", [
Expand All @@ -89,6 +94,7 @@ proto3.util.setEnumType(EnumStatusCode, "wg.cosmo.common.EnumStatusCode", [
{ no: 10, name: "ERR_OPENAI_DISABLED" },
{ no: 11, name: "ERR_FREE_TRIAL_EXPIRED" },
{ no: 12, name: "ERROR_NOT_AUTHORIZED" },
{ no: 13, name: "ERR_LIMIT_REACHED" },
]);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable */
// @ts-nocheck

import { AcceptOrDeclineInvitationRequest, AcceptOrDeclineInvitationResponse, AddReadmeRequest, AddReadmeResponse, AddSubgraphMemberRequest, AddSubgraphMemberResponse, CheckFederatedGraphRequest, CheckFederatedGraphResponse, CheckSubgraphSchemaRequest, CheckSubgraphSchemaResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, CreateFederatedGraphRequest, CreateFederatedGraphResponse, CreateFederatedGraphTokenRequest, CreateFederatedGraphTokenResponse, CreateFederatedSubgraphRequest, CreateFederatedSubgraphResponse, CreateIntegrationRequest, CreateIntegrationResponse, CreateOIDCProviderRequest, CreateOIDCProviderResponse, CreateOrganizationWebhookConfigRequest, CreateOrganizationWebhookConfigResponse, DeleteAPIKeyRequest, DeleteAPIKeyResponse, DeleteFederatedGraphRequest, DeleteFederatedGraphResponse, DeleteFederatedSubgraphRequest, DeleteFederatedSubgraphResponse, DeleteIntegrationRequest, DeleteIntegrationResponse, DeleteOIDCProviderRequest, DeleteOIDCProviderResponse, DeleteOrganizationRequest, DeleteOrganizationResponse, DeleteOrganizationWebhookConfigRequest, DeleteOrganizationWebhookConfigResponse, DeleteRouterTokenRequest, DeleteRouterTokenResponse, FixSubgraphSchemaRequest, FixSubgraphSchemaResponse, ForceCheckSuccessRequest, ForceCheckSuccessResponse, GetAnalyticsViewRequest, GetAnalyticsViewResponse, GetAPIKeysRequest, GetAPIKeysResponse, GetChangelogBySchemaVersionRequest, GetChangelogBySchemaVersionResponse, GetCheckDetailsRequest, GetCheckDetailsResponse, GetCheckOperationsRequest, GetCheckOperationsResponse, GetChecksByFederatedGraphNameRequest, GetChecksByFederatedGraphNameResponse, GetCheckSummaryRequest, GetCheckSummaryResponse, GetClientsRequest, GetClientsResponse, GetCompositionDetailsRequest, GetCompositionDetailsResponse, GetCompositionsRequest, GetCompositionsResponse, GetDashboardAnalyticsViewRequest, GetDashboardAnalyticsViewResponse, GetFederatedGraphByNameRequest, GetFederatedGraphByNameResponse, GetFederatedGraphChangelogRequest, GetFederatedGraphChangelogResponse, GetFederatedGraphsBySubgraphLabelsRequest, GetFederatedGraphsBySubgraphLabelsResponse, GetFederatedGraphSDLByNameRequest, GetFederatedGraphSDLByNameResponse, GetFederatedGraphsRequest, GetFederatedGraphsResponse, GetFieldUsageRequest, GetFieldUsageResponse, GetGraphMetricsRequest, GetGraphMetricsResponse, GetInvitationsRequest, GetInvitationsResponse, GetLatestSubgraphSDLByNameRequest, GetLatestSubgraphSDLByNameResponse, GetLatestValidSubgraphSDLByNameRequest, GetLatestValidSubgraphSDLByNameResponse, GetMetricsErrorRateRequest, GetMetricsErrorRateResponse, GetOIDCProviderRequest, GetOIDCProviderResponse, GetOperationContentRequest, GetOperationContentResponse, GetOrganizationIntegrationsRequest, GetOrganizationIntegrationsResponse, GetOrganizationMembersRequest, GetOrganizationMembersResponse, GetOrganizationRequestsCountRequest, GetOrganizationRequestsCountResponse, GetOrganizationWebhookConfigsRequest, GetOrganizationWebhookConfigsResponse, GetOrganizationWebhookMetaRequest, GetOrganizationWebhookMetaResponse, GetPersistedOperationsRequest, GetPersistedOperationsResponse, GetRouterTokensRequest, GetRouterTokensResponse, GetSdlBySchemaVersionRequest, GetSdlBySchemaVersionResponse, GetSubgraphByNameRequest, GetSubgraphByNameResponse, GetSubgraphMembersRequest, GetSubgraphMembersResponse, GetSubgraphsRequest, GetSubgraphsResponse, GetTraceRequest, GetTraceResponse, GetUserAccessibleResourcesRequest, GetUserAccessibleResourcesResponse, InviteUserRequest, InviteUserResponse, IsGitHubAppInstalledRequest, IsGitHubAppInstalledResponse, IsRBACEnabledRequest, IsRBACEnabledResponse, LeaveOrganizationRequest, LeaveOrganizationResponse, MigrateFromApolloRequest, MigrateFromApolloResponse, PublishFederatedSubgraphRequest, PublishFederatedSubgraphResponse, PublishPersistedOperationsRequest, PublishPersistedOperationsResponse, RemoveInvitationRequest, RemoveInvitationResponse, RemoveOrganizationMemberRequest, RemoveOrganizationMemberResponse, RemoveSubgraphMemberRequest, RemoveSubgraphMemberResponse, UpdateFederatedGraphRequest, UpdateFederatedGraphResponse, UpdateIntegrationConfigRequest, UpdateIntegrationConfigResponse, UpdateOrganizationDetailsRequest, UpdateOrganizationDetailsResponse, UpdateOrganizationWebhookConfigRequest, UpdateOrganizationWebhookConfigResponse, UpdateOrgMemberRoleRequest, UpdateOrgMemberRoleResponse, UpdateRBACSettingsRequest, UpdateRBACSettingsResponse, UpdateSubgraphRequest, UpdateSubgraphResponse, WhoAmIRequest, WhoAmIResponse } from "./platform_pb.js";
import { AcceptOrDeclineInvitationRequest, AcceptOrDeclineInvitationResponse, AddReadmeRequest, AddReadmeResponse, AddSubgraphMemberRequest, AddSubgraphMemberResponse, CheckFederatedGraphRequest, CheckFederatedGraphResponse, CheckSubgraphSchemaRequest, CheckSubgraphSchemaResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, CreateBillingPortalSessionRequest, CreateBillingPortalSessionResponse, CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, CreateFederatedGraphRequest, CreateFederatedGraphResponse, CreateFederatedGraphTokenRequest, CreateFederatedGraphTokenResponse, CreateFederatedSubgraphRequest, CreateFederatedSubgraphResponse, CreateIntegrationRequest, CreateIntegrationResponse, CreateOIDCProviderRequest, CreateOIDCProviderResponse, CreateOrganizationRequest, CreateOrganizationResponse, CreateOrganizationWebhookConfigRequest, CreateOrganizationWebhookConfigResponse, DeleteAPIKeyRequest, DeleteAPIKeyResponse, DeleteFederatedGraphRequest, DeleteFederatedGraphResponse, DeleteFederatedSubgraphRequest, DeleteFederatedSubgraphResponse, DeleteIntegrationRequest, DeleteIntegrationResponse, DeleteOIDCProviderRequest, DeleteOIDCProviderResponse, DeleteOrganizationRequest, DeleteOrganizationResponse, DeleteOrganizationWebhookConfigRequest, DeleteOrganizationWebhookConfigResponse, DeleteRouterTokenRequest, DeleteRouterTokenResponse, FixSubgraphSchemaRequest, FixSubgraphSchemaResponse, ForceCheckSuccessRequest, ForceCheckSuccessResponse, GetAnalyticsViewRequest, GetAnalyticsViewResponse, GetAPIKeysRequest, GetAPIKeysResponse, GetBillingPlansRequest, GetBillingPlansResponse, GetChangelogBySchemaVersionRequest, GetChangelogBySchemaVersionResponse, GetCheckDetailsRequest, GetCheckDetailsResponse, GetCheckOperationsRequest, GetCheckOperationsResponse, GetChecksByFederatedGraphNameRequest, GetChecksByFederatedGraphNameResponse, GetCheckSummaryRequest, GetCheckSummaryResponse, GetClientsRequest, GetClientsResponse, GetCompositionDetailsRequest, GetCompositionDetailsResponse, GetCompositionsRequest, GetCompositionsResponse, GetDashboardAnalyticsViewRequest, GetDashboardAnalyticsViewResponse, GetFederatedGraphByNameRequest, GetFederatedGraphByNameResponse, GetFederatedGraphChangelogRequest, GetFederatedGraphChangelogResponse, GetFederatedGraphsBySubgraphLabelsRequest, GetFederatedGraphsBySubgraphLabelsResponse, GetFederatedGraphSDLByNameRequest, GetFederatedGraphSDLByNameResponse, GetFederatedGraphsRequest, GetFederatedGraphsResponse, GetFieldUsageRequest, GetFieldUsageResponse, GetGraphMetricsRequest, GetGraphMetricsResponse, GetInvitationsRequest, GetInvitationsResponse, GetLatestSubgraphSDLByNameRequest, GetLatestSubgraphSDLByNameResponse, GetLatestValidSubgraphSDLByNameRequest, GetLatestValidSubgraphSDLByNameResponse, GetMetricsErrorRateRequest, GetMetricsErrorRateResponse, GetOIDCProviderRequest, GetOIDCProviderResponse, GetOperationContentRequest, GetOperationContentResponse, GetOrganizationIntegrationsRequest, GetOrganizationIntegrationsResponse, GetOrganizationMembersRequest, GetOrganizationMembersResponse, GetOrganizationRequestsCountRequest, GetOrganizationRequestsCountResponse, GetOrganizationWebhookConfigsRequest, GetOrganizationWebhookConfigsResponse, GetOrganizationWebhookMetaRequest, GetOrganizationWebhookMetaResponse, GetPersistedOperationsRequest, GetPersistedOperationsResponse, GetRouterTokensRequest, GetRouterTokensResponse, GetSdlBySchemaVersionRequest, GetSdlBySchemaVersionResponse, GetSubgraphByNameRequest, GetSubgraphByNameResponse, GetSubgraphMembersRequest, GetSubgraphMembersResponse, GetSubgraphsRequest, GetSubgraphsResponse, GetTraceRequest, GetTraceResponse, GetUserAccessibleResourcesRequest, GetUserAccessibleResourcesResponse, InviteUserRequest, InviteUserResponse, IsGitHubAppInstalledRequest, IsGitHubAppInstalledResponse, IsRBACEnabledRequest, IsRBACEnabledResponse, LeaveOrganizationRequest, LeaveOrganizationResponse, MigrateFromApolloRequest, MigrateFromApolloResponse, PublishFederatedSubgraphRequest, PublishFederatedSubgraphResponse, PublishPersistedOperationsRequest, PublishPersistedOperationsResponse, RemoveInvitationRequest, RemoveInvitationResponse, RemoveOrganizationMemberRequest, RemoveOrganizationMemberResponse, RemoveSubgraphMemberRequest, RemoveSubgraphMemberResponse, UpdateFederatedGraphRequest, UpdateFederatedGraphResponse, UpdateIntegrationConfigRequest, UpdateIntegrationConfigResponse, UpdateOrganizationDetailsRequest, UpdateOrganizationDetailsResponse, UpdateOrganizationWebhookConfigRequest, UpdateOrganizationWebhookConfigResponse, UpdateOrgMemberRoleRequest, UpdateOrgMemberRoleResponse, UpdateRBACSettingsRequest, UpdateRBACSettingsResponse, UpdateSubgraphRequest, UpdateSubgraphResponse, UpgradePlanRequest, UpgradePlanResponse, WhoAmIRequest, WhoAmIResponse } from "./platform_pb.js";
import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf";
import { GetConfigRequest, GetConfigResponse } from "../../node/v1/node_pb.js";
import { createQueryService, createUnaryHooks, UnaryFunctionsWithHooks } from "@connectrpc/connect-query";
Expand Down Expand Up @@ -798,6 +798,8 @@ export const PlatformService = {
kind: MethodKind.Unary,
},
/**
* Analytics
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.GetAnalyticsView
*/
getAnalyticsView: {
Expand Down Expand Up @@ -865,6 +867,62 @@ export const PlatformService = {
O: GetOrganizationRequestsCountResponse,
kind: MethodKind.Unary,
},
/**
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateOrganization
*/
createOrganization: {
name: "CreateOrganization",
I: CreateOrganizationRequest,
O: CreateOrganizationResponse,
kind: MethodKind.Unary,
},
/**
*
* Billing
* -----------------------------------------------------------------------------------------------------------------------------
* Return the available billing plans
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.GetBillingPlans
*/
getBillingPlans: {
name: "GetBillingPlans",
I: GetBillingPlansRequest,
O: GetBillingPlansResponse,
kind: MethodKind.Unary,
},
/**
* Create a Stripe checkout session
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateCheckoutSession
*/
createCheckoutSession: {
name: "CreateCheckoutSession",
I: CreateCheckoutSessionRequest,
O: CreateCheckoutSessionResponse,
kind: MethodKind.Unary,
},
/**
* Create a Stripe billing portal session
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateBillingPortalSession
*/
createBillingPortalSession: {
name: "CreateBillingPortalSession",
I: CreateBillingPortalSessionRequest,
O: CreateBillingPortalSessionResponse,
kind: MethodKind.Unary,
},
/**
* Upgrade the current plan
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.UpgradePlan
*/
upgradePlan: {
name: "UpgradePlan",
I: UpgradePlanRequest,
O: UpgradePlanResponse,
kind: MethodKind.Unary,
},
}
} as const;

Expand Down Expand Up @@ -1366,6 +1424,8 @@ export const getSubgraphMembers: UnaryFunctionsWithHooks<GetSubgraphMembersReque
export const addReadme: UnaryFunctionsWithHooks<AddReadmeRequest, AddReadmeResponse> = { ...$queryService.addReadme, ...createUnaryHooks($queryService.addReadme)};

/**
* Analytics
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.GetAnalyticsView
*/
export const getAnalyticsView: UnaryFunctionsWithHooks<GetAnalyticsViewRequest, GetAnalyticsViewResponse> = { ...$queryService.getAnalyticsView, ...createUnaryHooks($queryService.getAnalyticsView)};
Expand Down Expand Up @@ -1399,3 +1459,39 @@ export const getFieldUsage: UnaryFunctionsWithHooks<GetFieldUsageRequest, GetFie
* @generated from rpc wg.cosmo.platform.v1.PlatformService.GetOrganizationRequestsCount
*/
export const getOrganizationRequestsCount: UnaryFunctionsWithHooks<GetOrganizationRequestsCountRequest, GetOrganizationRequestsCountResponse> = { ...$queryService.getOrganizationRequestsCount, ...createUnaryHooks($queryService.getOrganizationRequestsCount)};

/**
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateOrganization
*/
export const createOrganization: UnaryFunctionsWithHooks<CreateOrganizationRequest, CreateOrganizationResponse> = { ...$queryService.createOrganization, ...createUnaryHooks($queryService.createOrganization)};

/**
*
* Billing
* -----------------------------------------------------------------------------------------------------------------------------
* Return the available billing plans
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.GetBillingPlans
*/
export const getBillingPlans: UnaryFunctionsWithHooks<GetBillingPlansRequest, GetBillingPlansResponse> = { ...$queryService.getBillingPlans, ...createUnaryHooks($queryService.getBillingPlans)};

/**
* Create a Stripe checkout session
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateCheckoutSession
*/
export const createCheckoutSession: UnaryFunctionsWithHooks<CreateCheckoutSessionRequest, CreateCheckoutSessionResponse> = { ...$queryService.createCheckoutSession, ...createUnaryHooks($queryService.createCheckoutSession)};

/**
* Create a Stripe billing portal session
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.CreateBillingPortalSession
*/
export const createBillingPortalSession: UnaryFunctionsWithHooks<CreateBillingPortalSessionRequest, CreateBillingPortalSessionResponse> = { ...$queryService.createBillingPortalSession, ...createUnaryHooks($queryService.createBillingPortalSession)};

/**
* Upgrade the current plan
*
* @generated from rpc wg.cosmo.platform.v1.PlatformService.UpgradePlan
*/
export const upgradePlan: UnaryFunctionsWithHooks<UpgradePlanRequest, UpgradePlanResponse> = { ...$queryService.upgradePlan, ...createUnaryHooks($queryService.upgradePlan)};
Loading

0 comments on commit 0adfee1

Please sign in to comment.