@dyrected/core 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -136,12 +136,15 @@ interface PaginatedResult<T = Record<string, any>> {
136
136
  */
137
137
  interface FileData {
138
138
  filename: string;
139
+ originalFilename?: string;
139
140
  filesize?: number;
140
141
  mimeType: string;
141
142
  /** Public URL of the stored file. */
142
143
  url: string;
143
144
  width?: number;
144
145
  height?: number;
146
+ aspectRatio?: number;
147
+ folderId?: string | null;
145
148
  focalPoint?: {
146
149
  x: number;
147
150
  y: number;
@@ -152,6 +155,7 @@ interface FileData {
152
155
  type?: "upload" | "external";
153
156
  provider?: string;
154
157
  provider_metadata?: unknown;
158
+ metadata?: Record<string, unknown>;
155
159
  [key: string]: unknown;
156
160
  }
157
161
 
@@ -1992,6 +1996,39 @@ interface DatabaseAdapter {
1992
1996
  * and `afterDelete` hooks where the full {@link DatabaseAdapter} is provided.
1993
1997
  */
1994
1998
  type ReadonlyDatabaseAdapter = Pick<DatabaseAdapter, "find" | "findOne" | "getGlobal" | "aggregate">;
1999
+ /**
2000
+ * Options for dynamic on-the-fly image transformations.
2001
+ */
2002
+ interface ImageTransformOptions {
2003
+ /** Target width in pixels. */
2004
+ width?: number;
2005
+ /** Target height in pixels. */
2006
+ height?: number;
2007
+ /** Aspect ratio string (e.g. "16:9", "1:1") or numeric ratio (e.g. 1.777). */
2008
+ aspectRatio?: string | number;
2009
+ /** Crop strategy. */
2010
+ crop?: "fill" | "fit" | "limit" | "pad" | "thumb" | "scale" | "cover" | "contain";
2011
+ /** Gravity / focal anchor for cropping. */
2012
+ gravity?: "auto" | "face" | "center" | "focal" | "xy_center" | string;
2013
+ /** Explicit focal point percentage coordinates (0.0 to 1.0). */
2014
+ focalPoint?: {
2015
+ x: number;
2016
+ y: number;
2017
+ };
2018
+ /** Output quality (1-100 or 'auto'). */
2019
+ quality?: number | "auto" | "auto:best" | "auto:good" | "auto:eco";
2020
+ /** Target image format. */
2021
+ format?: "auto" | "webp" | "avif" | "png" | "jpg" | "jpeg";
2022
+ /** Blur radius for placeholders/effects. */
2023
+ blur?: number;
2024
+ /** Rotation angle in degrees (e.g. 90, 180, 270). */
2025
+ rotate?: number;
2026
+ /** Device pixel ratio multiplier. */
2027
+ dpr?: number | "auto";
2028
+ /** Named transformation preset key. */
2029
+ key?: string;
2030
+ [key: string]: unknown;
2031
+ }
1995
2032
  /**
1996
2033
  * The interface every storage adapter must implement.
1997
2034
  *
@@ -2014,9 +2051,10 @@ interface StorageAdapter {
2014
2051
  delete(args: {
2015
2052
  filename: string;
2016
2053
  }): Promise<void>;
2017
- /** Return the public URL for a stored file. */
2054
+ /** Return the public URL for a stored file, with optional dynamic transformations. */
2018
2055
  getURL(args: {
2019
2056
  filename: string;
2057
+ transform?: ImageTransformOptions;
2020
2058
  }): string;
2021
2059
  /**
2022
2060
  * Retrieve the file's raw bytes and MIME type for serving via the API.
@@ -2247,8 +2285,8 @@ interface FieldAdminOnChangeHookArgs<TValue = unknown> {
2247
2285
  docs?: Record<string, unknown>[];
2248
2286
  /** Current authenticated user. */
2249
2287
  user?: unknown;
2250
- /** Imperative setter for async or derived updates. */
2251
- setValue: (value: unknown) => void;
2288
+ /** Imperative setter for current field or sibling fields. */
2289
+ setValue: (nameOrVal: string | unknown, maybeVal?: unknown) => void;
2252
2290
  }
2253
2291
  type FieldAdminOnChangeHook<TValue = unknown> = (args: FieldAdminOnChangeHookArgs<TValue>) => unknown;
2254
2292
  type FieldAdminHooks<TValue> = {
@@ -2593,6 +2631,10 @@ type JoinFieldAdmin = {
2593
2631
  showCreateButton?: boolean;
2594
2632
  /** Whether the join field should show the "View all" action in the Admin UI. Defaults to `true`. */
2595
2633
  showViewButton?: boolean;
2634
+ /** Display layout for the join list: 'list' (default) or 'table'. */
2635
+ layout?: "list" | "table";
2636
+ /** Columns to display when layout is 'table'. */
2637
+ columns?: string[];
2596
2638
  };
2597
2639
  interface UrlLinkValue {
2598
2640
  /** Whether the link is a custom URL or a reference to an internal document. */
@@ -2972,6 +3014,15 @@ interface DyrectedConfig<TUser extends AuthenticatedUser = AuthenticatedUser> {
2972
3014
  * @see ImageService
2973
3015
  */
2974
3016
  image?: ImageService;
3017
+ /**
3018
+ * Media management, dynamic transformations, and transformation preset configurations.
3019
+ */
3020
+ media?: {
3021
+ /** Whether to restrict dynamic transformations to registered preset keys in production. */
3022
+ restrictTransforms?: boolean;
3023
+ /** Named transformation presets available via `?key=name`. */
3024
+ presets?: Record<string, ImageTransformOptions>;
3025
+ };
2975
3026
  /**
2976
3027
  * Runtime logger configuration. Accepts either logger options/destination or
2977
3028
  * a fully-instantiated Pino logger.
@@ -3104,4 +3155,4 @@ interface DyrectedConfig<TUser extends AuthenticatedUser = AuthenticatedUser> {
3104
3155
  }>;
3105
3156
  }
3106
3157
 
3107
- export { type RadioField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailText as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailSchema as I, type ArrayField as J, type BlocksField as K, type LifecycleEventName as L, type BooleanField as M, type AuthConfig as N, type AccessPolicyResolver as O, type PublicAdminAuthConfig as P, type DateField as Q, type DateTimeField as R, type EmailField as S, type IconField as T, type ImageField as U, type JoinField as V, type WorkflowConfig as W, type JsonField as X, type MultiSelectField as Y, type NumberField as Z, type ObjectField as _, type DeclarativeHookExpression as a, type DistinctValuesOperation as a$, type RelationshipField as a0, type RichTextField as a1, type RowField as a2, type SelectField as a3, type TextField as a4, type TextareaField as a5, type TimeField as a6, type UrlField as a7, type AccessConfig as a8, type AccessFunction as a9, type BooleanFormat as aA, type CharacterLimitFieldAdmin as aB, type CharacterLimitFieldConfig as aC, type CollectionAfterChangeHook as aD, type CollectionAfterDeleteHook as aE, type CollectionAfterReadHook as aF, type CollectionAfterReadHookEntry as aG, type CollectionAfterTransitionHook as aH, type CollectionBeforeChangeHook as aI, type CollectionBeforeChangeHookEntry as aJ, type CollectionBeforeDeleteHook as aK, type CollectionBeforeReadHook as aL, type CollectionBeforeReadHookEntry as aM, type CollectionBeforeTransitionHook as aN, type CollectionListComponentSlots as aO, type CollectionViewComponentSlots as aP, type CountOperation as aQ, type CustomAdminAuthProvider as aR, type DatabaseAdapter as aS, type DateFieldAdmin as aT, type DateFormat as aU, type DefineActionOptions as aV, type DefineViewOptions as aW, type DetailSpan as aX, type DisplayTone as aY, type DisplayVariant as aZ, type DistinctCountOperation as a_, type AccessFunctionArgs as aa, type AccessResult as ab, type AccessRule as ac, type ActionConfig as ad, type ActionContext as ae, type ActionType as af, type AdminAuthAccessResolution as ag, type AdminAuthClaimMapping as ah, type AdminAuthMember as ai, type AdminAuthProvider as aj, type AdminAuthProviderMembersConfig as ak, type AdminAuthProvisioningMode as al, type AdminAuthResolveAccessArgs as am, type AdminAuthResolvedIdentity as an, type AdminConfig as ao, type AdminDashboardComponentSlots as ap, type AdminIconName as aq, type AggregateArgs as ar, type AggregateCastType as as, type AggregateInput as at, type AggregateOperation as au, type AggregateResult as av, type BaseAdminAuthProvider as aw, type BaseFieldAdmin as ax, type BlockVariant as ay, type BooleanFieldAdmin as az, type AuthenticatedUser as b, type TrustProxyConfig as b$, type DynamicOptionItem as b0, type DynamicOptionsConfig as b1, type DynamicOptionsResolver as b2, type DynamicOptionsResolverArgs as b3, type DyrectedLoggerConfig as b4, type DyrectedObservabilityConfig as b5, type EmailFieldAdmin as b6, type FieldAdminHooks as b7, type FieldAdminOnChangeHook as b8, type FieldAdminOnChangeHookArgs as b9, type JsonFormat as bA, LIFECYCLE_EVENT_NAMES as bB, type LifecycleEventHandler as bC, type LinkFormat as bD, type MetricColor as bE, type MultiSelectFieldAdmin as bF, type NamedAccessPolicy as bG, type NumberFieldAdmin as bH, type NumberFormat as bI, type NumberLimitFieldAdmin as bJ, type NumberLimitFieldConfig as bK, type NumericOperation as bL, type OIDCAdminAuthProvider as bM, type OptionFormat as bN, type PaginatedResult as bO, type PublicAdminAuthProvider as bP, type RadioFieldAdmin as bQ, type RateLimitConfig as bR, type ReadonlyDatabaseAdapter as bS, type RichTextFeature as bT, type RichTextFieldConfig as bU, type SelectFieldAdmin as bV, type SqlWhereResult as bW, type StorageAdapter as bX, type TextFieldAdmin as bY, type TextFormat as bZ, type TextareaFieldAdmin as b_, type FieldAdminOptionsHook as ba, type FieldAdminOptionsHookArgs as bb, type FieldAdminOptionsHookResult as bc, type FieldAfterReadHook as bd, type FieldAfterReadHookArgs as be, type FieldBase as bf, type FieldBeforeChangeHook as bg, type FieldBeforeChangeHookArgs as bh, type FieldHook as bi, type FieldHooks as bj, type FieldType as bk, type FileData as bl, type GlobalAfterChangeHook as bm, type GlobalAfterReadHook as bn, type GlobalAfterReadHookEntry as bo, type GlobalBeforeChangeHook as bp, type GlobalBeforeChangeHookEntry as bq, type GlobalBeforeReadHook as br, type GlobalBeforeReadHookEntry as bs, type HeadingLevel as bt, type HookFunction as bu, type IconFieldAdmin as bv, type ImageService as bw, type InferAggregateResult as bx, type JoinFieldAdmin as by, type JsonFieldAdmin as bz, type WorkflowTransition as c, type TypedField as c0, type UploadConfig as c1, type UrlFieldAdmin as c2, type UrlLinkValue as c3, type ViewActionFeatures as c4, type ViewComponentSlots as c5, type ViewConfig as c6, type ViewLayout as c7, type ViewMetric as c8, type ViewSubMetric as c9, type WhereClause as ca, type WhereOperator as cb, type WhereOperatorName as cc, type WordLimitFieldAdmin as cd, type WordLimitFieldConfig as ce, type WorkflowMetadata as cf, type WorkflowRole as cg, type WorkflowState as ch, type WorkflowTransitionContext as ci, defineAction as cj, defineView as ck, parseMongoWhere as cl, parseSqlWhere as cm, type LifecycleEvent as d, type BaseDocument as e, type DetailComputedOptions as f, type ComputedHandler as g, type DetailComputed as h, type DetailCustomOptions as i, type DetailCustom as j, type DetailDividerOptions as k, type DetailDivider as l, type DisplayFieldOptions as m, type DetailField as n, type DetailItem as o, type DetailGridOptions as p, type DetailGrid as q, type DetailRepeatOptions as r, type DetailRepeat as s, type DetailSectionOptions as t, type DetailSection as u, type DetailTabOptions as v, type DetailTab as w, type DetailTabsOptions as x, type DetailTabs as y, type DetailTextOptions as z };
3158
+ export { type RadioField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailText as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailSchema as I, type ArrayField as J, type BlocksField as K, type LifecycleEventName as L, type BooleanField as M, type AuthConfig as N, type AccessPolicyResolver as O, type PublicAdminAuthConfig as P, type DateField as Q, type DateTimeField as R, type EmailField as S, type IconField as T, type ImageField as U, type JoinField as V, type WorkflowConfig as W, type JsonField as X, type MultiSelectField as Y, type NumberField as Z, type ObjectField as _, type DeclarativeHookExpression as a, type DistinctValuesOperation as a$, type RelationshipField as a0, type RichTextField as a1, type RowField as a2, type SelectField as a3, type TextField as a4, type TextareaField as a5, type TimeField as a6, type UrlField as a7, type AccessConfig as a8, type AccessFunction as a9, type BooleanFormat as aA, type CharacterLimitFieldAdmin as aB, type CharacterLimitFieldConfig as aC, type CollectionAfterChangeHook as aD, type CollectionAfterDeleteHook as aE, type CollectionAfterReadHook as aF, type CollectionAfterReadHookEntry as aG, type CollectionAfterTransitionHook as aH, type CollectionBeforeChangeHook as aI, type CollectionBeforeChangeHookEntry as aJ, type CollectionBeforeDeleteHook as aK, type CollectionBeforeReadHook as aL, type CollectionBeforeReadHookEntry as aM, type CollectionBeforeTransitionHook as aN, type CollectionListComponentSlots as aO, type CollectionViewComponentSlots as aP, type CountOperation as aQ, type CustomAdminAuthProvider as aR, type DatabaseAdapter as aS, type DateFieldAdmin as aT, type DateFormat as aU, type DefineActionOptions as aV, type DefineViewOptions as aW, type DetailSpan as aX, type DisplayTone as aY, type DisplayVariant as aZ, type DistinctCountOperation as a_, type AccessFunctionArgs as aa, type AccessResult as ab, type AccessRule as ac, type ActionConfig as ad, type ActionContext as ae, type ActionType as af, type AdminAuthAccessResolution as ag, type AdminAuthClaimMapping as ah, type AdminAuthMember as ai, type AdminAuthProvider as aj, type AdminAuthProviderMembersConfig as ak, type AdminAuthProvisioningMode as al, type AdminAuthResolveAccessArgs as am, type AdminAuthResolvedIdentity as an, type AdminConfig as ao, type AdminDashboardComponentSlots as ap, type AdminIconName as aq, type AggregateArgs as ar, type AggregateCastType as as, type AggregateInput as at, type AggregateOperation as au, type AggregateResult as av, type BaseAdminAuthProvider as aw, type BaseFieldAdmin as ax, type BlockVariant as ay, type BooleanFieldAdmin as az, type AuthenticatedUser as b, type TextareaFieldAdmin as b$, type DynamicOptionItem as b0, type DynamicOptionsConfig as b1, type DynamicOptionsResolver as b2, type DynamicOptionsResolverArgs as b3, type DyrectedLoggerConfig as b4, type DyrectedObservabilityConfig as b5, type EmailFieldAdmin as b6, type FieldAdminHooks as b7, type FieldAdminOnChangeHook as b8, type FieldAdminOnChangeHookArgs as b9, type JsonFieldAdmin as bA, type JsonFormat as bB, LIFECYCLE_EVENT_NAMES as bC, type LifecycleEventHandler as bD, type LinkFormat as bE, type MetricColor as bF, type MultiSelectFieldAdmin as bG, type NamedAccessPolicy as bH, type NumberFieldAdmin as bI, type NumberFormat as bJ, type NumberLimitFieldAdmin as bK, type NumberLimitFieldConfig as bL, type NumericOperation as bM, type OIDCAdminAuthProvider as bN, type OptionFormat as bO, type PaginatedResult as bP, type PublicAdminAuthProvider as bQ, type RadioFieldAdmin as bR, type RateLimitConfig as bS, type ReadonlyDatabaseAdapter as bT, type RichTextFeature as bU, type RichTextFieldConfig as bV, type SelectFieldAdmin as bW, type SqlWhereResult as bX, type StorageAdapter as bY, type TextFieldAdmin as bZ, type TextFormat as b_, type FieldAdminOptionsHook as ba, type FieldAdminOptionsHookArgs as bb, type FieldAdminOptionsHookResult as bc, type FieldAfterReadHook as bd, type FieldAfterReadHookArgs as be, type FieldBase as bf, type FieldBeforeChangeHook as bg, type FieldBeforeChangeHookArgs as bh, type FieldHook as bi, type FieldHooks as bj, type FieldType as bk, type FileData as bl, type GlobalAfterChangeHook as bm, type GlobalAfterReadHook as bn, type GlobalAfterReadHookEntry as bo, type GlobalBeforeChangeHook as bp, type GlobalBeforeChangeHookEntry as bq, type GlobalBeforeReadHook as br, type GlobalBeforeReadHookEntry as bs, type HeadingLevel as bt, type HookFunction as bu, type IconFieldAdmin as bv, type ImageService as bw, type ImageTransformOptions as bx, type InferAggregateResult as by, type JoinFieldAdmin as bz, type WorkflowTransition as c, type TrustProxyConfig as c0, type TypedField as c1, type UploadConfig as c2, type UrlFieldAdmin as c3, type UrlLinkValue as c4, type ViewActionFeatures as c5, type ViewComponentSlots as c6, type ViewConfig as c7, type ViewLayout as c8, type ViewMetric as c9, type ViewSubMetric as ca, type WhereClause as cb, type WhereOperator as cc, type WhereOperatorName as cd, type WordLimitFieldAdmin as ce, type WordLimitFieldConfig as cf, type WorkflowMetadata as cg, type WorkflowRole as ch, type WorkflowState as ci, type WorkflowTransitionContext as cj, defineAction as ck, defineView as cl, parseMongoWhere as cm, parseSqlWhere as cn, type LifecycleEvent as d, type BaseDocument as e, type DetailComputedOptions as f, type ComputedHandler as g, type DetailComputed as h, type DetailCustomOptions as i, type DetailCustom as j, type DetailDividerOptions as k, type DetailDivider as l, type DisplayFieldOptions as m, type DetailField as n, type DetailItem as o, type DetailGridOptions as p, type DetailGrid as q, type DetailRepeatOptions as r, type DetailRepeat as s, type DetailSectionOptions as t, type DetailSection as u, type DetailTabOptions as v, type DetailTab as w, type DetailTabsOptions as x, type DetailTabs as y, type DetailTextOptions as z };
@@ -136,12 +136,15 @@ interface PaginatedResult<T = Record<string, any>> {
136
136
  */
137
137
  interface FileData {
138
138
  filename: string;
139
+ originalFilename?: string;
139
140
  filesize?: number;
140
141
  mimeType: string;
141
142
  /** Public URL of the stored file. */
142
143
  url: string;
143
144
  width?: number;
144
145
  height?: number;
146
+ aspectRatio?: number;
147
+ folderId?: string | null;
145
148
  focalPoint?: {
146
149
  x: number;
147
150
  y: number;
@@ -152,6 +155,7 @@ interface FileData {
152
155
  type?: "upload" | "external";
153
156
  provider?: string;
154
157
  provider_metadata?: unknown;
158
+ metadata?: Record<string, unknown>;
155
159
  [key: string]: unknown;
156
160
  }
157
161
 
@@ -1992,6 +1996,39 @@ interface DatabaseAdapter {
1992
1996
  * and `afterDelete` hooks where the full {@link DatabaseAdapter} is provided.
1993
1997
  */
1994
1998
  type ReadonlyDatabaseAdapter = Pick<DatabaseAdapter, "find" | "findOne" | "getGlobal" | "aggregate">;
1999
+ /**
2000
+ * Options for dynamic on-the-fly image transformations.
2001
+ */
2002
+ interface ImageTransformOptions {
2003
+ /** Target width in pixels. */
2004
+ width?: number;
2005
+ /** Target height in pixels. */
2006
+ height?: number;
2007
+ /** Aspect ratio string (e.g. "16:9", "1:1") or numeric ratio (e.g. 1.777). */
2008
+ aspectRatio?: string | number;
2009
+ /** Crop strategy. */
2010
+ crop?: "fill" | "fit" | "limit" | "pad" | "thumb" | "scale" | "cover" | "contain";
2011
+ /** Gravity / focal anchor for cropping. */
2012
+ gravity?: "auto" | "face" | "center" | "focal" | "xy_center" | string;
2013
+ /** Explicit focal point percentage coordinates (0.0 to 1.0). */
2014
+ focalPoint?: {
2015
+ x: number;
2016
+ y: number;
2017
+ };
2018
+ /** Output quality (1-100 or 'auto'). */
2019
+ quality?: number | "auto" | "auto:best" | "auto:good" | "auto:eco";
2020
+ /** Target image format. */
2021
+ format?: "auto" | "webp" | "avif" | "png" | "jpg" | "jpeg";
2022
+ /** Blur radius for placeholders/effects. */
2023
+ blur?: number;
2024
+ /** Rotation angle in degrees (e.g. 90, 180, 270). */
2025
+ rotate?: number;
2026
+ /** Device pixel ratio multiplier. */
2027
+ dpr?: number | "auto";
2028
+ /** Named transformation preset key. */
2029
+ key?: string;
2030
+ [key: string]: unknown;
2031
+ }
1995
2032
  /**
1996
2033
  * The interface every storage adapter must implement.
1997
2034
  *
@@ -2014,9 +2051,10 @@ interface StorageAdapter {
2014
2051
  delete(args: {
2015
2052
  filename: string;
2016
2053
  }): Promise<void>;
2017
- /** Return the public URL for a stored file. */
2054
+ /** Return the public URL for a stored file, with optional dynamic transformations. */
2018
2055
  getURL(args: {
2019
2056
  filename: string;
2057
+ transform?: ImageTransformOptions;
2020
2058
  }): string;
2021
2059
  /**
2022
2060
  * Retrieve the file's raw bytes and MIME type for serving via the API.
@@ -2247,8 +2285,8 @@ interface FieldAdminOnChangeHookArgs<TValue = unknown> {
2247
2285
  docs?: Record<string, unknown>[];
2248
2286
  /** Current authenticated user. */
2249
2287
  user?: unknown;
2250
- /** Imperative setter for async or derived updates. */
2251
- setValue: (value: unknown) => void;
2288
+ /** Imperative setter for current field or sibling fields. */
2289
+ setValue: (nameOrVal: string | unknown, maybeVal?: unknown) => void;
2252
2290
  }
2253
2291
  type FieldAdminOnChangeHook<TValue = unknown> = (args: FieldAdminOnChangeHookArgs<TValue>) => unknown;
2254
2292
  type FieldAdminHooks<TValue> = {
@@ -2593,6 +2631,10 @@ type JoinFieldAdmin = {
2593
2631
  showCreateButton?: boolean;
2594
2632
  /** Whether the join field should show the "View all" action in the Admin UI. Defaults to `true`. */
2595
2633
  showViewButton?: boolean;
2634
+ /** Display layout for the join list: 'list' (default) or 'table'. */
2635
+ layout?: "list" | "table";
2636
+ /** Columns to display when layout is 'table'. */
2637
+ columns?: string[];
2596
2638
  };
2597
2639
  interface UrlLinkValue {
2598
2640
  /** Whether the link is a custom URL or a reference to an internal document. */
@@ -2972,6 +3014,15 @@ interface DyrectedConfig<TUser extends AuthenticatedUser = AuthenticatedUser> {
2972
3014
  * @see ImageService
2973
3015
  */
2974
3016
  image?: ImageService;
3017
+ /**
3018
+ * Media management, dynamic transformations, and transformation preset configurations.
3019
+ */
3020
+ media?: {
3021
+ /** Whether to restrict dynamic transformations to registered preset keys in production. */
3022
+ restrictTransforms?: boolean;
3023
+ /** Named transformation presets available via `?key=name`. */
3024
+ presets?: Record<string, ImageTransformOptions>;
3025
+ };
2975
3026
  /**
2976
3027
  * Runtime logger configuration. Accepts either logger options/destination or
2977
3028
  * a fully-instantiated Pino logger.
@@ -3104,4 +3155,4 @@ interface DyrectedConfig<TUser extends AuthenticatedUser = AuthenticatedUser> {
3104
3155
  }>;
3105
3156
  }
3106
3157
 
3107
- export { type RadioField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailText as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailSchema as I, type ArrayField as J, type BlocksField as K, type LifecycleEventName as L, type BooleanField as M, type AuthConfig as N, type AccessPolicyResolver as O, type PublicAdminAuthConfig as P, type DateField as Q, type DateTimeField as R, type EmailField as S, type IconField as T, type ImageField as U, type JoinField as V, type WorkflowConfig as W, type JsonField as X, type MultiSelectField as Y, type NumberField as Z, type ObjectField as _, type DeclarativeHookExpression as a, type DistinctValuesOperation as a$, type RelationshipField as a0, type RichTextField as a1, type RowField as a2, type SelectField as a3, type TextField as a4, type TextareaField as a5, type TimeField as a6, type UrlField as a7, type AccessConfig as a8, type AccessFunction as a9, type BooleanFormat as aA, type CharacterLimitFieldAdmin as aB, type CharacterLimitFieldConfig as aC, type CollectionAfterChangeHook as aD, type CollectionAfterDeleteHook as aE, type CollectionAfterReadHook as aF, type CollectionAfterReadHookEntry as aG, type CollectionAfterTransitionHook as aH, type CollectionBeforeChangeHook as aI, type CollectionBeforeChangeHookEntry as aJ, type CollectionBeforeDeleteHook as aK, type CollectionBeforeReadHook as aL, type CollectionBeforeReadHookEntry as aM, type CollectionBeforeTransitionHook as aN, type CollectionListComponentSlots as aO, type CollectionViewComponentSlots as aP, type CountOperation as aQ, type CustomAdminAuthProvider as aR, type DatabaseAdapter as aS, type DateFieldAdmin as aT, type DateFormat as aU, type DefineActionOptions as aV, type DefineViewOptions as aW, type DetailSpan as aX, type DisplayTone as aY, type DisplayVariant as aZ, type DistinctCountOperation as a_, type AccessFunctionArgs as aa, type AccessResult as ab, type AccessRule as ac, type ActionConfig as ad, type ActionContext as ae, type ActionType as af, type AdminAuthAccessResolution as ag, type AdminAuthClaimMapping as ah, type AdminAuthMember as ai, type AdminAuthProvider as aj, type AdminAuthProviderMembersConfig as ak, type AdminAuthProvisioningMode as al, type AdminAuthResolveAccessArgs as am, type AdminAuthResolvedIdentity as an, type AdminConfig as ao, type AdminDashboardComponentSlots as ap, type AdminIconName as aq, type AggregateArgs as ar, type AggregateCastType as as, type AggregateInput as at, type AggregateOperation as au, type AggregateResult as av, type BaseAdminAuthProvider as aw, type BaseFieldAdmin as ax, type BlockVariant as ay, type BooleanFieldAdmin as az, type AuthenticatedUser as b, type TrustProxyConfig as b$, type DynamicOptionItem as b0, type DynamicOptionsConfig as b1, type DynamicOptionsResolver as b2, type DynamicOptionsResolverArgs as b3, type DyrectedLoggerConfig as b4, type DyrectedObservabilityConfig as b5, type EmailFieldAdmin as b6, type FieldAdminHooks as b7, type FieldAdminOnChangeHook as b8, type FieldAdminOnChangeHookArgs as b9, type JsonFormat as bA, LIFECYCLE_EVENT_NAMES as bB, type LifecycleEventHandler as bC, type LinkFormat as bD, type MetricColor as bE, type MultiSelectFieldAdmin as bF, type NamedAccessPolicy as bG, type NumberFieldAdmin as bH, type NumberFormat as bI, type NumberLimitFieldAdmin as bJ, type NumberLimitFieldConfig as bK, type NumericOperation as bL, type OIDCAdminAuthProvider as bM, type OptionFormat as bN, type PaginatedResult as bO, type PublicAdminAuthProvider as bP, type RadioFieldAdmin as bQ, type RateLimitConfig as bR, type ReadonlyDatabaseAdapter as bS, type RichTextFeature as bT, type RichTextFieldConfig as bU, type SelectFieldAdmin as bV, type SqlWhereResult as bW, type StorageAdapter as bX, type TextFieldAdmin as bY, type TextFormat as bZ, type TextareaFieldAdmin as b_, type FieldAdminOptionsHook as ba, type FieldAdminOptionsHookArgs as bb, type FieldAdminOptionsHookResult as bc, type FieldAfterReadHook as bd, type FieldAfterReadHookArgs as be, type FieldBase as bf, type FieldBeforeChangeHook as bg, type FieldBeforeChangeHookArgs as bh, type FieldHook as bi, type FieldHooks as bj, type FieldType as bk, type FileData as bl, type GlobalAfterChangeHook as bm, type GlobalAfterReadHook as bn, type GlobalAfterReadHookEntry as bo, type GlobalBeforeChangeHook as bp, type GlobalBeforeChangeHookEntry as bq, type GlobalBeforeReadHook as br, type GlobalBeforeReadHookEntry as bs, type HeadingLevel as bt, type HookFunction as bu, type IconFieldAdmin as bv, type ImageService as bw, type InferAggregateResult as bx, type JoinFieldAdmin as by, type JsonFieldAdmin as bz, type WorkflowTransition as c, type TypedField as c0, type UploadConfig as c1, type UrlFieldAdmin as c2, type UrlLinkValue as c3, type ViewActionFeatures as c4, type ViewComponentSlots as c5, type ViewConfig as c6, type ViewLayout as c7, type ViewMetric as c8, type ViewSubMetric as c9, type WhereClause as ca, type WhereOperator as cb, type WhereOperatorName as cc, type WordLimitFieldAdmin as cd, type WordLimitFieldConfig as ce, type WorkflowMetadata as cf, type WorkflowRole as cg, type WorkflowState as ch, type WorkflowTransitionContext as ci, defineAction as cj, defineView as ck, parseMongoWhere as cl, parseSqlWhere as cm, type LifecycleEvent as d, type BaseDocument as e, type DetailComputedOptions as f, type ComputedHandler as g, type DetailComputed as h, type DetailCustomOptions as i, type DetailCustom as j, type DetailDividerOptions as k, type DetailDivider as l, type DisplayFieldOptions as m, type DetailField as n, type DetailItem as o, type DetailGridOptions as p, type DetailGrid as q, type DetailRepeatOptions as r, type DetailRepeat as s, type DetailSectionOptions as t, type DetailSection as u, type DetailTabOptions as v, type DetailTab as w, type DetailTabsOptions as x, type DetailTabs as y, type DetailTextOptions as z };
3158
+ export { type RadioField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailText as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailSchema as I, type ArrayField as J, type BlocksField as K, type LifecycleEventName as L, type BooleanField as M, type AuthConfig as N, type AccessPolicyResolver as O, type PublicAdminAuthConfig as P, type DateField as Q, type DateTimeField as R, type EmailField as S, type IconField as T, type ImageField as U, type JoinField as V, type WorkflowConfig as W, type JsonField as X, type MultiSelectField as Y, type NumberField as Z, type ObjectField as _, type DeclarativeHookExpression as a, type DistinctValuesOperation as a$, type RelationshipField as a0, type RichTextField as a1, type RowField as a2, type SelectField as a3, type TextField as a4, type TextareaField as a5, type TimeField as a6, type UrlField as a7, type AccessConfig as a8, type AccessFunction as a9, type BooleanFormat as aA, type CharacterLimitFieldAdmin as aB, type CharacterLimitFieldConfig as aC, type CollectionAfterChangeHook as aD, type CollectionAfterDeleteHook as aE, type CollectionAfterReadHook as aF, type CollectionAfterReadHookEntry as aG, type CollectionAfterTransitionHook as aH, type CollectionBeforeChangeHook as aI, type CollectionBeforeChangeHookEntry as aJ, type CollectionBeforeDeleteHook as aK, type CollectionBeforeReadHook as aL, type CollectionBeforeReadHookEntry as aM, type CollectionBeforeTransitionHook as aN, type CollectionListComponentSlots as aO, type CollectionViewComponentSlots as aP, type CountOperation as aQ, type CustomAdminAuthProvider as aR, type DatabaseAdapter as aS, type DateFieldAdmin as aT, type DateFormat as aU, type DefineActionOptions as aV, type DefineViewOptions as aW, type DetailSpan as aX, type DisplayTone as aY, type DisplayVariant as aZ, type DistinctCountOperation as a_, type AccessFunctionArgs as aa, type AccessResult as ab, type AccessRule as ac, type ActionConfig as ad, type ActionContext as ae, type ActionType as af, type AdminAuthAccessResolution as ag, type AdminAuthClaimMapping as ah, type AdminAuthMember as ai, type AdminAuthProvider as aj, type AdminAuthProviderMembersConfig as ak, type AdminAuthProvisioningMode as al, type AdminAuthResolveAccessArgs as am, type AdminAuthResolvedIdentity as an, type AdminConfig as ao, type AdminDashboardComponentSlots as ap, type AdminIconName as aq, type AggregateArgs as ar, type AggregateCastType as as, type AggregateInput as at, type AggregateOperation as au, type AggregateResult as av, type BaseAdminAuthProvider as aw, type BaseFieldAdmin as ax, type BlockVariant as ay, type BooleanFieldAdmin as az, type AuthenticatedUser as b, type TextareaFieldAdmin as b$, type DynamicOptionItem as b0, type DynamicOptionsConfig as b1, type DynamicOptionsResolver as b2, type DynamicOptionsResolverArgs as b3, type DyrectedLoggerConfig as b4, type DyrectedObservabilityConfig as b5, type EmailFieldAdmin as b6, type FieldAdminHooks as b7, type FieldAdminOnChangeHook as b8, type FieldAdminOnChangeHookArgs as b9, type JsonFieldAdmin as bA, type JsonFormat as bB, LIFECYCLE_EVENT_NAMES as bC, type LifecycleEventHandler as bD, type LinkFormat as bE, type MetricColor as bF, type MultiSelectFieldAdmin as bG, type NamedAccessPolicy as bH, type NumberFieldAdmin as bI, type NumberFormat as bJ, type NumberLimitFieldAdmin as bK, type NumberLimitFieldConfig as bL, type NumericOperation as bM, type OIDCAdminAuthProvider as bN, type OptionFormat as bO, type PaginatedResult as bP, type PublicAdminAuthProvider as bQ, type RadioFieldAdmin as bR, type RateLimitConfig as bS, type ReadonlyDatabaseAdapter as bT, type RichTextFeature as bU, type RichTextFieldConfig as bV, type SelectFieldAdmin as bW, type SqlWhereResult as bX, type StorageAdapter as bY, type TextFieldAdmin as bZ, type TextFormat as b_, type FieldAdminOptionsHook as ba, type FieldAdminOptionsHookArgs as bb, type FieldAdminOptionsHookResult as bc, type FieldAfterReadHook as bd, type FieldAfterReadHookArgs as be, type FieldBase as bf, type FieldBeforeChangeHook as bg, type FieldBeforeChangeHookArgs as bh, type FieldHook as bi, type FieldHooks as bj, type FieldType as bk, type FileData as bl, type GlobalAfterChangeHook as bm, type GlobalAfterReadHook as bn, type GlobalAfterReadHookEntry as bo, type GlobalBeforeChangeHook as bp, type GlobalBeforeChangeHookEntry as bq, type GlobalBeforeReadHook as br, type GlobalBeforeReadHookEntry as bs, type HeadingLevel as bt, type HookFunction as bu, type IconFieldAdmin as bv, type ImageService as bw, type ImageTransformOptions as bx, type InferAggregateResult as by, type JoinFieldAdmin as bz, type WorkflowTransition as c, type TrustProxyConfig as c0, type TypedField as c1, type UploadConfig as c2, type UrlFieldAdmin as c3, type UrlLinkValue as c4, type ViewActionFeatures as c5, type ViewComponentSlots as c6, type ViewConfig as c7, type ViewLayout as c8, type ViewMetric as c9, type ViewSubMetric as ca, type WhereClause as cb, type WhereOperator as cc, type WhereOperatorName as cd, type WordLimitFieldAdmin as ce, type WordLimitFieldConfig as cf, type WorkflowMetadata as cg, type WorkflowRole as ch, type WorkflowState as ci, type WorkflowTransitionContext as cj, defineAction as ck, defineView as cl, parseMongoWhere as cm, parseSqlWhere as cn, type LifecycleEvent as d, type BaseDocument as e, type DetailComputedOptions as f, type ComputedHandler as g, type DetailComputed as h, type DetailCustomOptions as i, type DetailCustom as j, type DetailDividerOptions as k, type DetailDivider as l, type DisplayFieldOptions as m, type DetailField as n, type DetailItem as o, type DetailGridOptions as p, type DetailGrid as q, type DetailRepeatOptions as r, type DetailRepeat as s, type DetailSectionOptions as t, type DetailSection as u, type DetailTabOptions as v, type DetailTab as w, type DetailTabsOptions as x, type DetailTabs as y, type DetailTextOptions as z };
@@ -3428,6 +3428,21 @@ var SYSTEM_FIELDS = [
3428
3428
  admin: { readOnly: true, hidden: true }
3429
3429
  }
3430
3430
  ];
3431
+ var MEDIA_SYSTEM_FIELDS = [
3432
+ { name: "folderId", type: "text", label: "Folder", admin: { hidden: true } },
3433
+ { name: "filename", type: "text", label: "Filename", required: true },
3434
+ { name: "originalFilename", type: "text", label: "Original Filename", admin: { hidden: true } },
3435
+ { name: "mimeType", type: "text", label: "MIME Type", admin: { hidden: true } },
3436
+ { name: "filesize", type: "number", label: "File Size", admin: { hidden: true } },
3437
+ { name: "url", type: "text", label: "URL", admin: { hidden: true } },
3438
+ { name: "width", type: "number", label: "Width", admin: { hidden: true } },
3439
+ { name: "height", type: "number", label: "Height", admin: { hidden: true } },
3440
+ { name: "aspectRatio", type: "number", label: "Aspect Ratio", admin: { hidden: true } },
3441
+ { name: "blurhash", type: "text", label: "Blurhash", admin: { hidden: true } },
3442
+ { name: "focalPoint", type: "json", label: "Focal Point", admin: { hidden: true } },
3443
+ { name: "alt", type: "text", label: "Alt Text" },
3444
+ { name: "caption", type: "text", label: "Caption" }
3445
+ ];
3431
3446
  var AUDIT_COLLECTION = {
3432
3447
  slug: AUDIT_COLLECTION_SLUG,
3433
3448
  labels: { singular: "Audit Log", plural: "Audit Logs" },
@@ -3699,6 +3714,11 @@ function normalizeConfig(config) {
3699
3714
  }
3700
3715
  }
3701
3716
  }
3717
+ if (col.upload || col.slug === "media") {
3718
+ const currentNames = new Set(fields.map((f) => f.name));
3719
+ const mediaFieldsToInject = MEDIA_SYSTEM_FIELDS.filter((f) => !currentNames.has(f.name));
3720
+ fields = [...fields, ...mediaFieldsToInject];
3721
+ }
3702
3722
  const updatedFieldNames = new Set(fields.map((f) => f.name));
3703
3723
  const fieldsToInject = SYSTEM_FIELDS.filter((f) => !updatedFieldNames.has(f.name));
3704
3724
  const workflow = col.workflow || (col.drafts ? simplePublishingWorkflow() : void 0);