@dyrected/core 2.13.6 → 2.15.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.
@@ -1153,10 +1153,44 @@ interface DetailCustom<TDoc = any> {
1153
1153
  /** Custom component options. */
1154
1154
  options?: DetailCustomOptions<TDoc>;
1155
1155
  }
1156
+ /**
1157
+ * Configuration options for rendering an action button in a Detail View.
1158
+ */
1159
+ interface DetailActionOptions {
1160
+ /** Grid column span across the 12-column grid. */
1161
+ span?: DetailSpan;
1162
+ /** Button visual style. Defaults to `'outline'`. */
1163
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive";
1164
+ /** Button size. Defaults to `'sm'`. */
1165
+ size?: "sm" | "default";
1166
+ /** Overrides the action's own `label` for this placement. */
1167
+ label?: string;
1168
+ /**
1169
+ * Visibility condition for this action item.
1170
+ * Can be a boolean or a JEXL expression evaluated against `{ doc, user }`.
1171
+ */
1172
+ visible?: string | boolean;
1173
+ }
1174
+ /**
1175
+ * Renders a button for a named action from `collection.actions` at this
1176
+ * position in a Detail View. The same action (and its confirm dialog, modal
1177
+ * fields, and execution) can also render automatically in the Detail View's
1178
+ * header toolbar when the action's `type` is `'header'` — placing it here
1179
+ * too does not duplicate that config, it just adds another entry point to
1180
+ * the same action.
1181
+ */
1182
+ interface DetailAction {
1183
+ /** Identifies this item as an action button. */
1184
+ type: "action";
1185
+ /** Name of the action, matching an entry in `collection.actions`. */
1186
+ name: string;
1187
+ /** Display and visibility options for this placement. */
1188
+ options?: DetailActionOptions;
1189
+ }
1156
1190
  /**
1157
1191
  * Union of all valid item types in a Detail View schema.
1158
1192
  */
1159
- type DetailItem<TDoc = any> = DetailSection | DetailTabs | DetailGrid | DetailField | DetailRepeat | DetailComputed<TDoc> | DetailDivider | DetailText | DetailCustom<TDoc> | string;
1193
+ type DetailItem<TDoc = any> = DetailSection | DetailTabs | DetailGrid | DetailField | DetailRepeat | DetailComputed<TDoc> | DetailDivider | DetailText | DetailCustom<TDoc> | DetailAction | string;
1160
1194
  /**
1161
1195
  * Detail View layout schema definition for a collection or global.
1162
1196
  */
@@ -1784,6 +1818,16 @@ interface AuthConfig {
1784
1818
  * Defaults to `10 * 60 * 1000` (10 minutes).
1785
1819
  */
1786
1820
  lockTime?: number;
1821
+ /**
1822
+ * How long issued session JWTs remain valid.
1823
+ *
1824
+ * Accepts the same values as `jose`'s `setExpirationTime` (e.g. `'15m'`,
1825
+ * `'12h'`, `'30d'`).
1826
+ *
1827
+ * Defaults to `'7d'`. Applies to login, registration, invite-accept, and
1828
+ * refresh-token issuance for this collection.
1829
+ */
1830
+ tokenExpiration?: string;
1787
1831
  /**
1788
1832
  * The role name designated as the superuser/admin role for this collection.
1789
1833
  *
@@ -2078,6 +2122,31 @@ interface CollectionConfig<TDoc extends object = Record<string, unknown>> {
2078
2122
  hidden?: boolean;
2079
2123
  /** If `false`, disables the filter UI entirely for this collection. Defaults to `true`. */
2080
2124
  filterable?: boolean;
2125
+ /**
2126
+ * Base query filter applied to this collection's default list view,
2127
+ * before user toolbar filters (e.g. `{ status: { equals: "published" } }`
2128
+ * or a JEXL string). Equivalent to `filter` on `defineView`, without
2129
+ * having to define a separate view and set it as the default.
2130
+ */
2131
+ filter?: Record<string, any> | string;
2132
+ /**
2133
+ * Default sort applied to this collection's default list view when first
2134
+ * opened. Equivalent to `sort` on `defineView`.
2135
+ */
2136
+ sort?: {
2137
+ field: string;
2138
+ direction: "asc" | "desc";
2139
+ };
2140
+ /**
2141
+ * KPI summary cards rendered above this collection's default list view.
2142
+ * Equivalent to `metrics` on `defineView`.
2143
+ */
2144
+ metrics?: ViewMetric[];
2145
+ /**
2146
+ * Field name used to organize this collection's default list view into
2147
+ * collapsible grouped sections. Equivalent to `groupBy` on `defineView`.
2148
+ */
2149
+ groupBy?: string;
2081
2150
  /**
2082
2151
  * Enables draft autosave in the Admin editor for workflow-enabled
2083
2152
  * collections. Defaults to `true` when the collection uses `workflow` or
@@ -2209,6 +2278,29 @@ interface CollectionConfig<TDoc extends object = Record<string, unknown>> {
2209
2278
  * @see {@link https://dyrected.com/docs/model-content/operational-views/overview Operational views overview}
2210
2279
  */
2211
2280
  views?: ViewConfig[];
2281
+ /**
2282
+ * Custom workflow actions for this collection, independent of any single view.
2283
+ * These run against one document at a time (no `viewSlug` required), so they
2284
+ * work anywhere a document is in scope — most notably the read-only Detail
2285
+ * View, where they can render in the header toolbar (`type: 'header'`) and/or
2286
+ * inline via `displayAction(name)` in the `detail` schema. The same action
2287
+ * definitions can also be referenced from a `defineView`'s own `actions` for
2288
+ * list-page use — they are not mutually exclusive.
2289
+ *
2290
+ * @example
2291
+ * ```ts
2292
+ * actions: [
2293
+ * defineAction({
2294
+ * name: "markShipped",
2295
+ * label: "Mark as shipped",
2296
+ * type: "header",
2297
+ * confirm: "Mark this order as shipped?",
2298
+ * mutation: { status: "shipped" },
2299
+ * }),
2300
+ * ]
2301
+ * ```
2302
+ */
2303
+ actions?: ActionConfig[];
2212
2304
  }
2213
2305
  /**
2214
2306
  * Defines a Dyrected global — a singleton document without pagination or IDs.
@@ -3650,6 +3742,27 @@ interface CollectionTokenPayload extends JWTPayload {
3650
3742
  providerId?: string;
3651
3743
  authSource?: 'local' | 'external';
3652
3744
  }
3745
+ declare const DEFAULT_SESSION_EXPIRY = "7d";
3746
+ /**
3747
+ * Resolve the session JWT lifetime for an auth collection.
3748
+ *
3749
+ * Reads `auth.tokenExpiration` when the collection configures auth as an
3750
+ * object, and falls back to `'7d'` for `auth: true` (or any missing/empty
3751
+ * value) so existing behavior is unchanged.
3752
+ */
3753
+ declare function resolveSessionTokenExpiry(collection: CollectionConfig): string;
3754
+ /**
3755
+ * Issue a signed JWT for a user document in an auth collection.
3756
+ */
3757
+ declare function signCollectionToken(payload: Omit<CollectionTokenPayload, 'iat' | 'exp'>, expiresIn?: string): Promise<string>;
3758
+ /**
3759
+ * Verify and decode a collection JWT. Throws if invalid or expired.
3760
+ */
3761
+ declare function verifyCollectionToken(token: string): Promise<CollectionTokenPayload>;
3762
+ /**
3763
+ * Decode a token without verification (read-only, for middleware that wants to be non-blocking).
3764
+ */
3765
+ declare function decodeCollectionToken(token: string): CollectionTokenPayload | null;
3653
3766
 
