mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(core): add workspace billing (#9043)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
query getWorkspaceSubscription($workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
subscription {
|
||||
id
|
||||
status
|
||||
plan
|
||||
recurring
|
||||
start
|
||||
end
|
||||
nextBillAt
|
||||
canceledAt
|
||||
variant
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,6 +706,29 @@ query getWorkspacePublicPages($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceSubscriptionQuery = {
|
||||
id: 'getWorkspaceSubscriptionQuery' as const,
|
||||
operationName: 'getWorkspaceSubscription',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspaceSubscription($workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
subscription {
|
||||
id
|
||||
status
|
||||
plan
|
||||
recurring
|
||||
start
|
||||
end
|
||||
nextBillAt
|
||||
canceledAt
|
||||
variant
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceQuery = {
|
||||
id: 'getWorkspaceQuery' as const,
|
||||
operationName: 'getWorkspace',
|
||||
@@ -1408,6 +1431,29 @@ mutation revokeInviteLink($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const workspaceInvoicesQuery = {
|
||||
id: 'workspaceInvoicesQuery' as const,
|
||||
operationName: 'workspaceInvoices',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query workspaceInvoices($take: Int!, $skip: Int!, $workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
invoiceCount
|
||||
invoices(take: $take, skip: $skip) {
|
||||
id
|
||||
status
|
||||
currency
|
||||
amount
|
||||
reason
|
||||
lastPaymentError
|
||||
link
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const workspaceQuotaQuery = {
|
||||
id: 'workspaceQuotaQuery' as const,
|
||||
operationName: 'workspaceQuota',
|
||||
|
||||
15
packages/frontend/graphql/src/graphql/workspace-invoices.gql
Normal file
15
packages/frontend/graphql/src/graphql/workspace-invoices.gql
Normal file
@@ -0,0 +1,15 @@
|
||||
query workspaceInvoices($take: Int!, $skip: Int!, $workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
invoiceCount
|
||||
invoices(take: $take, skip: $skip) {
|
||||
id
|
||||
status
|
||||
currency
|
||||
amount
|
||||
reason
|
||||
lastPaymentError
|
||||
link
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2014,6 +2014,29 @@ export type GetWorkspacePublicPagesQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type GetWorkspaceSubscriptionQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspaceSubscriptionQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
subscription: {
|
||||
__typename?: 'SubscriptionType';
|
||||
id: string | null;
|
||||
status: SubscriptionStatus;
|
||||
plan: SubscriptionPlan;
|
||||
recurring: SubscriptionRecurring;
|
||||
start: string;
|
||||
end: string | null;
|
||||
nextBillAt: string | null;
|
||||
canceledAt: string | null;
|
||||
variant: SubscriptionVariant | null;
|
||||
} | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetWorkspaceQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -2627,6 +2650,31 @@ export type RevokeInviteLinkMutation = {
|
||||
revokeInviteLink: boolean;
|
||||
};
|
||||
|
||||
export type WorkspaceInvoicesQueryVariables = Exact<{
|
||||
take: Scalars['Int']['input'];
|
||||
skip: Scalars['Int']['input'];
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type WorkspaceInvoicesQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
invoiceCount: number;
|
||||
invoices: Array<{
|
||||
__typename?: 'InvoiceType';
|
||||
id: string | null;
|
||||
status: InvoiceStatus;
|
||||
currency: string;
|
||||
amount: number;
|
||||
reason: string;
|
||||
lastPaymentError: string | null;
|
||||
link: string | null;
|
||||
createdAt: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
export type WorkspaceQuotaQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -2813,6 +2861,11 @@ export type Queries =
|
||||
variables: GetWorkspacePublicPagesQueryVariables;
|
||||
response: GetWorkspacePublicPagesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceSubscriptionQuery';
|
||||
variables: GetWorkspaceSubscriptionQueryVariables;
|
||||
response: GetWorkspaceSubscriptionQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceQuery';
|
||||
variables: GetWorkspaceQueryVariables;
|
||||
@@ -2883,6 +2936,11 @@ export type Queries =
|
||||
variables: ListWorkspaceFeaturesQueryVariables;
|
||||
response: ListWorkspaceFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'workspaceInvoicesQuery';
|
||||
variables: WorkspaceInvoicesQueryVariables;
|
||||
response: WorkspaceInvoicesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'workspaceQuotaQuery';
|
||||
variables: WorkspaceQuotaQueryVariables;
|
||||
|
||||
Reference in New Issue
Block a user