File tree Expand file tree Collapse file tree
lib/api/generated/control-plane Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,8 +38,44 @@ export interface APIControlPlaneMetadata {
3838 * @example 3600000
3939 */
4040 inactivityLogoutMs ?: number ;
41+ auth ?: APIMetaAuth ;
42+ /**
43+ * the Pylon app ID for usepylon.com chat support
44+ * @example "12345678-1234-1234-1234-123456789012"
45+ */
46+ pylonAppId ?: string ;
47+ posthog ?: APIMetaPosthog ;
48+ /**
49+ * whether or not users can sign up for this instance
50+ * @example true
51+ */
52+ allowSignup ?: boolean ;
53+ /**
54+ * whether or not users can invite other users to this instance
55+ * @example true
56+ */
57+ allowInvites ?: boolean ;
58+ /**
59+ * whether or not users can create new tenants
60+ * @example true
61+ */
62+ allowCreateTenant ?: boolean ;
63+ /**
64+ * whether or not users can change their password
65+ * @example true
66+ */
67+ allowChangePassword ?: boolean ;
68+ /**
69+ * whether or not observability (trace collection) is enabled on this instance
70+ * @example false
71+ */
72+ observabilityEnabled ?: boolean ;
4173}
4274
75+ export type { APIMetaAuth } from '@/lib/api/generated/cloud/data-contracts' ;
76+
77+ export type { APIMetaPosthog } from '@/lib/api/generated/cloud/data-contracts' ;
78+
4379export type { APIErrors } from '@/lib/api/generated/cloud/data-contracts' ;
4480
4581export type { APIError } from '@/lib/api/generated/cloud/data-contracts' ;
Original file line number Diff line number Diff line change 1+ import useControlPlane from '@/hooks/use-control-plane.ts' ;
12import api from '@/lib/api' ;
3+ import { controlPlaneApi } from '@/lib/api/api.ts' ;
24import { useQuery } from '@tanstack/react-query' ;
35import { useMemo } from 'react' ;
46
57export default function useApiMeta ( ) {
8+ const { isControlPlaneEnabled } = useControlPlane ( ) ;
69 const metaQuery = useQuery ( {
710 queryKey : [ 'metadata:get' ] ,
811 queryFn : async ( ) => {
912 try {
10- return await api . metadataGet ( ) ;
13+ return await ( isControlPlaneEnabled
14+ ? controlPlaneApi . metadataGet ( )
15+ : api . metadataGet ( ) ) ;
1116 } catch ( e ) {
1217 console . error ( 'Failed to get API metadata' , e ) ;
1318 return null ;
You can’t perform that action at this time.
0 commit comments