import { J as JsonApiConfig } from '../JsonApiContext-Bsm_Q2oe.js'; export { C as CacheProfile, a as JsonApiContext, u as useJsonApiConfig, b as useJsonApiConfigOptional } from '../JsonApiContext-Bsm_Q2oe.js'; import * as React from 'react'; import React__default from 'react'; import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.js'; import { A as ApiRequestDataTypeInterface } from '../ApiRequestDataTypeInterface-CYEcRUrh.js'; import { A as ApiResponseInterface } from '../ApiResponseInterface-CWLvSCvS.js'; import { A as ApiData } from '../ApiData-DPKNfY-9.js'; import { M as ModuleWithPermissions, P as PageUrl } from '../types-bsm8Fp55.js'; export { I as I18nConfig, m as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, n as UseLocaleHook, o as UseRouterHook, p as UseTranslationsHook, h as configureClientConfig, f as configureI18n, c as configureJsonApi, g as getApiUrl, b as getAppUrl, i as getI18nLink, a as getPublicApiUrl, e as getStripePublishableKey, d as getTrackablePages, u as useI18nDateFnsLocale, j as useI18nLocale, k as useI18nRouter, l as useI18nTranslations } from '../config-Cd5xTEfZ.js'; import { ColumnDef } from '@tanstack/react-table'; import { D as DataListRetriever } from '../useDataListRetriever-WEXL4bqB.js'; export { u as useDataListRetriever } from '../useDataListRetriever-WEXL4bqB.js'; export { u as usePageUrlGenerator } from '../usePageUrlGenerator-J_ECv-oQ.js'; import { a as D3Node, D as D3Link, C as ContentFields, R as RoleFields, U as UserFields } from '../content.fields-1AlHDtDb.js'; export { u as useSocket } from '../useSocket-CiyTtYFj.js'; import { C as ContentInterface, e as RoleInterface, U as UserInterface } from '../notification.interface-DYF56CtE.js'; import { O as OAuthClientInterface, b as OAuthClientCreateRequest, c as OAuthClientCreateResponse, a as OAuthClientInput, f as OAuthConsentInfo, d as OAuthConsentRequest } from '../oauth.interface-CD90ycYz.js'; import 'lucide-react'; import '../help-content-config.interface-C5ESIod9.js'; import 'd3'; import '../feature.interface-BO25VLlx.js'; interface JsonApiProviderProps { config: JsonApiConfig; children: React__default.ReactNode; } declare function JsonApiProvider({ config, children }: JsonApiProviderProps): React__default.JSX.Element; interface UseJsonApiGetOptions { /** * Whether to enable the query. If false, the query won't run. */ enabled?: boolean; /** * Dependencies that trigger a refetch when changed. */ deps?: any[]; } interface UseJsonApiGetResult { /** * The fetched data, or null if not yet fetched. */ data: T | null; /** * Whether the query is currently loading. */ loading: boolean; /** * Error message if the query failed. */ error: string | null; /** * The full API response (includes raw data, pagination, etc.) */ response: ApiResponseInterface | null; /** * Function to manually refetch the data. */ refetch: () => Promise; /** * Whether there is a next page available. */ hasNextPage: boolean; /** * Whether there is a previous page available. */ hasPreviousPage: boolean; /** * Function to fetch the next page. */ fetchNextPage: () => Promise; /** * Function to fetch the previous page. */ fetchPreviousPage: () => Promise; } /** * Hook for fetching data from a JSON:API endpoint. * * @example * ```tsx * const { data, loading, error, refetch } = useJsonApiGet
({ * classKey: Modules.Article, * endpoint: `/articles/${id}`, * }); * * if (loading) return ; * if (error) return ; * return ; * ``` */ declare function useJsonApiGet(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; options?: UseJsonApiGetOptions; }): UseJsonApiGetResult; type MutationMethod = "POST" | "PUT" | "PATCH" | "DELETE"; interface UseJsonApiMutationResult { /** * The result data from the mutation, or null if not yet executed. */ data: T | null; /** * Whether the mutation is currently in progress. */ loading: boolean; /** * Error message if the mutation failed. */ error: string | null; /** * The full API response. */ response: ApiResponseInterface | null; /** * Execute the mutation. */ mutate: (params: MutationParams) => Promise; /** * Reset the mutation state. */ reset: () => void; } interface MutationParams { /** * The endpoint to call. */ endpoint: string; /** * The request body. */ body?: any; /** * Files to upload. */ files?: { [key: string]: File | Blob; } | File | Blob; /** * Company ID for multi-tenant requests. */ companyId?: string; /** * Override the default JSON:API body creation. */ overridesJsonApiCreation?: boolean; /** * Response type if different from the request type. */ responseType?: ApiRequestDataTypeInterface; } /** * Hook for making mutations (POST, PUT, PATCH, DELETE) to a JSON:API endpoint. * * @example * ```tsx * const { mutate, loading, error } = useJsonApiMutation
({ * method: "POST", * classKey: Modules.Article, * }); * * const handleSubmit = async (data: ArticleInput) => { * const result = await mutate({ * endpoint: "/articles", * body: data, * }); * if (result) { * // Success! * } * }; * ``` */ declare function useJsonApiMutation(config: { method: MutationMethod; classKey: ApiRequestDataTypeInterface; onSuccess?: (data: T) => void; onError?: (error: string) => void; }): UseJsonApiMutationResult; /** * Hook to rehydrate server-passed data into typed objects. * Use this when passing data from server components to client components. * * @example * ```tsx * // In server component * const article = await ArticleService.findOne(id); * return ; * * // In client component * function ArticleDetails({ data }: { data: JsonApiHydratedDataInterface }) { * const article = useRehydration
(Modules.Article, data); * return
{article.title}
; * } * ``` */ declare function useRehydration(classKey: ApiRequestDataTypeInterface, data: JsonApiHydratedDataInterface | null | undefined): T | null; /** * Hook to rehydrate a list of server-passed data into typed objects. */ declare function useRehydrationList(classKey: ApiRequestDataTypeInterface, data: JsonApiHydratedDataInterface[] | null | undefined): T[]; interface DirectFetchParams { method: string; url: string; token?: string; body?: any; files?: { [key: string]: File | Blob; } | File | Blob; companyId?: string; language: string; additionalHeaders?: Record; } /** * Client-side direct fetch to bypass server action overhead. * Use this for client-side API calls. */ declare function directFetch(params: DirectFetchParams): Promise; /** * Get the authentication token from cookies (client-side only) */ declare function getClientToken(): Promise; /** * Configure the JSON:API client for browser contexts. * Call this in your client-side initialization or use JsonApiProvider. */ declare function configureClientJsonApi(config: { apiUrl: string; appUrl?: string; trackablePages?: ModuleWithPermissions[]; bootstrapper?: () => void; additionalHeaders?: Record; }): void; declare function getClientApiUrl(): string; declare function getClientAppUrl(): string; declare function getClientTrackablePages(): ModuleWithPermissions[]; /** * Resolve the final request URL for an endpoint (client-side variant of `buildUrl` * in `unified/JsonApiRequest.ts` — kept in lockstep with it). * * - `endpoint` starting with "http" is always passed through unchanged (existing behaviour). * - Otherwise, an explicit `baseUrl` (per-call override) takes precedence over the global * `getClientApiUrl()` resolution. Omitting `baseUrl` preserves today's behaviour exactly. */ declare function buildClientUrl(endpoint: string, baseUrl?: string): string; declare function ClientJsonApiGet(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; language: string; baseUrl?: string; }): Promise; declare function ClientJsonApiPost(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; body?: any; overridesJsonApiCreation?: boolean; files?: { [key: string]: File | Blob; } | File | Blob; language: string; responseType?: ApiRequestDataTypeInterface; baseUrl?: string; }): Promise; declare function ClientJsonApiPut(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; body?: any; files?: { [key: string]: File | Blob; } | File | Blob; language: string; responseType?: ApiRequestDataTypeInterface; baseUrl?: string; }): Promise; declare function ClientJsonApiPatch(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; body?: any; files?: { [key: string]: File | Blob; } | File | Blob; overridesJsonApiCreation?: boolean; responseType?: ApiRequestDataTypeInterface; language: string; baseUrl?: string; }): Promise; declare function ClientJsonApiDelete(params: { classKey: ApiRequestDataTypeInterface; endpoint: string; companyId?: string; language: string; responseType?: ApiRequestDataTypeInterface; baseUrl?: string; }): Promise; type TableContent = { jsonApiData: T; [key: string]: any; }; interface TableStructureGeneratorInterface { generateTableStructure: (params: { t: (key: string) => string; generateUrl: (params: { page: string | PageUrl | string; id?: string; }) => string; data: T[]; fields: Array; checkedIds?: string[]; toggleId?: (id: string) => void; }) => { data: TableContent[]; columns: ColumnDef>[]; }; } type UseTableStructureHookParams = { data: T[]; fields: Array; checkedIds?: string[]; toggleId?: (id: string) => void; dataRetriever?: DataListRetriever; context?: Record; }; type UseTableStructureHookReturn = { data: TableContent[]; columns: ColumnDef>[]; }; type UseTableStructureHook = (params: UseTableStructureHookParams) => UseTableStructureHookReturn; declare class TableGeneratorRegistry { private static instance; private registry; private constructor(); static getInstance(): TableGeneratorRegistry; register(type: string, hook: UseTableStructureHook): void; get(type: string, params: UseTableStructureHookParams): UseTableStructureHookReturn; isRegistered(type: string): boolean; getRegisteredTypes(): string[]; unregister(type: string): boolean; clear(): void; } declare const tableGeneratorRegistry: TableGeneratorRegistry; declare function useUrlRewriter(): (params: { page: ModuleWithPermissions | string; id?: string; childPage?: ModuleWithPermissions | string; childId?: string; additionalParameters?: { [key: string]: string | string[] | undefined; }; }) => void; declare function useDebounce any>(callback: T, delay: number): T & { cancel: () => void; }; declare function registerTableGenerator(type: string | ModuleWithPermissions, hook: UseTableStructureHook): void; declare function useTableGenerator(type: ModuleWithPermissions, params: UseTableStructureHookParams): UseTableStructureHookReturn; type LayeredRankDir = "LR" | "RL" | "TB" | "BT"; interface LayeredLayoutOptions { rankdir?: LayeredRankDir; nodesep?: number; ranksep?: number; minNodeWidth: number; minNodeHeight: number; } interface LayeredLayoutPosition { x: number; y: number; } interface FitLayeredLayoutOptions extends LayeredLayoutOptions { targetAspectRatio: number; maxIterations?: number; tolerance?: number; } /** * Compute a layered DAG layout using dagre. Pure function: no DOM, no React, * no d3 globals. Returns a Map of node.id -> { x, y } in graph coordinates. * * Returns null if dagre.layout throws (e.g. an unexpected cycle). Callers * should fall back to their previous layout in that case. */ declare function computeLayeredLayout(nodes: D3Node[], links: D3Link[], opts: LayeredLayoutOptions): Map | null; /** * Compute a layered layout, then iteratively re-run dagre with adjusted * `nodesep`/`ranksep` until the bounding-box aspect ratio is within * `tolerance` of `targetAspectRatio` (or `maxIterations` is reached). * * Degenerate cases (empty graph, single-rank graph where one axis has * zero extent, missing target ratio) skip fitting and return the * single-pass result. */ declare function fitLayeredLayoutToAspectRatio(nodes: D3Node[], links: D3Link[], opts: FitLayeredLayoutOptions): Map | null; /** * Custom hook for D3 graph visualization with larger circles and more interactive features */ declare function useCustomD3Graph(nodes: D3Node[], links: D3Link[], onNodeClick: (nodeId: string) => void, visibleNodeIds?: Set, options?: { directed?: boolean; layout?: "radial" | "layered"; layered?: { rankdir?: LayeredRankDir; nodesep?: number; ranksep?: number; fitContainer?: boolean; }; }, loadingNodeIds?: Set, containerKey?: string | number): { svgRef: React.RefObject; zoomIn: () => void; zoomOut: () => void; zoomToNode: (nodeId: string, childIds?: string[]) => void; zoomToFitAll: () => void; }; declare function useNotificationSync(): void; declare function usePageTracker(): void; declare const useContentTableStructure: (params: Parameters>[0]) => ReturnType>; declare const useRoleTableStructure: UseTableStructureHook; declare const useUserSearch: () => { users: UserInterface[]; searchQuery: string; setSearchQuery: React.Dispatch>; isLoading: boolean; loadUsers: (search: string) => Promise; clearSearch: () => void; searchQueryRef: React.RefObject; }; declare const useUserTableStructure: UseTableStructureHook; interface UseOAuthClientsReturn { /** List of OAuth clients */ clients: OAuthClientInterface[]; /** Whether clients are being loaded */ isLoading: boolean; /** Error from last operation */ error: Error | null; /** Refetch clients from API */ refetch: () => Promise; /** Create a new OAuth client */ createClient: (data: OAuthClientCreateRequest) => Promise; } /** * Hook for managing OAuth clients list * * @example * ```tsx * const { clients, isLoading, createClient } = useOAuthClients(); * * const handleCreate = async (data) => { * const { client, clientSecret } = await createClient(data); * // clientSecret is shown only once! * }; * ``` */ declare function useOAuthClients(): UseOAuthClientsReturn; interface UseOAuthClientReturn { /** The OAuth client (from store or fetched) */ client: OAuthClientInterface | null; /** Whether the client is being loaded */ isLoading: boolean; /** Error from last operation */ error: Error | null; /** Update the client */ update: (data: Partial) => Promise; /** Delete the client */ deleteClient: () => Promise; /** Regenerate the client secret */ regenerateSecret: () => Promise; /** Refetch client from API */ refetch: () => Promise; } /** * Hook for managing a single OAuth client * * @param clientId - The client ID to manage * * @example * ```tsx * const { client, update, deleteClient, regenerateSecret } = useOAuthClient(clientId); * * const handleRegenerate = async () => { * const newSecret = await regenerateSecret(); * // newSecret is shown only once! * }; * ``` */ declare function useOAuthClient(clientId: string): UseOAuthClientReturn; interface UseOAuthConsentReturn { /** Client and scope info for consent display */ clientInfo: OAuthConsentInfo | null; /** Whether consent info is being loaded */ isLoading: boolean; /** Error from consent flow */ error: Error | null; /** Approve the authorization request */ approve: () => Promise; /** Deny the authorization request */ deny: () => Promise; /** Whether approve/deny is in progress */ isSubmitting: boolean; } /** * Hook for managing the OAuth consent flow * * @param params - OAuth authorization parameters from URL * * @example * ```tsx * const { clientInfo, isLoading, approve, deny } = useOAuthConsent({ * clientId: searchParams.client_id, * redirectUri: searchParams.redirect_uri, * scope: searchParams.scope, * state: searchParams.state, * }); * * // Render consent screen with clientInfo * // On button click: approve() or deny() * ``` */ declare function useOAuthConsent(params: OAuthConsentRequest): UseOAuthConsentReturn; interface TrialSubscriptionStatus { status: "loading" | "trial" | "active" | "expired"; trialEndsAt: Date | null; daysRemaining: number; isGracePeriod: boolean; isBlocked: boolean; } declare function useSubscriptionStatus(): TrialSubscriptionStatus; export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, type FitLayeredLayoutOptions, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type LayeredLayoutOptions, type LayeredLayoutPosition, type LayeredRankDir, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, buildClientUrl, computeLayeredLayout, configureClientJsonApi, directFetch, fitLayeredLayoutToAspectRatio, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };