import type { CamelizeKeys, DbDatabase, DbRow } from "@riverbankcms/db";
export type { AccessPolicyContract, AccessPolicyTag, CreateMediaAssetBody, EntitledCustomerAccessScopeContract, FileKindContract, FileKindTag, FileUseContract, FileUseTag, ImageFileFormat, MediaAssetResponse, MediaAssetFileFilterContract, MediaBulkDeleteAssetFailure, MediaBulkDeleteResponse, MediaClassifyJobResponse, MediaJobSummaryResponse, MediaLabelSummary, MediaSettingsResponse, RenderableFileKindTag, StorageClass, UploadIntentContract, UploadIntentTag, } from "./media";
export type { AnalyticsPreset, AnalyticsReferrer, AnalyticsReportFilters, AnalyticsReportQuery, AnalyticsReportResponse, AnalyticsSeriesPoint, AnalyticsTopPage, AnalyticsTotals, } from "./analytics";
export type { AIChatMessage, AiBriefTurn, JsonPrimitive, JsonValue, MediaUsageCheckItem, MediaUsageCheckResponse, MediaUsageLocation, } from "./shared-contracts";
export type * from "./accessAdmin";
export type * from "./aiEndpoints";
export type * from "./apiEndpointTypes";
export type * from "./bookingAdjustments";
export type * from "./bookingConfig";
export type * from "./bookingVerticals";
export type * from "./bookingManagementEndpoints";
export type * from "./bookingOperations";
export type * from "./bookingRecords";
export type * from "./commercePortalEndpoints";
export type * from "./communications";
export type * from "./contentRuntime";
export type * from "./courses";
export type * from "./publicExperienceEndpoints";
export type * from "./sdkContracts";
export type * from "./siteInfrastructure";
export type * from "./siteGeneration";
export type * from "./siteManagementEndpoints";
export type * from "./siteOnboarding";
export type * from "./siteOperations";
export type * from "./siteAssets";
export type * from "./sitePlatformEndpoints";
export type * from "./siteRuntimeEndpoints";
export { FLEXIBLE_BALANCE_ADMIN_ACTION_SOURCES } from "./siteOperations";
export type { AppointmentBlackout, AvailabilityRule, CreateBlackoutResponse, CreateBlackoutRequest, DeleteBlackoutResponse, GetAvailableSlotsQuery, GetAvailableSlotsResponse, ListAvailabilityRulesResponse, ListBlackoutsResponse, SetWeeklyAvailabilityIssue, SetWeeklyAvailabilityRequest, SetWeeklyAvailabilityResponse, TimeSlot, WeeklyAvailabilityWindowInput, } from "./availability";
export type { CalendarConnectionStatus, CalendarInfo, CalendarPreferences, CalendarStatusResponse, DisconnectCalendarResponse, UpdateCalendarPreferencesRequest, UpdateCalendarPreferencesResponse, } from "./calendar";
export type { AppointmentRecord, BookingQuestionFormSummary, BookingQuestionRequirementScope, BookingQuestionsRequirementConfig, BookingCustomerRecord, BookingRequirementConfigRequest, BookingRequirementConfigResponse, BookingRequirementTargetType, BookingRequirementValidityPolicy, ConsentRequirementConfig, CreateAppointmentRequest, CreateAppointmentResponse, } from "./bookings";
export type { AiPatchApplyResponse, AiPatchBlockSetOp, AiPatchDryRunResponse, AiPatchOp, AiPatchPageMetaOp, AiPatchRequest, } from "./aiPatch";
export type { AffectedOccurrence, AiDesignerThemePatchOp, AllowedField, ApplyAiDesignerPageOpsRequest, ApplyAiDesignerPageOpsResponse, ApplyAiDesignerThemePatchRequest, ApplyAiDesignerThemePatchResponse, AiPlaygroundApplyRequest, AiPlaygroundApplyResponse, BlockContext, DebugArtifact, DebugArtifacts, ModifiedOccurrence, MultiPagePatchEnvelope, MultiPageUpdateResponse, PageBlock, PageContext, PageConversionAttempt, PageConversionFailure, PageConversionResult, PageConversionSuccess, PageConvertJob, PageConvertJobEvent, PageConvertJobEventsResponse, PageConvertJobEventType, PageConvertJobGetResponse, PageConvertJobRunResponse, PageConvertJobsCreateRequest, PageConvertJobsCreateResponse, PageConvertJobsListResponse, PageConvertJobStatus, PageConverterOutput, PageConvertResponse, PlaygroundProposeRequest, RegenerationSummary, Rfc6902PatchOp, SchedulePreviewRequest, SchedulePreviewResponse, StreamEvent, } from "./aiPlayground";
export type { ApplySeoChangesRequest, ApplySeoChangesResponse, PerformanceOverviewQuery, PerformanceOverviewResponse, PerformanceRangePreset, SeoOverviewQuery, SeoOverviewResponse, SeoOverviewTimePoint, SeoRangePreset, SeoSearchPagesQuery, SeoSearchPagesResponse, SeoSearchQueriesQuery, SeoSearchQueriesResponse, SeoSearchSummary, } from "./seo";
export type { CheckRedirectQuery, CheckRedirectResponse, CreateRedirectRuleRequest, CreateRedirectRuleResponse, DeleteRedirectRuleResponse, ListRedirectRulesResponse, RedirectRuleRecord, } from "./redirects";
export type { ApplyContentTemplateAddonRequest, ContentTemplateAddonSummary, ContentAddonDefinition, ContentTemplateBlockSummary, ContentTemplateDetailsResponse, ContentTemplateSummary, ContentTypeTemplateSummary, ContentTypeRoutingInfo, ContentTypeRoutingSubroute, ContentTypeRecord, CreateTemplateBlockRequest, ContentTypeSummary, CreateContentTypeRequest, CreateContentTypeResponse, DeleteContentTypeResponse, DuplicateContentTypeResponse, GetTransformsResponse, ListContentTypesResponse, PublicContentTypeFieldMeta, PublicContentTypeMeta, ReorderTemplateBlocksRequest, SerializedContentTypeSummary, TransformMetadata, UpdateContentTemplateBlockBindingsRequest, UpdateContentTemplateBlockRequest, UpdateContentTypeRequest, UpdateContentTypeResponse, } from "./contentTypes";
export type { CartLinkLabelConfig, CartLinkPayload, EntryLinkPayload, InternalLinkRoutablePayload, LinkPayload, NavigationLinkInput, PageLinkPayload, PortalLinkPayload, RoutableContentItem, SitemapRouteItem, } from "./navigation/types";
export type { SiteBannerAnnouncementRole, SiteBannerCta, SiteBannerScope, SiteBannerSettingsPayload, SiteBannerSettingsResponse, SiteBannerTone, } from "./siteBanner";
export type { SitePageBlock, SitePagePayload } from "./sitePages";
export type { SiteAnalyticsCookieBannerCopyOverrides, SiteAnalyticsSettingsPayload, SiteAnalyticsSettingsResponse, } from "./siteAnalytics";
export type { SiteLegalJurisdiction, SiteLegalProfilePayload, SensitiveClientRecordsConfirmationKey, SensitiveClientRecordsMode, SensitiveClientRecordsRetentionProfile, SensitiveClientRecordsSettings, SensitiveClientRecordsUpdatePayload, SitePrivacyPolicyCapabilities, SitePrivacyPolicyDocument, SitePrivacySettings, SitePrivacySettingsPayload, SitePrivacySettingsResponse, SiteRuntimePrivacyPolicy, SitePrivacyPolicySection, } from "./privacyPolicy";
export type { MaintenanceSettingsPayload, MaintenanceSettingsResponse, SiteBusinessAddressPayload, SiteBusinessAddressResponse, SiteDeploymentMode, SiteFooterBlocksEditorBlock, SiteFooterBlocksEditorResponse, SiteGeneralSettingsPayload, SiteGeneralSettingsResponse, SiteLayoutResolvedPayload, SiteLayoutSettingsPayload, SiteLayoutSettingsResponse, UpdateSiteDeploymentModePayload, UpdateSiteDeploymentModeResponse, UpdateSiteFooterBlocksPayload, UpdateSiteFooterBlocksResponse, } from "./siteSettings";
export type { BillingCheckoutRequest, BillingCheckoutResponse, BillingStatusResponse, BillingSummaryResponse, SiteBillingCheckoutResponse, SiteBillingCostResponse, StripeAutomaticTaxIssue, StripeAutomaticTaxReadiness, StripeAutomaticTaxStatus, StripeConnectDisconnectResponse, StripeConnectRestrictions, StripeConnectStartResponse, StripeConnectStatusResponse, UpdateStripeAutomaticTaxRequest, } from "./billing";
export type { AiGenerateSiteEntityType, AiGenerateSitePrimaryCta, AiGenerateSiteRequest, AiGenerateSiteResponse, } from "./siteGeneration";
export { SITE_ROLE_DISPLAY_ORDER, SITE_ROLE_PERMISSION_LEVEL } from "./siteMembers";
export type { SiteRole } from "./siteMembers";
import type { HTTPMethod, ApiResponseKind, ApiAuthRequirement } from "./common/types";
export type { HTTPMethod, ApiResponseKind, ApiAuthRequirement };
export type { AdminProfileRole, AdminRoleMutationResponse, RevokeAdminRoleRequest, StartImpersonationRequest, StartImpersonationResponse, StopImpersonationRequest, StopImpersonationResponse, UpsertAdminRoleRequest, } from "./admin/types";
import type { API_ENDPOINTS } from "./endpoints";
import type { AiAndLaunchReadinessAPIEndpointDefinitions, AiAPIEndpointName, AiAPIEndpoints, LaunchReadinessAPIEndpointName, LaunchReadinessAPIEndpoints } from "./aiEndpoints";
import type { BookingManagementAPIEndpoints } from "./bookingManagementEndpoints";
import type { CommercePortalAPIEndpoints } from "./commercePortalEndpoints";
import type { PublicExperienceAPIEndpoints } from "./publicExperienceEndpoints";
import type { SeoEndpointDefinitions } from "./seoEndpoints";
import type { SiteManagementAPIEndpoints } from "./siteManagementEndpoints";
import type { SitePlatformAPIEndpoints } from "./sitePlatformEndpoints";
import type { SiteRuntimeAPIEndpoints } from "./siteRuntimeEndpoints";
type TableName = keyof DbDatabase["public"]["Tables"];
export type DTOType<K extends TableName> = Partial<CamelizeKeys<DbRow<K>>>;
type APIEndpointsMonolith = AiAndLaunchReadinessAPIEndpointDefinitions & SeoEndpointDefinitions & SiteManagementAPIEndpoints & PublicExperienceAPIEndpoints & SiteRuntimeAPIEndpoints & SitePlatformAPIEndpoints & BookingManagementAPIEndpoints & CommercePortalAPIEndpoints;
type ComposeEndpointMaps<Maps extends readonly object[], Acc extends object = {}> = Maps extends readonly [
    infer Head extends object,
    ...infer Tail extends readonly object[]
] ? [Extract<keyof Acc, keyof Head>] extends [never] ? ComposeEndpointMaps<Tail, Acc & Head> : never : Acc;
type SiteMembersAPIEndpointName = "listSiteMembers" | "inviteSiteMember" | "updateSiteMemberRole" | "removeSiteMember" | "revokeSiteInvitation" | "transferSiteOwnership" | "acceptSiteInvitation";
type SeoAPIEndpointName = "getSeoOverview" | "getSeoPages" | "exportSeoPagesCsv" | "getSeoQueries" | "exportSeoQueriesCsv" | "getPerformanceOverview" | "applySeoChanges";
type RedirectsAPIEndpointName = "checkRedirect" | "listRedirectRules" | "createRedirectRule" | "deleteRedirectRule";
type AvailabilityAPIEndpointName = "listAvailabilityRules" | "setWeeklyAvailability" | "listBlackouts" | "createBlackout" | "deleteBlackout" | "getAvailableSlots";
type CalendarAPIEndpointName = "getCalendarStatus" | "updateCalendarPreferences" | "disconnectCalendar";
type ContentTypesAPIEndpointName = "listContentTypes" | "createContentType" | "updateContentType" | "deleteContentType" | "duplicateContentType";
type MediaAPIEndpointName = "createMediaAsset" | "mediaList" | "mediaProductFileList" | "mediaGet" | "mediaUpdate" | "mediaCanonicalCrop" | "mediaAssignIdentifier" | "mediaDelete" | "mediaBulkDelete" | "mediaUsageCheck" | "mediaGetSignedUrl" | "createMediaUploadUrl" | "mediaUpload" | "getMediaLabels" | "getMediaSettings" | "updateMediaSettings" | "mediaSearch" | "classifyMediaAsset" | "classifyMediaBatch" | "enqueueMediaClassifyJob" | "runMediaClassifyJob" | "runAllMediaClassifyJobs" | "mediaJobsStatus";
type ComposedDomainEndpointNames = AiAPIEndpointName | LaunchReadinessAPIEndpointName | SiteMembersAPIEndpointName | SeoAPIEndpointName | RedirectsAPIEndpointName | AvailabilityAPIEndpointName | CalendarAPIEndpointName | ContentTypesAPIEndpointName | MediaAPIEndpointName;
export type SiteMembersAPIEndpoints = Pick<APIEndpointsMonolith, SiteMembersAPIEndpointName>;
export type SeoAPIEndpoints = Pick<APIEndpointsMonolith, SeoAPIEndpointName>;
export type RedirectsAPIEndpoints = Pick<APIEndpointsMonolith, RedirectsAPIEndpointName>;
export type AvailabilityAPIEndpoints = Pick<APIEndpointsMonolith, AvailabilityAPIEndpointName>;
export type CalendarAPIEndpoints = Pick<APIEndpointsMonolith, CalendarAPIEndpointName>;
export type ContentTypesAPIEndpoints = Pick<APIEndpointsMonolith, ContentTypesAPIEndpointName>;
export type MediaAPIEndpoints = Pick<APIEndpointsMonolith, MediaAPIEndpointName>;
type RemainingAPIEndpoints = Omit<APIEndpointsMonolith, ComposedDomainEndpointNames>;
type DomainAPIEndpointMaps = [
    AiAPIEndpoints,
    LaunchReadinessAPIEndpoints,
    SiteMembersAPIEndpoints,
    SeoAPIEndpoints,
    RedirectsAPIEndpoints,
    AvailabilityAPIEndpoints,
    CalendarAPIEndpoints,
    ContentTypesAPIEndpoints,
    MediaAPIEndpoints
];
type ComposedAPIEndpointMaps = [...DomainAPIEndpointMaps, RemainingAPIEndpoints];
export type APIEndpoints = ComposeEndpointMaps<ComposedAPIEndpointMaps>;
export type GetEndpoint<T extends keyof APIEndpoints> = APIEndpoints[T];
export type GetMethodEndpoint<T extends keyof APIEndpoints> = APIEndpoints[T] extends {
    method: "GET";
} ? APIEndpoints[T] : never;
export type PostMethodEndpoint<T extends keyof APIEndpoints> = APIEndpoints[T] extends {
    method: "POST";
} ? APIEndpoints[T] : never;
export type PutMethodEndpoint<T extends keyof APIEndpoints> = APIEndpoints[T] extends {
    method: "PUT";
} ? APIEndpoints[T] : never;
type RequiredKeys<T> = {
    [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
}[keyof T];
type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
type IsNonEmptyQuery<T> = [T] extends [never] ? false : T extends undefined ? false : keyof T extends never ? false : true;
type QueryValueToStringParam<T> = Exclude<T, undefined> extends readonly (infer TValue)[] ? QueryValueToStringParam<TValue>[] : Exclude<T, undefined> extends (infer TValue)[] ? QueryValueToStringParam<TValue>[] : string;
type QueryToStringParams<T> = {
    [K in keyof T]: QueryValueToStringParam<T[K]>;
};
type ExtractPathParamNames<TPath extends string> = TPath extends `${string}{${infer Param}}${infer Rest}` ? Param | ExtractPathParamNames<Rest> : never;
type EndpointPath<E extends keyof APIEndpoints> = E extends keyof typeof API_ENDPOINTS ? (typeof API_ENDPOINTS)[E]["path"] : never;
type PathParams<E extends keyof APIEndpoints> = ExtractPathParamNames<EndpointPath<E>> extends infer TParam ? [TParam] extends [never] ? {} : {
    [K in Extract<TParam, string>]: string;
} : {};
type QueryParams<E extends keyof APIEndpoints> = IsNonEmptyQuery<APIEndpoints[E]["query"]> extends false ? {} : QueryToStringParams<APIEndpoints[E]["query"]>;
type HasPathParams<E extends keyof APIEndpoints> = keyof PathParams<E> extends never ? false : true;
type ParamsPart<E extends keyof APIEndpoints> = HasPathParams<E> extends true ? {
    params: PathParams<E> & QueryParams<E>;
} : IsNonEmptyQuery<APIEndpoints[E]["query"]> extends false ? {
    params?: Record<string, string>;
} : HasRequiredKeys<APIEndpoints[E]["query"]> extends true ? {
    params: QueryParams<E>;
} : {
    params?: QueryParams<E>;
};
export type APICallParams<E extends keyof APIEndpoints> = APIEndpoints[E] extends {
    method: "GET";
} ? {
    endpoint: E;
    body?: APIEndpoints[E]["body"];
    options?: RequestInit;
} & ParamsPart<E> : APIEndpoints[E] extends {
    method: "POST" | "PUT" | "PATCH";
} ? {
    endpoint: E;
    body: APIEndpoints[E]["body"];
    options?: RequestInit;
} & ParamsPart<E> : {
    endpoint: E;
    body?: APIEndpoints[E]["body"];
    options?: RequestInit;
} & ParamsPart<E>;
type EndpointMethod<E extends keyof APIEndpoints> = E extends keyof typeof API_ENDPOINTS ? (typeof API_ENDPOINTS)[E]["method"] : HTTPMethod;
type EndpointBody<E extends keyof APIEndpoints> = APIEndpoints[E]["body"];
type StrictBodyPart<E extends keyof APIEndpoints> = EndpointMethod<E> extends "GET" ? {
    body?: never;
} : [EndpointBody<E>] extends [never | undefined] ? {
    body?: never;
} : {
    body: NonNullable<EndpointBody<E>>;
};
/**
 * Strict variant of APICallParams that uses endpoint metadata (method + body type)
 * to enforce whether `body` is required/forbidden.
 *
 * Intended for new code. Existing code can continue using APICallParams until migrated.
 */
export type APICallParamsStrict<E extends keyof APIEndpoints> = {
    endpoint: E;
    options?: RequestInit;
} & ParamsPart<E> & StrictBodyPart<E>;