3654
3767
  type RequestVars = DyrectedContext["Variables"];
3655
3768
  interface ResolvedObservabilityConfig {
@@ -3787,4 +3900,4 @@ interface DyrectedContext {
3787
3900
  */
3788
3901
  declare function createDyrectedApp(rawConfig: DyrectedConfig | any): Promise<Hono<DyrectedContext, hono_types.BlankSchema, "/">>;
3789
3902
 
3790
- export { type MultiSelectField 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 DyrectedContext as J, type AIConfig as K, type LifecycleEventName as L, type AIPIIConfig as M, type ArrayField as N, type FieldType as O, type PublicAdminAuthConfig as P, type BooleanField as Q, type AuthConfig as R, type AccessPolicyResolver as S, type DateField as T, type DateTimeField as U, type EmailField as V, type WorkflowConfig as W, type IconField as X, type ImageField as Y, type JoinField as Z, type JsonField as _, type DeclarativeHookExpression as a, type CharacterLimitFieldAdmin as a$, type NumberField as a0, type ObjectField as a1, type RadioField as a2, type RelationshipField as a3, type RichTextField as a4, type RowField as a5, type SelectField as a6, type TextField as a7, type TextareaField as a8, type TimeField as a9, type ActionConfigWithHandler as aA, type ActionConfigWithMutation as aB, type ActionContext as aC, type ActionType as aD, type AdminAuthAccessResolution as aE, type AdminAuthClaimMapping as aF, type AdminAuthMember as aG, type AdminAuthProvider as aH, type AdminAuthProviderMembersConfig as aI, type AdminAuthProvisioningMode as aJ, type AdminAuthResolveAccessArgs as aK, type AdminAuthResolvedIdentity as aL, type AdminConfig as aM, type AdminDashboardComponentSlots as aN, type AdminIconName as aO, type AggregateArgs as aP, type AggregateCastType as aQ, type AggregateCollectionResult as aR, type AggregateInput as aS, type AggregateOperation as aT, type AggregateResult as aU, type BaseAdminAuthProvider as aV, type BaseFieldAdmin as aW, type BlockVariant as aX, type BlocksField as aY, type BooleanFieldAdmin as aZ, type BooleanFormat as a_, type UrlField as aa, type AIAction as ab, type AIActionStatus as ac, type AIActionType as ad, type AIAuditActionType as ae, type AIAuditRecord as af, type AIChunk as ag, type AIMessage as ah, type AIPIIPattern as ai, type AIRateLimitResult as aj, type AIRateLimitStore as ak, type AIThread as al, type AIToolContext as am, type AIToolDefinition as an, AI_ACTIONS_COLLECTION as ao, AI_AUDIT_COLLECTION as ap, AI_CHUNKS_COLLECTION as aq, AI_MESSAGES_COLLECTION as ar, AI_THREADS_COLLECTION as as, type AccessConfig as at, type AccessFunction as au, type AccessFunctionArgs as av, type AccessResult as aw, type AccessRule as ax, type ActionConfig as ay, type ActionConfigBase as az, type AuthenticatedUser as b, type GlobalBeforeChangeHookEntry as b$, type CharacterLimitFieldConfig as b0, type CollectionAfterChangeHook as b1, type CollectionAfterDeleteHook as b2, type CollectionAfterReadHook as b3, type CollectionAfterReadHookEntry as b4, type CollectionAfterTransitionHook as b5, type CollectionBeforeChangeHook as b6, type CollectionBeforeChangeHookEntry as b7, type CollectionBeforeDeleteHook as b8, type CollectionBeforeReadHook as b9, type DynamicOptionItem as bA, type DynamicOptionsConfig as bB, type DynamicOptionsResolver as bC, type DynamicOptionsResolverArgs as bD, type DyrectedAIContext as bE, type DyrectedLoggerConfig as bF, type DyrectedObservabilityConfig as bG, type EmailFieldAdmin as bH, type FieldAdminHooks as bI, type FieldAdminOnChangeHook as bJ, type FieldAdminOnChangeHookArgs as bK, type FieldAdminOptionsHook as bL, type FieldAdminOptionsHookArgs as bM, type FieldAdminOptionsHookResult as bN, type FieldAfterReadHook as bO, type FieldAfterReadHookArgs as bP, type FieldBase as bQ, type FieldBeforeChangeHook as bR, type FieldBeforeChangeHookArgs as bS, type FieldHook as bT, type FieldHooks as bU, type FileData as bV, type GetDocumentResult as bW, type GlobalAfterChangeHook as bX, type GlobalAfterReadHook as bY, type GlobalAfterReadHookEntry as bZ, type GlobalBeforeChangeHook as b_, type CollectionBeforeReadHookEntry as ba, type CollectionBeforeTransitionHook as bb, type CollectionListComponentSlots as bc, type CollectionRAGConfig as bd, type CollectionSchemaResult as be, type CollectionSummaryResult as bf, type CollectionViewComponentSlots as bg, type CountOperation as bh, type CustomAdminAuthProvider as bi, type DatabaseAdapter as bj, type DateFieldAdmin as bk, type DateFormat as bl, type DefaultValueContext as bm, type DefineActionOptions as bn, type DefineCalendarViewOptions as bo, type DefineCardsViewOptions as bp, type DefineGanttViewOptions as bq, type DefineKanbanViewOptions as br, type DefineTableViewOptions as bs, type DefineViewBaseOptions as bt, type DefineViewOptions as bu, type DetailSpan as bv, type DisplayTone as bw, type DisplayVariant as bx, type DistinctCountOperation as by, type DistinctValuesOperation as bz, type WorkflowTransition as c, defineCalendarView as c$, type GlobalBeforeReadHook as c0, type GlobalBeforeReadHookEntry as c1, type GlobalRAGConfig as c2, type GlobalSchemaResult as c3, type GlobalSummaryResult as c4, type HeadingLevel as c5, type HookFunction as c6, type IconFieldAdmin as c7, type ImageService as c8, type ImageTransformOptions as c9, type SelectFieldAdmin as cA, type SqlWhereResult as cB, type StorageAdapter as cC, type TextFieldAdmin as cD, type TextFormat as cE, type TextareaFieldAdmin as cF, type TrustProxyConfig as cG, type TypedField as cH, type UploadConfig as cI, type UrlFieldAdmin as cJ, type UrlLinkValue as cK, type ViewActionFeatures as cL, type ViewComponentSlots as cM, type ViewConfig as cN, type ViewLayout as cO, type ViewMetric as cP, type ViewSubMetric as cQ, type WhereClause as cR, type WhereOperator as cS, type WhereOperatorName as cT, type WordLimitFieldAdmin as cU, type WordLimitFieldConfig as cV, type WorkflowMetadata as cW, type WorkflowRole as cX, type WorkflowState as cY, type WorkflowTransitionContext as cZ, defineAction as c_, type InferAggregateResult as ca, type JoinFieldAdmin as cb, type JsonFieldAdmin as cc, type JsonFormat as cd, LIFECYCLE_EVENT_NAMES as ce, type LifecycleEventHandler as cf, type LinkFormat as cg, type MetricColor as ch, type MultiSelectFieldAdmin as ci, type NamedAccessPolicy as cj, type NumberFieldAdmin as ck, type NumberFormat as cl, type NumberLimitFieldAdmin as cm, type NumberLimitFieldConfig as cn, type NumericOperation as co, type OIDCAdminAuthProvider as cp, type OptionFormat as cq, type PaginatedResult as cr, type PublicAdminAuthProvider as cs, type QueryCollectionResult as ct, type RAGSearchResult as cu, type RadioFieldAdmin as cv, type RateLimitConfig as cw, type ReadonlyDatabaseAdapter as cx, type RichTextFeature as cy, type RichTextFieldConfig as cz, type LifecycleEvent as d, defineCardsView as d0, defineGanttView as d1, defineKanbanView as d2, defineTableView as d3, defineView as d4, isAICollection as d5, parseMongoWhere as d6, parseSqlWhere as d7, type DyrectedObservabilityRuntime as d8, type RequestBodyCapture as d9, type RequestTraceContext as da, type ResolvedObservabilityConfig as db, attachRequestMetrics as dc, bindObservabilityRuntime as dd, buildRequestLogger as de, captureRequestBody as df, createDyrectedApp as dg, createObservabilityRuntime as dh, createRequestSpan as di, endRequestSpan as dj, getConfigLogger as dk, getObservabilityRuntime as dl, getRequestLogger as dm, redactBody as dn, redactHeaders as dp, renderPrometheusMetrics as dq, resolveObservabilityConfig as dr, shouldSampleRequest as ds, 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 };
3903
+ export { type JoinField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTabs as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTextOptions as I, type DetailText as J, type DetailSchema as K, type LifecycleEventName as L, type DyrectedContext as M, type AIConfig as N, type AIPIIConfig as O, type PublicAdminAuthConfig as P, type ArrayField as Q, type FieldType as R, type BooleanField as S, type AuthConfig as T, type AccessPolicyResolver as U, type DateField as V, type WorkflowConfig as W, type DateTimeField as X, type EmailField as Y, type IconField as Z, type ImageField as _, type DeclarativeHookExpression as a, type BooleanFieldAdmin as a$, type JsonField as a0, type MultiSelectField as a1, type NumberField as a2, type ObjectField as a3, type RadioField as a4, type RelationshipField as a5, type RichTextField as a6, type RowField as a7, type SelectField as a8, type TextField as a9, type ActionConfig as aA, type ActionConfigBase as aB, type ActionConfigWithHandler as aC, type ActionConfigWithMutation 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 AggregateCollectionResult as aT, type AggregateInput as aU, type AggregateOperation as aV, type AggregateResult as aW, type BaseAdminAuthProvider as aX, type BaseFieldAdmin as aY, type BlockVariant as aZ, type BlocksField as a_, type TextareaField as aa, type TimeField as ab, type UrlField as ac, type AIAction as ad, type AIActionStatus as ae, type AIActionType as af, type AIAuditActionType as ag, type AIAuditRecord as ah, type AIChunk as ai, type AIMessage as aj, type AIPIIPattern as ak, type AIRateLimitResult as al, type AIRateLimitStore as am, type AIThread as an, type AIToolContext as ao, type AIToolDefinition as ap, AI_ACTIONS_COLLECTION as aq, AI_AUDIT_COLLECTION as ar, AI_CHUNKS_COLLECTION as as, AI_MESSAGES_COLLECTION as at, AI_THREADS_COLLECTION as au, type AccessConfig as av, type AccessFunction as aw, type AccessFunctionArgs as ax, type AccessResult as ay, type AccessRule as az, type AuthenticatedUser as b, type GlobalAfterReadHookEntry as b$, type BooleanFormat as b0, type CharacterLimitFieldAdmin as b1, type CharacterLimitFieldConfig as b2, type CollectionAfterChangeHook as b3, type CollectionAfterDeleteHook as b4, type CollectionAfterReadHook as b5, type CollectionAfterReadHookEntry as b6, type CollectionAfterTransitionHook as b7, type CollectionBeforeChangeHook as b8, type CollectionBeforeChangeHookEntry as b9, type DistinctCountOperation as bA, type DistinctValuesOperation as bB, type DynamicOptionItem as bC, type DynamicOptionsConfig as bD, type DynamicOptionsResolver as bE, type DynamicOptionsResolverArgs as bF, type DyrectedAIContext as bG, type DyrectedLoggerConfig as bH, type DyrectedObservabilityConfig as bI, type EmailFieldAdmin as bJ, type FieldAdminHooks as bK, type FieldAdminOnChangeHook as bL, type FieldAdminOnChangeHookArgs as bM, type FieldAdminOptionsHook as bN, type FieldAdminOptionsHookArgs as bO, type FieldAdminOptionsHookResult as bP, type FieldAfterReadHook as bQ, type FieldAfterReadHookArgs as bR, type FieldBase as bS, type FieldBeforeChangeHook as bT, type FieldBeforeChangeHookArgs as bU, type FieldHook as bV, type FieldHooks as bW, type FileData as bX, type GetDocumentResult as bY, type GlobalAfterChangeHook as bZ, type GlobalAfterReadHook as b_, type CollectionBeforeDeleteHook as ba, type CollectionBeforeReadHook as bb, type CollectionBeforeReadHookEntry as bc, type CollectionBeforeTransitionHook as bd, type CollectionListComponentSlots as be, type CollectionRAGConfig as bf, type CollectionSchemaResult as bg, type CollectionSummaryResult as bh, type CollectionViewComponentSlots as bi, type CountOperation as bj, type CustomAdminAuthProvider as bk, type DatabaseAdapter as bl, type DateFieldAdmin as bm, type DateFormat as bn, type DefaultValueContext as bo, type DefineActionOptions as bp, type DefineCalendarViewOptions as bq, type DefineCardsViewOptions as br, type DefineGanttViewOptions as bs, type DefineKanbanViewOptions as bt, type DefineTableViewOptions as bu, type DefineViewBaseOptions as bv, type DefineViewOptions as bw, type DetailSpan as bx, type DisplayTone as by, type DisplayVariant as bz, type WorkflowTransition as c, type WorkflowTransitionContext as c$, type GlobalBeforeChangeHook as c0, type GlobalBeforeChangeHookEntry as c1, type GlobalBeforeReadHook as c2, type GlobalBeforeReadHookEntry as c3, type GlobalRAGConfig as c4, type GlobalSchemaResult as c5, type GlobalSummaryResult as c6, type HeadingLevel as c7, type HookFunction as c8, type IconFieldAdmin as c9, type RichTextFeature as cA, type RichTextFieldConfig as cB, type SelectFieldAdmin as cC, type SqlWhereResult as cD, type StorageAdapter as cE, type TextFieldAdmin as cF, type TextFormat as cG, type TextareaFieldAdmin as cH, type TrustProxyConfig as cI, type TypedField as cJ, type UploadConfig as cK, type UrlFieldAdmin as cL, type UrlLinkValue as cM, type ViewActionFeatures as cN, type ViewComponentSlots as cO, type ViewConfig as cP, type ViewLayout as cQ, type ViewMetric as cR, type ViewSubMetric as cS, type WhereClause as cT, type WhereOperator as cU, type WhereOperatorName as cV, type WordLimitFieldAdmin as cW, type WordLimitFieldConfig as cX, type WorkflowMetadata as cY, type WorkflowRole as cZ, type WorkflowState as c_, type ImageService as ca, type ImageTransformOptions as cb, type InferAggregateResult as cc, type JoinFieldAdmin as cd, type JsonFieldAdmin as ce, type JsonFormat as cf, LIFECYCLE_EVENT_NAMES as cg, type LifecycleEventHandler as ch, type LinkFormat as ci, type MetricColor as cj, type MultiSelectFieldAdmin as ck, type NamedAccessPolicy as cl, type NumberFieldAdmin as cm, type NumberFormat as cn, type NumberLimitFieldAdmin as co, type NumberLimitFieldConfig as cp, type NumericOperation as cq, type OIDCAdminAuthProvider as cr, type OptionFormat as cs, type PaginatedResult as ct, type PublicAdminAuthProvider as cu, type QueryCollectionResult as cv, type RAGSearchResult as cw, type RadioFieldAdmin as cx, type RateLimitConfig as cy, type ReadonlyDatabaseAdapter as cz, type LifecycleEvent as d, defineAction as d0, defineCalendarView as d1, defineCardsView as d2, defineGanttView as d3, defineKanbanView as d4, defineTableView as d5, defineView as d6, isAICollection as d7, parseMongoWhere as d8, parseSqlWhere as d9, verifyCollectionToken as dA, type CollectionTokenPayload as da, DEFAULT_SESSION_EXPIRY as db, type DyrectedObservabilityRuntime as dc, type RequestBodyCapture as dd, type RequestTraceContext as de, type ResolvedObservabilityConfig as df, attachRequestMetrics as dg, bindObservabilityRuntime as dh, buildRequestLogger as di, captureRequestBody as dj, createDyrectedApp as dk, createObservabilityRuntime as dl, createRequestSpan as dm, decodeCollectionToken as dn, endRequestSpan as dp, getConfigLogger as dq, getObservabilityRuntime as dr, getRequestLogger as ds, redactBody as dt, redactHeaders as du, renderPrometheusMetrics as dv, resolveObservabilityConfig as dw, resolveSessionTokenExpiry as dx, shouldSampleRequest as dy, signCollectionToken as dz, type BaseDocument as e, type DetailActionOptions as f, type DetailAction as g, type DetailComputedOptions as h, type ComputedHandler as i, type DetailComputed as j, type DetailCustomOptions as k, type DetailCustom as l, type DetailDividerOptions as m, type DetailDivider as n, type DisplayFieldOptions as o, type DetailField as p, type DetailItem as q, type DetailGridOptions as r, type DetailGrid as s, type DetailRepeatOptions as t, type DetailRepeat as u, type DetailSectionOptions as v, type DetailSection as w, type DetailTabOptions as x, type DetailTab as y, type DetailTabsOptions as z };
@@ -1153,10 +1153,44 @@ interface DetailCustom<TDoc = any> {
1153
1153
  /** Custom component options. */
1154
1154
  options?: DetailCustomOptions<TDoc>;
1155
1155
  }
1156
+ /**
1157
+ * Configuration options for rendering an action button in a Detail View.
1158
+ */
1159
+ interface DetailActionOptions {
1160
+ /** Grid column span across the 12-column grid. */
1161
+ span?: DetailSpan;
1162
+ /** Button visual style. Defaults to `'outline'`. */
1163
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive";
1164
+ /** Button size. Defaults to `'sm'`. */
1165
+ size?: "sm" | "default";
1166
+ /** Overrides the action's own `label` for this placement. */
1167
+ label?: string;
1168
+ /**
1169
+ * Visibility condition for this action item.
1170
+ * Can be a boolean or a JEXL expression evaluated against `{ doc, user }`.
1171
+ */
1172
+ visible?: string | boolean;
1173
+ }
1174
+ /**
1175
+ * Renders a button for a named action from `collection.actions` at this
1176
+ * position in a Detail View. The same action (and its confirm dialog, modal
1177
+ * fields, and execution) can also render automatically in the Detail View's
1178
+ * header toolbar when the action's `type` is `'header'` — placing it here
1179
+ * too does not duplicate that config, it just adds another entry point to
1180
+ * the same action.
1181
+ */
1182
+ interface DetailAction {
1183
+ /** Identifies this item as an action button. */
1184
+ type: "action";
1185
+ /** Name of the action, matching an entry in `collection.actions`. */
1186
+ name: string;
1187
+ /** Display and visibility options for this placement. */
1188
+ options?: DetailActionOptions;
1189
+ }
1156
1190
  /**
1157
1191
  * Union of all valid item types in a Detail View schema.
1158
1192
  */
1159
- type DetailItem<TDoc = any> = DetailSection | DetailTabs | DetailGrid | DetailField | DetailRepeat | DetailComputed<TDoc> | DetailDivider | DetailText | DetailCustom<TDoc> | string;
1193
+ type DetailItem<TDoc = any> = DetailSection | DetailTabs | DetailGrid | DetailField | DetailRepeat | DetailComputed<TDoc> | DetailDivider | DetailText | DetailCustom<TDoc> | DetailAction | string;
1160
1194
  /**
1161
1195
  * Detail View layout schema definition for a collection or global.
1162
1196
  */
@@ -1784,6 +1818,16 @@ interface AuthConfig {
1784
1818
  * Defaults to `10 * 60 * 1000` (10 minutes).
1785
1819
  */
1786
1820
  lockTime?: number;
1821
+ /**
1822
+ * How long issued session JWTs remain valid.
1823
+ *
1824
+ * Accepts the same values as `jose`'s `setExpirationTime` (e.g. `'15m'`,
1825
+ * `'12h'`, `'30d'`).
1826
+ *
1827
+ * Defaults to `'7d'`. Applies to login, registration, invite-accept, and
1828
+ * refresh-token issuance for this collection.
1829
+ */
1830
+ tokenExpiration?: string;
1787
1831
  /**
1788
1832
  * The role name designated as the superuser/admin role for this collection.
1789
1833
  *
@@ -2078,6 +2122,31 @@ interface CollectionConfig<TDoc extends object = Record<string, unknown>> {
2078
2122
  hidden?: boolean;
2079
2123
  /** If `false`, disables the filter UI entirely for this collection. Defaults to `true`. */
2080
2124
  filterable?: boolean;
2125
+ /**
2126
+ * Base query filter applied to this collection's default list view,
2127
+ * before user toolbar filters (e.g. `{ status: { equals: "published" } }`
2128
+ * or a JEXL string). Equivalent to `filter` on `defineView`, without
2129
+ * having to define a separate view and set it as the default.
2130
+ */
2131
+ filter?: Record<string, any> | string;
2132
+ /**
2133
+ * Default sort applied to this collection's default list view when first
2134
+ * opened. Equivalent to `sort` on `defineView`.
2135
+ */
2136
+ sort?: {
2137
+ field: string;
2138
+ direction: "asc" | "desc";
2139
+ };
2140
+ /**
2141
+ * KPI summary cards rendered above this collection's default list view.
2142
+ * Equivalent to `metrics` on `defineView`.
2143
+ */
2144
+ metrics?: ViewMetric[];
2145
+ /**
2146
+ * Field name used to organize this collection's default list view into
2147
+ * collapsible grouped sections. Equivalent to `groupBy` on `defineView`.
2148
+ */
2149
+ groupBy?: string;
2081
2150
  /**
2082
2151
  * Enables draft autosave in the Admin editor for workflow-enabled
2083
2152
  * collections. Defaults to `true` when the collection uses `workflow` or
@@ -2209,6 +2278,29 @@ interface CollectionConfig<TDoc extends object = Record<string, unknown>> {
2209
2278
  * @see {@link https://dyrected.com/docs/model-content/operational-views/overview Operational views overview}
2210
2279
  */
2211
2280
  views?: ViewConfig[];
2281
+ /**
2282
+ * Custom workflow actions for this collection, independent of any single view.
2283
+ * These run against one document at a time (no `viewSlug` required), so they
2284
+ * work anywhere a document is in scope — most notably the read-only Detail
2285
+ * View, where they can render in the header toolbar (`type: 'header'`) and/or
2286
+ * inline via `displayAction(name)` in the `detail` schema. The same action
2287
+ * definitions can also be referenced from a `defineView`'s own `actions` for
2288
+ * list-page use — they are not mutually exclusive.
2289
+ *
2290
+ * @example
2291
+ * ```ts
2292
+ * actions: [
2293
+ * defineAction({
2294
+ * name: "markShipped",
2295
+ * label: "Mark as shipped",
2296
+ * type: "header",
2297
+ * confirm: "Mark this order as shipped?",
2298
+ * mutation: { status: "shipped" },
2299
+ * }),
2300
+ * ]
2301
+ * ```
2302
+ */
2303
+ actions?: ActionConfig[];
2212
2304
  }
2213
2305
  /**
2214
2306
  * Defines a Dyrected global — a singleton document without pagination or IDs.
@@ -3650,6 +3742,27 @@ interface CollectionTokenPayload extends JWTPayload {
3650
3742
  providerId?: string;
3651
3743
  authSource?: 'local' | 'external';
3652
3744
  }
3745
+ declare const DEFAULT_SESSION_EXPIRY = "7d";
3746
+ /**
3747
+ * Resolve the session JWT lifetime for an auth collection.
3748
+ *
3749
+ * Reads `auth.tokenExpiration` when the collection configures auth as an
3750
+ * object, and falls back to `'7d'` for `auth: true` (or any missing/empty
3751
+ * value) so existing behavior is unchanged.
3752
+ */
3753
+ declare function resolveSessionTokenExpiry(collection: CollectionConfig): string;
3754
+ /**
3755
+ * Issue a signed JWT for a user document in an auth collection.
3756
+ */
3757
+ declare function signCollectionToken(payload: Omit<CollectionTokenPayload, 'iat' | 'exp'>, expiresIn?: string): Promise<string>;
3758
+ /**
3759
+ * Verify and decode a collection JWT. Throws if invalid or expired.
3760
+ */
3761
+ declare function verifyCollectionToken(token: string): Promise<CollectionTokenPayload>;
3762
+ /**
3763
+ * Decode a token without verification (read-only, for middleware that wants to be non-blocking).
3764
+ */
3765
+ declare function decodeCollectionToken(token: string): CollectionTokenPayload | null;
3653
3766
 
3654
3767
  type RequestVars = DyrectedContext["Variables"];
3655
3768
  interface ResolvedObservabilityConfig {
@@ -3787,4 +3900,4 @@ interface DyrectedContext {
3787
3900
  */
3788
3901
  declare function createDyrectedApp(rawConfig: DyrectedConfig | any): Promise<Hono<DyrectedContext, hono_types.BlankSchema, "/">>;
3789
3902
 
3790
- export { type MultiSelectField 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 DyrectedContext as J, type AIConfig as K, type LifecycleEventName as L, type AIPIIConfig as M, type ArrayField as N, type FieldType as O, type PublicAdminAuthConfig as P, type BooleanField as Q, type AuthConfig as R, type AccessPolicyResolver as S, type DateField as T, type DateTimeField as U, type EmailField as V, type WorkflowConfig as W, type IconField as X, type ImageField as Y, type JoinField as Z, type JsonField as _, type DeclarativeHookExpression as a, type CharacterLimitFieldAdmin as a$, type NumberField as a0, type ObjectField as a1, type RadioField as a2, type RelationshipField as a3, type RichTextField as a4, type RowField as a5, type SelectField as a6, type TextField as a7, type TextareaField as a8, type TimeField as a9, type ActionConfigWithHandler as aA, type ActionConfigWithMutation as aB, type ActionContext as aC, type ActionType as aD, type AdminAuthAccessResolution as aE, type AdminAuthClaimMapping as aF, type AdminAuthMember as aG, type AdminAuthProvider as aH, type AdminAuthProviderMembersConfig as aI, type AdminAuthProvisioningMode as aJ, type AdminAuthResolveAccessArgs as aK, type AdminAuthResolvedIdentity as aL, type AdminConfig as aM, type AdminDashboardComponentSlots as aN, type AdminIconName as aO, type AggregateArgs as aP, type AggregateCastType as aQ, type AggregateCollectionResult as aR, type AggregateInput as aS, type AggregateOperation as aT, type AggregateResult as aU, type BaseAdminAuthProvider as aV, type BaseFieldAdmin as aW, type BlockVariant as aX, type BlocksField as aY, type BooleanFieldAdmin as aZ, type BooleanFormat as a_, type UrlField as aa, type AIAction as ab, type AIActionStatus as ac, type AIActionType as ad, type AIAuditActionType as ae, type AIAuditRecord as af, type AIChunk as ag, type AIMessage as ah, type AIPIIPattern as ai, type AIRateLimitResult as aj, type AIRateLimitStore as ak, type AIThread as al, type AIToolContext as am, type AIToolDefinition as an, AI_ACTIONS_COLLECTION as ao, AI_AUDIT_COLLECTION as ap, AI_CHUNKS_COLLECTION as aq, AI_MESSAGES_COLLECTION as ar, AI_THREADS_COLLECTION as as, type AccessConfig as at, type AccessFunction as au, type AccessFunctionArgs as av, type AccessResult as aw, type AccessRule as ax, type ActionConfig as ay, type ActionConfigBase as az, type AuthenticatedUser as b, type GlobalBeforeChangeHookEntry as b$, type CharacterLimitFieldConfig as b0, type CollectionAfterChangeHook as b1, type CollectionAfterDeleteHook as b2, type CollectionAfterReadHook as b3, type CollectionAfterReadHookEntry as b4, type CollectionAfterTransitionHook as b5, type CollectionBeforeChangeHook as b6, type CollectionBeforeChangeHookEntry as b7, type CollectionBeforeDeleteHook as b8, type CollectionBeforeReadHook as b9, type DynamicOptionItem as bA, type DynamicOptionsConfig as bB, type DynamicOptionsResolver as bC, type DynamicOptionsResolverArgs as bD, type DyrectedAIContext as bE, type DyrectedLoggerConfig as bF, type DyrectedObservabilityConfig as bG, type EmailFieldAdmin as bH, type FieldAdminHooks as bI, type FieldAdminOnChangeHook as bJ, type FieldAdminOnChangeHookArgs as bK, type FieldAdminOptionsHook as bL, type FieldAdminOptionsHookArgs as bM, type FieldAdminOptionsHookResult as bN, type FieldAfterReadHook as bO, type FieldAfterReadHookArgs as bP, type FieldBase as bQ, type FieldBeforeChangeHook as bR, type FieldBeforeChangeHookArgs as bS, type FieldHook as bT, type FieldHooks as bU, type FileData as bV, type GetDocumentResult as bW, type GlobalAfterChangeHook as bX, type GlobalAfterReadHook as bY, type GlobalAfterReadHookEntry as bZ, type GlobalBeforeChangeHook as b_, type CollectionBeforeReadHookEntry as ba, type CollectionBeforeTransitionHook as bb, type CollectionListComponentSlots as bc, type CollectionRAGConfig as bd, type CollectionSchemaResult as be, type CollectionSummaryResult as bf, type CollectionViewComponentSlots as bg, type CountOperation as bh, type CustomAdminAuthProvider as bi, type DatabaseAdapter as bj, type DateFieldAdmin as bk, type DateFormat as bl, type DefaultValueContext as bm, type DefineActionOptions as bn, type DefineCalendarViewOptions as bo, type DefineCardsViewOptions as bp, type DefineGanttViewOptions as bq, type DefineKanbanViewOptions as br, type DefineTableViewOptions as bs, type DefineViewBaseOptions as bt, type DefineViewOptions as bu, type DetailSpan as bv, type DisplayTone as bw, type DisplayVariant as bx, type DistinctCountOperation as by, type DistinctValuesOperation as bz, type WorkflowTransition as c, defineCalendarView as c$, type GlobalBeforeReadHook as c0, type GlobalBeforeReadHookEntry as c1, type GlobalRAGConfig as c2, type GlobalSchemaResult as c3, type GlobalSummaryResult as c4, type HeadingLevel as c5, type HookFunction as c6, type IconFieldAdmin as c7, type ImageService as c8, type ImageTransformOptions as c9, type SelectFieldAdmin as cA, type SqlWhereResult as cB, type StorageAdapter as cC, type TextFieldAdmin as cD, type TextFormat as cE, type TextareaFieldAdmin as cF, type TrustProxyConfig as cG, type TypedField as cH, type UploadConfig as cI, type UrlFieldAdmin as cJ, type UrlLinkValue as cK, type ViewActionFeatures as cL, type ViewComponentSlots as cM, type ViewConfig as cN, type ViewLayout as cO, type ViewMetric as cP, type ViewSubMetric as cQ, type WhereClause as cR, type WhereOperator as cS, type WhereOperatorName as cT, type WordLimitFieldAdmin as cU, type WordLimitFieldConfig as cV, type WorkflowMetadata as cW, type WorkflowRole as cX, type WorkflowState as cY, type WorkflowTransitionContext as cZ, defineAction as c_, type InferAggregateResult as ca, type JoinFieldAdmin as cb, type JsonFieldAdmin as cc, type JsonFormat as cd, LIFECYCLE_EVENT_NAMES as ce, type LifecycleEventHandler as cf, type LinkFormat as cg, type MetricColor as ch, type MultiSelectFieldAdmin as ci, type NamedAccessPolicy as cj, type NumberFieldAdmin as ck, type NumberFormat as cl, type NumberLimitFieldAdmin as cm, type NumberLimitFieldConfig as cn, type NumericOperation as co, type OIDCAdminAuthProvider as cp, type OptionFormat as cq, type PaginatedResult as cr, type PublicAdminAuthProvider as cs, type QueryCollectionResult as ct, type RAGSearchResult as cu, type RadioFieldAdmin as cv, type RateLimitConfig as cw, type ReadonlyDatabaseAdapter as cx, type RichTextFeature as cy, type RichTextFieldConfig as cz, type LifecycleEvent as d, defineCardsView as d0, defineGanttView as d1, defineKanbanView as d2, defineTableView as d3, defineView as d4, isAICollection as d5, parseMongoWhere as d6, parseSqlWhere as d7, type DyrectedObservabilityRuntime as d8, type RequestBodyCapture as d9, type RequestTraceContext as da, type ResolvedObservabilityConfig as db, attachRequestMetrics as dc, bindObservabilityRuntime as dd, buildRequestLogger as de, captureRequestBody as df, createDyrectedApp as dg, createObservabilityRuntime as dh, createRequestSpan as di, endRequestSpan as dj, getConfigLogger as dk, getObservabilityRuntime as dl, getRequestLogger as dm, redactBody as dn, redactHeaders as dp, renderPrometheusMetrics as dq, resolveObservabilityConfig as dr, shouldSampleRequest as ds, 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 };
3903
+ export { type JoinField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTabs as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTextOptions as I, type DetailText as J, type DetailSchema as K, type LifecycleEventName as L, type DyrectedContext as M, type AIConfig as N, type AIPIIConfig as O, type PublicAdminAuthConfig as P, type ArrayField as Q, type FieldType as R, type BooleanField as S, type AuthConfig as T, type AccessPolicyResolver as U, type DateField as V, type WorkflowConfig as W, type DateTimeField as X, type EmailField as Y, type IconField as Z, type ImageField as _, type DeclarativeHookExpression as a, type BooleanFieldAdmin as a$, type JsonField as a0, type MultiSelectField as a1, type NumberField as a2, type ObjectField as a3, type RadioField as a4, type RelationshipField as a5, type RichTextField as a6, type RowField as a7, type SelectField as a8, type TextField as a9, type ActionConfig as aA, type ActionConfigBase as aB, type ActionConfigWithHandler as aC, type ActionConfigWithMutation 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 AggregateCollectionResult as aT, type AggregateInput as aU, type AggregateOperation as aV, type AggregateResult as aW, type BaseAdminAuthProvider as aX, type BaseFieldAdmin as aY, type BlockVariant as aZ, type BlocksField as a_, type TextareaField as aa, type TimeField as ab, type UrlField as ac, type AIAction as ad, type AIActionStatus as ae, type AIActionType as af, type AIAuditActionType as ag, type AIAuditRecord as ah, type AIChunk as ai, type AIMessage as aj, type AIPIIPattern as ak, type AIRateLimitResult as al, type AIRateLimitStore as am, type AIThread as an, type AIToolContext as ao, type AIToolDefinition as ap, AI_ACTIONS_COLLECTION as aq, AI_AUDIT_COLLECTION as ar, AI_CHUNKS_COLLECTION as as, AI_MESSAGES_COLLECTION as at, AI_THREADS_COLLECTION as au, type AccessConfig as av, type AccessFunction as aw, type AccessFunctionArgs as ax, type AccessResult as ay, type AccessRule as az, type AuthenticatedUser as b, type GlobalAfterReadHookEntry as b$, type BooleanFormat as b0, type CharacterLimitFieldAdmin as b1, type CharacterLimitFieldConfig as b2, type CollectionAfterChangeHook as b3, type CollectionAfterDeleteHook as b4, type CollectionAfterReadHook as b5, type CollectionAfterReadHookEntry as b6, type CollectionAfterTransitionHook as b7, type CollectionBeforeChangeHook as b8, type CollectionBeforeChangeHookEntry as b9, type DistinctCountOperation as bA, type DistinctValuesOperation as bB, type DynamicOptionItem as bC, type DynamicOptionsConfig as bD, type DynamicOptionsResolver as bE, type DynamicOptionsResolverArgs as bF, type DyrectedAIContext as bG, type DyrectedLoggerConfig as bH, type DyrectedObservabilityConfig as bI, type EmailFieldAdmin as bJ, type FieldAdminHooks as bK, type FieldAdminOnChangeHook as bL, type FieldAdminOnChangeHookArgs as bM, type FieldAdminOptionsHook as bN, type FieldAdminOptionsHookArgs as bO, type FieldAdminOptionsHookResult as bP, type FieldAfterReadHook as bQ, type FieldAfterReadHookArgs as bR, type FieldBase as bS, type FieldBeforeChangeHook as bT, type FieldBeforeChangeHookArgs as bU, type FieldHook as bV, type FieldHooks as bW, type FileData as bX, type GetDocumentResult as bY, type GlobalAfterChangeHook as bZ, type GlobalAfterReadHook as b_, type CollectionBeforeDeleteHook as ba, type CollectionBeforeReadHook as bb, type CollectionBeforeReadHookEntry as bc, type CollectionBeforeTransitionHook as bd, type CollectionListComponentSlots as be, type CollectionRAGConfig as bf, type CollectionSchemaResult as bg, type CollectionSummaryResult as bh, type CollectionViewComponentSlots as bi, type CountOperation as bj, type CustomAdminAuthProvider as bk, type DatabaseAdapter as bl, type DateFieldAdmin as bm, type DateFormat as bn, type DefaultValueContext as bo, type DefineActionOptions as bp, type DefineCalendarViewOptions as bq, type DefineCardsViewOptions as br, type DefineGanttViewOptions as bs, type DefineKanbanViewOptions as bt, type DefineTableViewOptions as bu, type DefineViewBaseOptions as bv, type DefineViewOptions as bw, type DetailSpan as bx, type DisplayTone as by, type DisplayVariant as bz, type WorkflowTransition as c, type WorkflowTransitionContext as c$, type GlobalBeforeChangeHook as c0, type GlobalBeforeChangeHookEntry as c1, type GlobalBeforeReadHook as c2, type GlobalBeforeReadHookEntry as c3, type GlobalRAGConfig as c4, type GlobalSchemaResult as c5, type GlobalSummaryResult as c6, type HeadingLevel as c7, type HookFunction as c8, type IconFieldAdmin as c9, type RichTextFeature as cA, type RichTextFieldConfig as cB, type SelectFieldAdmin as cC, type SqlWhereResult as cD, type StorageAdapter as cE, type TextFieldAdmin as cF, type TextFormat as cG, type TextareaFieldAdmin as cH, type TrustProxyConfig as cI, type TypedField as cJ, type UploadConfig as cK, type UrlFieldAdmin as cL, type UrlLinkValue as cM, type ViewActionFeatures as cN, type ViewComponentSlots as cO, type ViewConfig as cP, type ViewLayout as cQ, type ViewMetric as cR, type ViewSubMetric as cS, type WhereClause as cT, type WhereOperator as cU, type WhereOperatorName as cV, type WordLimitFieldAdmin as cW, type WordLimitFieldConfig as cX, type WorkflowMetadata as cY, type WorkflowRole as cZ, type WorkflowState as c_, type ImageService as ca, type ImageTransformOptions as cb, type InferAggregateResult as cc, type JoinFieldAdmin as cd, type JsonFieldAdmin as ce, type JsonFormat as cf, LIFECYCLE_EVENT_NAMES as cg, type LifecycleEventHandler as ch, type LinkFormat as ci, type MetricColor as cj, type MultiSelectFieldAdmin as ck, type NamedAccessPolicy as cl, type NumberFieldAdmin as cm, type NumberFormat as cn, type NumberLimitFieldAdmin as co, type NumberLimitFieldConfig as cp, type NumericOperation as cq, type OIDCAdminAuthProvider as cr, type OptionFormat as cs, type PaginatedResult as ct, type PublicAdminAuthProvider as cu, type QueryCollectionResult as cv, type RAGSearchResult as cw, type RadioFieldAdmin as cx, type RateLimitConfig as cy, type ReadonlyDatabaseAdapter as cz, type LifecycleEvent as d, defineAction as d0, defineCalendarView as d1, defineCardsView as d2, defineGanttView as d3, defineKanbanView as d4, defineTableView as d5, defineView as d6, isAICollection as d7, parseMongoWhere as d8, parseSqlWhere as d9, verifyCollectionToken as dA, type CollectionTokenPayload as da, DEFAULT_SESSION_EXPIRY as db, type DyrectedObservabilityRuntime as dc, type RequestBodyCapture as dd, type RequestTraceContext as de, type ResolvedObservabilityConfig as df, attachRequestMetrics as dg, bindObservabilityRuntime as dh, buildRequestLogger as di, captureRequestBody as dj, createDyrectedApp as dk, createObservabilityRuntime as dl, createRequestSpan as dm, decodeCollectionToken as dn, endRequestSpan as dp, getConfigLogger as dq, getObservabilityRuntime as dr, getRequestLogger as ds, redactBody as dt, redactHeaders as du, renderPrometheusMetrics as dv, resolveObservabilityConfig as dw, resolveSessionTokenExpiry as dx, shouldSampleRequest as dy, signCollectionToken as dz, type BaseDocument as e, type DetailActionOptions as f, type DetailAction as g, type DetailComputedOptions as h, type ComputedHandler as i, type DetailComputed as j, type DetailCustomOptions as k, type DetailCustom as l, type DetailDividerOptions as m, type DetailDivider as n, type DisplayFieldOptions as o, type DetailField as p, type DetailItem as q, type DetailGridOptions as r, type DetailGrid as s, type DetailRepeatOptions as t, type DetailRepeat as u, type DetailSectionOptions as v, type DetailSection as w, type DetailTabOptions as x, type DetailTab as y, type DetailTabsOptions as z };
package/dist/index.cjs CHANGED
@@ -1791,13 +1791,18 @@ __export(index_exports, {
1791
1791
  AI_THREADS_COLLECTION: () => AI_THREADS_COLLECTION,
1792
1792
  BUILTIN_JEXL_HELPERS: () => BUILTIN_JEXL_HELPERS,
1793
1793
  ConfigValidationError: () => ConfigValidationError,
1794
+ ConflictError: () => ConflictError,
1794
1795
  DyrectedAIError: () => DyrectedAIError,
1796
+ DyrectedError: () => DyrectedError,
1795
1797
  FieldConditionBuilder: () => FieldConditionBuilder,
1798
+ ForbiddenError: () => ForbiddenError,
1796
1799
  LIFECYCLE_EVENTS_COLLECTION: () => LIFECYCLE_EVENTS_COLLECTION,
1797
1800
  LIFECYCLE_EVENT_NAMES: () => LIFECYCLE_EVENT_NAMES,
1798
1801
  MatchBuilder: () => MatchBuilder,
1799
1802
  NON_NEGOTIABLE_CREDENTIAL_FIELDS: () => NON_NEGOTIABLE_CREDENTIAL_FIELDS,
1803
+ NotFoundError: () => NotFoundError,
1800
1804
  PII_REGEX_PATTERNS: () => PII_REGEX_PATTERNS,
1805
+ ValidationError: () => ValidationError,
1801
1806
  WORKFLOW_HISTORY_COLLECTION: () => WORKFLOW_HISTORY_COLLECTION,
1802
1807
  abs: () => abs,
1803
1808
  addDays: () => addDays,
@@ -1864,6 +1869,7 @@ __export(index_exports, {
1864
1869
  diffDays: () => diffDays,
1865
1870
  dispatchLifecycleEvent: () => dispatchLifecycleEvent,
1866
1871
  dispatchPendingLifecycleEvents: () => dispatchPendingLifecycleEvents,
1872
+ displayAction: () => displayAction,
1867
1873
  displayComputed: () => displayComputed,
1868
1874
  displayCustom: () => displayCustom,
1869
1875
  displayCustomComponent: () => displayCustomComponent,
@@ -3890,6 +3896,45 @@ function normalizeConfig(config) {
3890
3896
  };
3891
3897
  }
3892
3898
 
3899
+ // src/utils/errors.ts
3900
+ var DyrectedError = class _DyrectedError extends Error {
3901
+ statusCode;
3902
+ constructor(message, statusCode = 500) {
3903
+ super(message);
3904
+ this.name = "DyrectedError";
3905
+ this.statusCode = statusCode;
3906
+ Object.setPrototypeOf(this, _DyrectedError.prototype);
3907
+ }
3908
+ };
3909
+ var ValidationError = class _ValidationError extends DyrectedError {
3910
+ constructor(message) {
3911
+ super(message, 400);
3912
+ this.name = "ValidationError";
3913
+ Object.setPrototypeOf(this, _ValidationError.prototype);
3914
+ }
3915
+ };
3916
+ var ForbiddenError = class _ForbiddenError extends DyrectedError {
3917
+ constructor(message) {
3918
+ super(message, 403);
3919
+ this.name = "ForbiddenError";
3920
+ Object.setPrototypeOf(this, _ForbiddenError.prototype);
3921
+ }
3922
+ };
3923
+ var NotFoundError = class _NotFoundError extends DyrectedError {
3924
+ constructor(message) {
3925
+ super(message, 404);
3926
+ this.name = "NotFoundError";
3927
+ Object.setPrototypeOf(this, _NotFoundError.prototype);
3928
+ }
3929
+ };
3930
+ var ConflictError = class _ConflictError extends DyrectedError {
3931
+ constructor(message) {
3932
+ super(message, 409);
3933
+ this.name = "ConflictError";
3934
+ Object.setPrototypeOf(this, _ConflictError.prototype);
3935
+ }
3936
+ };
3937
+
3893
3938
  // src/utils/parse-where.ts
3894
3939
  function assertNever(op, context) {
3895
3940
  throw new Error(`[dyrected/core] Unhandled where operator "${op}" in ${context}`);
@@ -5749,6 +5794,13 @@ function displayCustom(name, options) {
5749
5794
  function displayCustomComponent(name, options) {
5750
5795
  return displayCustom(name, options);
5751
5796
  }
5797
+ function displayAction(name, options) {
5798
+ return {
5799
+ type: "action",
5800
+ name,
5801
+ options
5802
+ };
5803
+ }
5752
5804
  async function evaluateDetailComputed(detail, doc, user, db) {
5753
5805
  if (!doc || !detail || !Array.isArray(detail)) {
5754
5806
  return doc;
@@ -5821,6 +5873,12 @@ function generateDefaultDetailSchema(schema) {
5821
5873
  if (SENSITIVE_DETAIL_FIELDS.has(field.name)) continue;
5822
5874
  if (field.hidden) continue;
5823
5875
  if (field.admin?.hidden) continue;
5876
+ if (field.type === "join") {
5877
+ const joinColumns = field.admin?.columns;
5878
+ const repeatItems = Array.isArray(joinColumns) && joinColumns.length > 0 ? joinColumns.map((col) => displayField(col, { span: 12 })) : [displayComputed("Item", "doc.title || doc.name || doc.label || doc.slug || doc.id")];
5879
+ mainFields.push(displayRepeat(field.name, repeatItems, { span: 12, layout: "table" }));
5880
+ continue;
5881
+ }
5824
5882
  const isSidebar = sidebarFieldTypes.has(field.type) && field.type !== "relationship" && !field.hasMany;
5825
5883
  if (isSidebar && sidebarFields.length < 5) {
5826
5884
  sidebarFields.push(
@@ -6563,13 +6621,18 @@ function defineTab(args) {
6563
6621
  AI_THREADS_COLLECTION,
6564
6622
  BUILTIN_JEXL_HELPERS,
6565
6623
  ConfigValidationError,
6624
+ ConflictError,
6566
6625
  DyrectedAIError,
6626
+ DyrectedError,
6567
6627
  FieldConditionBuilder,
6628
+ ForbiddenError,
6568
6629
  LIFECYCLE_EVENTS_COLLECTION,
6569
6630
  LIFECYCLE_EVENT_NAMES,
6570
6631
  MatchBuilder,
6571
6632
  NON_NEGOTIABLE_CREDENTIAL_FIELDS,
6633
+ NotFoundError,
6572
6634
  PII_REGEX_PATTERNS,
6635
+ ValidationError,
6573
6636
  WORKFLOW_HISTORY_COLLECTION,
6574
6637
  abs,
6575
6638
  addDays,
@@ -6636,6 +6699,7 @@ function defineTab(args) {
6636
6699
  diffDays,
6637
6700
  dispatchLifecycleEvent,
6638
6701
  dispatchPendingLifecycleEvents,
6702
+ displayAction,
6639
6703
  displayComputed,
6640
6704
  displayCustom,
6641
6705
  displayCustomComponent,