export { AppModuleDefinitions, Assistant, AssistantAction, AssistantActionInput, AssistantActionInterface, AssistantActionModule, AssistantActionService, AssistantActionStatus, AssistantMessage, AssistantMessageModule, AssistantMessageService, AssistantModule, AssistantService, AuditLog, AuditLogInterface, AuditLogModule, AuditLogService, Auth, AuthModule, AuthorModule, BackupCodeVerify, BackupCodeVerifyInput, BackupCodeVerifyModule, Billing, BillingModule, BillingService, BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, CURRENT_USER_STORAGE_KEY, Chunk, ChunkInput, ChunkModule, ClientAbstractService, ClientHttpMethod, ClientNextRef, ClientPreviousRef, ClientSelfRef, ClientTotalRef, CodiceFiscaleValidationOptions, Company, CompanyFields, CompanyModule, Content, ContentModule, DataClass, DataClass as DataClassRegistry, DiffBlock, DiffResult, ENV, EndpointCreator, EndpointQuery, EntityAiStatus, EntityObject, Feature, FeatureModule, FormatOption, FoundationModuleDefinitions, HowTo, HowToFields, HowToModule, HowToService, InviteValidation, JsonApiDataFactory, MOBILE_BREAKPOINT, Module, ModuleDefinitions, ModuleModule, ModulePathsModule, ModuleRegistrar, ModuleRegistry, Modules, Notification, NotificationFields, NotificationModule, OAuthClient, OAuthModule, OAuthService, Passkey, PasskeyAuthenticationOptions, PasskeyAuthenticationOptionsInput, PasskeyAuthenticationOptionsInterface, PasskeyAuthenticationOptionsModule, PasskeyModule, PasskeyRegistrationOptions, PasskeyRegistrationOptionsInput, PasskeyRegistrationOptionsInterface, PasskeyRegistrationOptionsModule, PasskeyRegistrationVerify, PasskeyRegistrationVerifyInput, PasskeyRegistrationVerifyModule, PasskeyRename, PasskeyRenameInput, PasskeyRenameModule, PasskeyVerifyLogin, PasskeyVerifyLoginInput, PasskeyVerifyLoginModule, PaymentMethod, PermissionMappingModule, Push, PushInput, PushInterface, PushModule, RbacMatrixModule, ReferralModule, ReferralService, ReferralStats, ReferralStatsModule, RehydrationFactory, Role, RoleModule, S3, S3Module, SearchResultInterface, StripeCustomer, StripeCustomerModule, StripeCustomerService, StripeInvoice, StripeInvoiceModule, StripeInvoiceService, StripePaymentMethodModule, StripePrice, StripePriceFields, StripePriceModule, StripePriceService, StripeProduct, StripeProductFields, StripeProductModule, StripeProductService, StripePromotionCode, StripePromotionCodeModule, StripePromotionCodeService, StripeSubscription, StripeSubscriptionModule, StripeSubscriptionService, StripeUsage, StripeUsageModule, StripeUsageService, TableOptions, ToastOptions, TotpAuthenticator, TotpAuthenticatorModule, TotpSetup, TotpSetupInput, TotpSetupInterface, TotpSetupModule, TotpVerify, TotpVerifyInput, TotpVerifyLogin, TotpVerifyLoginInput, TotpVerifyLoginModule, TotpVerifyModule, TwoFactorChallenge, TwoFactorChallengeInput, TwoFactorChallengeModule, TwoFactorEnable, TwoFactorEnableInput, TwoFactorEnableModule, TwoFactorService, TwoFactorStatus, TwoFactorStatusInterface, TwoFactorStatusModule, User, UserModule, UserObject, VIEWPORT_COOKIE_NAME, Waitlist, WaitlistInput, WaitlistInterface, WaitlistModule, WaitlistService, WaitlistStats, WaitlistStatsInterface, WaitlistStatsModule, WaitlistStatus, WordDiff, checkPermissions, checkPermissionsFromServer, cn, composeRefs, dismissToast, entityObjectSchema, exists, formatCodiceFiscale, formatDate, formatLocalDate, formatPartitaIva, getBootstrapper, getClientGlobalErrorHandler, getTableComponents, getTableOptions, getValueFromPath, hasBootstrapper, isRemoteImageSrc, rehydrate, rehydrateList, resetBootstrapStore, setBootstrapper, setClientGlobalErrorHandler, showCustomToast, showError, showToast, translateData, translateResponse, tryBootstrap, useComposedRefs, useIsMobile, userObjectSchema, validateCodiceFiscale, validateItalianTaxCode, validatePartitaIva } from './core/index.mjs'; export { A as ApiData } from './ApiData-DPKNfY-9.mjs'; import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from './ApiDataInterface-BcZeXy5X.mjs'; export { A as ApiRequestDataTypeInterface, F as FieldSelector, G as GetterKeys, c as createJsonApiInclusion } from './ApiRequestDataTypeInterface-CYEcRUrh.mjs'; export { A as ApiResponseInterface } from './ApiResponseInterface-rsXRL_Hn.mjs'; import { A as AbstractApiData } from './AbstractApiData-XLhBP5Tl.mjs'; import { A as AbstractService } from './AbstractService-B0T7h8fX.mjs'; export { H as HttpMethod, N as NextRef, P as PreviousRef, S as SelfRef, T as TotalRef, b as clearLastApiMeta, c as clearLastApiTotal, d as getGlobalErrorHandler, a as getLastApiMeta, g as getLastApiTotal, s as setGlobalErrorHandler } from './AbstractService-B0T7h8fX.mjs'; export { c as AssistantMessageInput, d as AssistantMessageInterface, A as AssistantMessageRole, b as AssistantMessageType, B as BreadcrumbItemData, e as ChunkInterface, C as ChunkRelationshipMeta, H as HowToInput, a as HowToInterface } from './AssistantMessageInterface-ddyG114R.mjs'; export { C as ContentFields, D as D3Link, a as D3Node, R as RoleFields, U as UserFields } from './content.fields-1AlHDtDb.mjs'; export { ClassValue } from 'clsx'; export { h as AiConnection, l as AiConnectionEnvDefaults, i as AiConnectionFields, n as AiConnectionInput, m as AiConnectionInterface, p as AiConnectionModule, o as AiConnectionService, j as AiProviderFieldDescriptor, k as AiProviderRegistry, A as AuthComponent, P as PasskeyInterface, T as TotpAuthenticatorInterface, b as getIcon, a as getIconByModule, c as getIconByModuleName, g as getInitials, d as getLucideIcon, e as getLucideIconByModule, f as getLucideIconByModuleName } from './ai-connection.module-28f-hux0.mjs'; export { A as Action, d as ModuleDefinition, a as ModuleFactory, c as ModulePermissionDefinition, M as ModuleWithPermissions, P as PageUrl, b as PermissionCheck, e as PermissionConfig, f as PermissionModule, g as PermissionUser } from './types-Bq_UA8Lg.mjs'; export { A as AuthInput, b as AuthInterface, a as AuthQuery } from './auth.interface-jYD8Gc4P.mjs'; export { A as AuthService, C as CompanyService, a as ContentService, F as FeatureService, N as NotificationService, P as PushService, R as RoleService, b as S3Input, c as S3Interface, S as S3Service, T as TwoFactorChallengeInterface, U as UserService } from './s3.service-D_dswjgz.mjs'; export { I as InvoiceStatus, M as MeterInterface, o as MeterSummaryInterface, P as PaymentMethodInterface, e as PriceRecurring, q as PromotionCodeValidationResult, c as ProrationLineItem, b as ProrationPreviewInterface, R as ReportUsageInput, S as StripeCustomerInterface, a as StripeInvoiceInterface, f as StripePriceInput, d as StripePriceInterface, h as StripeProductInput, g as StripeProductInterface, l as StripeSubscriptionCreateMeta, m as StripeSubscriptionCreateResponse, k as StripeSubscriptionInput, j as StripeSubscriptionInterface, n as StripeUsageInterface, i as SubscriptionStatus, p as UsageRecordInterface, U as UsageSummaryInterface } from './stripe-promotion-code.interface-ClZ7DxS9.mjs'; export { b as CompanyInput, c as CompanyInterface, a as ContentInput, C as ContentInterface, d as NotificationInput, N as NotificationInterface, R as RoleInput, e as RoleInterface, f as UserInput, U as UserInterface } from './notification.interface-BWOCvKRP.mjs'; export { A as AssistantInput, a as AssistantInterface } from './AssistantInterface-DMh-zApr.mjs'; export { F as FeatureInterface, M as ModuleInterface } from './feature.interface-CXb1-vNq.mjs'; export { A as AVAILABLE_OAUTH_SCOPES, D as DEFAULT_GRANT_TYPES, g as OAUTH_SCOPE_DISPLAY, b as OAuthClientCreateRequest, c as OAuthClientCreateResponse, a as OAuthClientInput, O as OAuthClientInterface, f as OAuthConsentInfo, d as OAuthConsentRequest, e as OAuthScopeInfo } from './oauth.interface-DRE3NAKc.mjs'; export { b as TokenUsageAdminBreakdownModule, T as TokenUsageAdminSummaryModule, a as TokenUsageAdminTimelineModule, c as configureTokenUsage, g as getTokenUsageCurrency, t as tokenUsageModules } from './config-n-ZpPmOL.mjs'; export { I as I18nConfig, f as configureI18n, c as configureJsonApi, g as getApiUrl, b as getAppUrl, a as getPublicApiUrl, e as getStripePublishableKey, d as getTrackablePages } from './config-YyhFHxkU.mjs'; export { Q as QuestionnaireField, a as QuestionnaireFieldType, b as QuestionnaireOption, W as WaitlistConfig, c as configureWaitlist, g as getWaitlistConfig } from './waitlist.config-kPfjImle.mjs'; import { R as RbacMatrix } from './RbacTypes-BTbr27Ew.mjs'; export { a as ACTION_TYPES, A as ActionType, C as COMPANY_ADMINISTRATOR_ROLE_ID, c as PermToken, P as PermissionValue, b as PermissionsMap, d as RbacModuleBlock } from './RbacTypes-BTbr27Ew.mjs'; import 'react'; import 'zod'; import '@blocknote/core'; import 'sonner'; import '@simplewebauthn/browser'; import 'd3'; import 'lucide-react'; import './help-content-config.interface-C5ESIod9.mjs'; type RegistrationMode = "open" | "closed" | "waitlist"; interface LoginConfig { discordClientId?: string; googleClientId?: string; useInternalAuth?: boolean; allowRegistration?: boolean; registrationMode?: RegistrationMode; } declare function configureLogin(params: LoginConfig): void; /** * Role ID configuration interface * Apps provide their role IDs via configureRoles() */ interface RoleIdConfig { Administrator: string; CompanyAdministrator: string; [key: string]: string; } /** * Configure role IDs for the library * Call this at app startup to provide role ID constants * * @example * ```typescript * import { configureRoles } from "@carlonicora/nextjs-jsonapi"; * import { RoleId } from "@phlow/shared"; * * configureRoles(RoleId); * ``` */ declare function configureRoles(roleId: RoleIdConfig): void; /** * Get configured role IDs * @throws Error if roles not configured */ declare function getRoleId(): RoleIdConfig; /** * Check if roles have been configured */ declare function isRolesConfigured(): boolean; /** * Token parameters for authentication cookie management */ interface TokenParams { token?: string; refreshToken?: string; userId?: string; companyId?: string; roles?: string[]; features?: string[]; modules?: { id: string; permissions: { create: boolean | string; read: boolean | string; update: boolean | string; delete: boolean | string; }; }[]; } /** * Token handler interface for dependency injection * Apps must provide implementations of these functions via configureAuth() */ interface TokenHandler { updateToken: (params: TokenParams) => Promise; removeToken: () => Promise; } /** * Configure authentication token handling * Call this at app startup to provide Server Actions for cookie management * * @example * ```typescript * import { configureAuth } from "@carlonicora/nextjs-jsonapi"; * import { updateToken, removeToken } from "@/features/auth/utils/AuthCookies"; * * configureAuth({ updateToken, removeToken }); * ``` */ declare function configureAuth(handler: TokenHandler): void; /** * Internal getter for AuthService to access the token handler * @internal */ declare function getTokenHandler(): TokenHandler | null; /** * Configuration interface for frontend referral feature. */ interface ReferralConfig { /** * Whether the referral feature is enabled. * When false, components render nothing and hooks return null. * @default false */ enabled?: boolean; /** * Name of the cookie used to store referral codes. * @default "referral_code" */ cookieName?: string; /** * Number of days the referral cookie is valid. * @default 30 */ cookieDays?: number; /** * Query parameter name for referral code in URL. * @default "ref" */ urlParamName?: string; /** * Base URL for referral links. * @default window.location.origin (client-side only) */ referralUrlBase?: string; /** * Path to append to base URL for referral links. * @default "/" */ referralPath?: string; } /** * Configure referral feature settings. * Call this at app startup to enable and configure referral functionality. * * @example * ```typescript * import { configureReferral } from "@carlonicora/nextjs-jsonapi"; * * configureReferral({ * enabled: process.env.NEXT_PUBLIC_REFERRAL_ENABLED === 'true', * cookieDays: 30, * }); * ``` */ declare function configureReferral(config: ReferralConfig): void; /** * Get the current referral configuration. * @internal */ declare function getReferralConfig(): Required; /** * Check if referral feature is enabled. */ declare function isReferralEnabled(): boolean; interface PermissionMappingInterface extends ApiDataInterface { get roleId(): string; get moduleId(): string; get permissions(): { create?: boolean | string; read?: boolean | string; update?: boolean | string; delete?: boolean | string; }; } declare class PermissionMapping extends AbstractApiData implements PermissionMappingInterface { private _roleId?; private _moduleId?; private _permissions?; get roleId(): string; get moduleId(): string; get permissions(): { create?: boolean | string; read?: boolean | string; update?: boolean | string; delete?: boolean | string; }; rehydrate(data: JsonApiHydratedDataInterface): this; } interface ModulePathsInterface extends ApiDataInterface { get moduleId(): string; get paths(): string[]; } declare class ModulePaths extends AbstractApiData implements ModulePathsInterface { private _moduleId?; private _paths?; get moduleId(): string; get paths(): string[]; rehydrate(data: JsonApiHydratedDataInterface): this; } /** * Input shape accepted by `RbacMatrixModel.createJsonApi()` for a PUT request * to the dev matrix endpoint. */ interface RbacMatrixInput { matrix: RbacMatrix; roleNames: Record; moduleNames: Record; outputPath: string; } /** * Frontend model for the dev-only `rbac-matrix` JSON:API resource. * * Backend contract (see `rbac-dev.controller.ts`): * - `GET /_dev/rbac/matrix` → `{ data: { type: "rbac-matrix", id: "singleton", * attributes: { matrix } } }` * - `PUT /_dev/rbac/matrix` body: `{ data: { type: "rbac-matrix", attributes: * { matrix, roleNames, moduleNames, outputPath } } }` * → `{ data: { type: "rbac-matrix", id: "singleton", attributes: { bytesWritten, path } } }` * * The resource is a singleton (`id: "singleton"`) so there is no collection * listing; the "read" and "write" shapes share a single model with optional * fields populated depending on which endpoint produced the response. */ declare class RbacMatrixModel extends AbstractApiData { private _matrix?; private _modulePaths?; private _bytesWritten?; private _path?; /** The RBAC matrix object (populated after a GET). */ get matrix(): RbacMatrix | undefined; /** * UUID-keyed map of each module's known BFS relationship paths (populated * after a GET). Fed to the permission picker as scope suggestions. */ get modulePaths(): Record | undefined; /** Bytes written to the permissions.ts file (populated after a PUT). */ get bytesWritten(): number | undefined; /** Resolved absolute output path (populated after a PUT). */ get path(): string | undefined; rehydrate(data: JsonApiHydratedDataInterface): this; createJsonApi(data: RbacMatrixInput): any; } /** * RbacService — fetches RBAC configuration for the admin UI. * * Declarative-matrix methods (`fetchMatrix`, `saveMatrix`) talk to the * dev-only endpoints added in * `packages/nestjs-neo4jsonapi/.../rbac-dev.controller.ts`. The controller * speaks JSON:API (singleton resource with `type: "rbac-matrix"`, `id: * "singleton"`), so these methods go through the standard `callApi()` * pipeline like every other service in the codebase. * * The backend only registers these routes when `devMode` is enabled on * `RbacModule.register` (see `apps/api/src/features/features.modules.ts`). * In production the routes return 404; callers should guard with a dev-mode * check. */ declare class RbacService extends AbstractService { /** * Fetch the current RBAC matrix plus each module's known BFS relationship * paths (used by the permission picker as scope suggestions). * * Dev-only endpoint — see class header. */ static fetchMatrix(): Promise<{ matrix: RbacMatrix; modulePaths: Record; }>; /** * Persist a matrix back to the declarative `permissions.ts` file. * * The backend serializes the matrix to formatted TypeScript using the * provided `roleNames` / `moduleNames` lookup tables (so the emitted file * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes * it to `outputPath` (absolute, or relative to the repo root). * * Dev-only endpoint — see class header. */ static saveMatrix(args: { matrix: RbacMatrix; roleNames: Record; moduleNames: Record; outputPath: string; }): Promise<{ bytesWritten: number; path: string; }>; } export { AbstractApiData, AbstractService, ApiDataInterface, JsonApiHydratedDataInterface, type LoginConfig, ModulePaths, type ModulePathsInterface, PermissionMapping, type PermissionMappingInterface, RbacMatrix, type RbacMatrixInput, RbacMatrixModel, RbacService, type ReferralConfig, type RoleIdConfig, type TokenHandler, type TokenParams, configureAuth, configureLogin, configureReferral, configureRoles, getReferralConfig, getRoleId, getTokenHandler, isReferralEnabled, isRolesConfigured };