refactor(contract): restructure console contracts with nested billing module (#30999)

This commit is contained in:
yyh
2026-01-15 10:41:18 +08:00
committed by GitHub
parent 328897f81c
commit 3bee2ee067
6 changed files with 31 additions and 24 deletions

View File

@@ -1,16 +1,7 @@
import type { SystemFeatures } from '@/types/feature'
import { type } from '@orpc/contract'
import { base } from './base'
import { base } from '../base'
export const systemFeaturesContract = base
.route({
path: '/system-features',
method: 'GET',
})
.input(type<unknown>())
.output(type<SystemFeatures>())
export const billingUrlContract = base
export const invoicesContract = base
.route({
path: '/billing/invoices',
method: 'GET',

View File

@@ -0,0 +1,11 @@
import type { SystemFeatures } from '@/types/feature'
import { type } from '@orpc/contract'
import { base } from '../base'
export const systemFeaturesContract = base
.route({
path: '/system-features',
method: 'GET',
})
.input(type<unknown>())
.output(type<SystemFeatures>())

View File

@@ -1,5 +1,6 @@
import type { InferContractRouterInputs } from '@orpc/contract'
import { billingUrlContract, bindPartnerStackContract, systemFeaturesContract } from './console'
import { bindPartnerStackContract, invoicesContract } from './console/billing'
import { systemFeaturesContract } from './console/system'
import { collectionPluginsContract, collectionsContract, searchAdvancedContract } from './marketplace'
export const marketplaceRouterContract = {
@@ -12,8 +13,10 @@ export type MarketPlaceInputs = InferContractRouterInputs<typeof marketplaceRout
export const consoleRouterContract = {
systemFeatures: systemFeaturesContract,
billingUrl: billingUrlContract,
bindPartnerStack: bindPartnerStackContract,
billing: {
invoices: invoicesContract,
bindPartnerStack: bindPartnerStackContract,
},
}
export type ConsoleInputs = InferContractRouterInputs<typeof consoleRouterContract>