import { Knex } from 'knex'; import { Logger } from 'pino'; import { API_EXTENSION_TYPES, APP_EXTENSION_TYPES, BUNDLE_EXTENSION_TYPES, EXTENSION_TYPES, HYBRID_EXTENSION_TYPES, LOCAL_TYPES, NESTED_EXTENSION_TYPES } from '../constants'; import { Accountability } from './accountability'; import { InterfaceConfig } from './interfaces'; import { DisplayConfig } from './displays'; import { LayoutConfig } from './layouts'; import { ModuleConfig } from './modules'; import { PanelConfig } from './panels'; import { DeepPartial } from './misc'; import { Field } from './fields'; import { Relation } from './relations'; import { Collection } from './collection'; import { SchemaOverview } from './schema'; import { OperationAppConfig } from './operations'; import { z } from 'zod'; export type AppExtensionType = (typeof APP_EXTENSION_TYPES)[number]; export type ApiExtensionType = (typeof API_EXTENSION_TYPES)[number]; export type HybridExtensionType = (typeof HYBRID_EXTENSION_TYPES)[number]; export type BundleExtensionType = (typeof BUNDLE_EXTENSION_TYPES)[number]; export type ExtensionType = (typeof EXTENSION_TYPES)[number]; export type NestedExtensionType = (typeof NESTED_EXTENSION_TYPES)[number]; declare const SplitEntrypoint: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; export type SplitEntrypoint = z.infer; type ExtensionBase = { path: string; name: string; version?: string; host?: string; local: boolean; }; export type AppExtension = ExtensionBase & { type: AppExtensionType; entrypoint: string; }; export type ApiExtension = ExtensionBase & { type: ApiExtensionType; entrypoint: string; }; export type HybridExtension = ExtensionBase & { type: HybridExtensionType; entrypoint: SplitEntrypoint; }; export type BundleExtension = ExtensionBase & { type: 'bundle'; entrypoint: SplitEntrypoint; entries: { type: NestedExtensionType; name: string; }[]; }; export type Extension = AppExtension | ApiExtension | HybridExtension | BundleExtension; export declare const ExtensionOptionsBundleEntry: z.ZodUnion<[z.ZodObject<{ type: z.ZodUnion<[z.ZodEnum<["interface", "display", "layout", "module", "panel"]>, z.ZodEnum<["hook", "endpoint"]>]>; name: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; name: z.ZodString; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { name: string; type: "operation"; source: { api: string; app: string; }; }, { name: string; type: "operation"; source: { api: string; app: string; }; }>]>; declare const ExtensionOptions: z.ZodIntersection; }, "strip", z.ZodTypeAny, { host: string; hidden?: boolean | undefined; }, { host: string; hidden?: boolean | undefined; }>, z.ZodUnion<[z.ZodObject<{ type: z.ZodUnion<[z.ZodEnum<["interface", "display", "layout", "module", "panel"]>, z.ZodEnum<["hook", "endpoint"]>]>; path: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }, { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; path: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }, { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }>, z.ZodObject<{ type: z.ZodLiteral<"bundle">; path: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; entries: z.ZodArray, z.ZodEnum<["hook", "endpoint"]>]>; name: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; name: z.ZodString; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { name: string; type: "operation"; source: { api: string; app: string; }; }, { name: string; type: "operation"; source: { api: string; app: string; }; }>]>, "many">; }, "strip", z.ZodTypeAny, { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }, { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }>]>>; export type ExtensionOptions = z.infer; export type ExtensionOptionsBundleEntry = z.infer; export declare const ExtensionOptionsBundleEntries: z.ZodArray, z.ZodEnum<["hook", "endpoint"]>]>; name: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; name: z.ZodString; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { name: string; type: "operation"; source: { api: string; app: string; }; }, { name: string; type: "operation"; source: { api: string; app: string; }; }>]>, "many">; export type ExtensionOptionsBundleEntries = z.infer; export declare const ExtensionManifest: z.ZodObject<{ name: z.ZodString; version: z.ZodString; dependencies: z.ZodOptional>; "directus:extension": z.ZodIntersection; }, "strip", z.ZodTypeAny, { host: string; hidden?: boolean | undefined; }, { host: string; hidden?: boolean | undefined; }>, z.ZodUnion<[z.ZodObject<{ type: z.ZodUnion<[z.ZodEnum<["interface", "display", "layout", "module", "panel"]>, z.ZodEnum<["hook", "endpoint"]>]>; path: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }, { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; path: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }, { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }>, z.ZodObject<{ type: z.ZodLiteral<"bundle">; path: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; entries: z.ZodArray, z.ZodEnum<["hook", "endpoint"]>]>; name: z.ZodString; source: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }, { name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; }>, z.ZodObject<{ type: z.ZodEnum<["operation"]>; name: z.ZodString; source: z.ZodObject<{ app: z.ZodString; api: z.ZodString; }, "strip", z.ZodTypeAny, { api: string; app: string; }, { api: string; app: string; }>; }, "strip", z.ZodTypeAny, { name: string; type: "operation"; source: { api: string; app: string; }; }, { name: string; type: "operation"; source: { api: string; app: string; }; }>]>, "many">; }, "strip", z.ZodTypeAny, { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }, { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }>]>>; }, "strip", z.ZodTypeAny, { "directus:extension": ({ host: string; hidden?: boolean | undefined; } & { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }) | ({ host: string; hidden?: boolean | undefined; } & { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }) | ({ host: string; hidden?: boolean | undefined; } & { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }); name: string; version: string; dependencies?: Record | undefined; }, { "directus:extension": ({ host: string; hidden?: boolean | undefined; } & { type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; path: string; source: string; }) | ({ host: string; hidden?: boolean | undefined; } & { type: "operation"; path: { api: string; app: string; }; source: { api: string; app: string; }; }) | ({ host: string; hidden?: boolean | undefined; } & { entries: ({ name: string; type: "interface" | "display" | "layout" | "module" | "panel" | "hook" | "endpoint"; source: string; } | { name: string; type: "operation"; source: { api: string; app: string; }; })[]; type: "bundle"; path: { api: string; app: string; }; }); name: string; version: string; dependencies?: Record | undefined; }>; export type ExtensionManifest = z.infer; export type AppExtensionConfigs = { interfaces: InterfaceConfig[]; displays: DisplayConfig[]; layouts: LayoutConfig[]; modules: ModuleConfig[]; panels: PanelConfig[]; operations: OperationAppConfig[]; }; export type ApiExtensionContext = { services: any; exceptions: any; database: Knex; env: Record; logger: Logger; getSchema: (options?: { accountability?: Accountability; database?: Knex; }) => Promise; }; export type ExtensionOptionsContext = { collection: string | undefined; editing: string; field: DeepPartial; relations: { m2o: DeepPartial | undefined; m2a?: DeepPartial | undefined; o2m: DeepPartial | undefined; }; collections: { junction: DeepPartial[]; }> | undefined; related: DeepPartial[]; }> | undefined; }; fields: { corresponding: DeepPartial | undefined; junctionCurrent: DeepPartial | undefined; junctionRelated: DeepPartial | undefined; sort: DeepPartial | undefined; }; items: Record[]>; localType: (typeof LOCAL_TYPES)[number]; autoGenerateJunctionRelation: boolean; saving: boolean; }; export type ExtensionInfo = Omit | Omit | Omit | Omit; export {}; //# sourceMappingURL=extensions.d.ts.map