@dyrected/core 2.20.0 → 2.21.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.
@@ -553,11 +553,19 @@ type InferAggregateResult<T extends AggregateInput> = {
553
553
  * so adding a new operator without handling it will produce a TypeScript error
554
554
  * in every adapter translator.
555
555
  */
556
- type WhereOperatorName = 'equals' | 'not_equals' | 'in' | 'not_in' | 'gt' | 'greater_than' | 'gte' | 'greater_than_equal' | 'greater_than_or_equal' | 'lt' | 'less_than' | 'lte' | 'less_than_equal' | 'less_than_or_equal' | 'contains' | 'like' | 'starts_with' | 'exists';
556
+ type WhereOperatorName = 'equals' | 'not_equals' | 'not' | 'ne' | 'not_equal' | 'notEquals' | 'in' | 'not_in' | 'gt' | 'greater_than' | 'gte' | 'greater_than_equal' | 'greater_than_or_equal' | 'lt' | 'less_than' | 'lte' | 'less_than_equal' | 'less_than_or_equal' | 'contains' | 'like' | 'starts_with' | 'exists';
557
557
  type WhereOperator = {
558
558
  equals: any;
559
559
  } | {
560
560
  not_equals: any;
561
+ } | {
562
+ not: any;
563
+ } | {
564
+ ne: any;
565
+ } | {
566
+ not_equal: any;
567
+ } | {
568
+ notEquals: any;
561
569
  } | {
562
570
  in: any[];
563
571
  } | {
@@ -598,6 +606,8 @@ type WhereClause = {
598
606
  or?: WhereClause[] | readonly WhereClause[];
599
607
  AND?: WhereClause[] | readonly WhereClause[];
600
608
  and?: WhereClause[] | readonly WhereClause[];
609
+ NOT?: WhereClause[] | readonly WhereClause[] | WhereClause;
610
+ not?: WhereClause[] | readonly WhereClause[] | WhereClause;
601
611
  };
602
612
  interface SqlWhereResult {
603
613
  sql: string;
@@ -704,9 +714,24 @@ type MetricColor = 'purple' | 'emerald' | 'amber' | 'rose' | 'blue' | 'indigo' |
704
714
  * }
705
715
  * ```
706
716
  */
717
+ interface ViewMetricGroupByConfig {
718
+ /** Field or relationship name to group by. */
719
+ field: string;
720
+ /** Maximum number of groups to evaluate (defaults to 12). */
721
+ limit?: number;
722
+ /** Optional explicit ordering: `'count'` (descending) or `'asc'` / `'desc'`. */
723
+ orderBy?: 'count' | 'asc' | 'desc';
724
+ /** Optional where filter when discovering groups. */
725
+ where?: Record<string, unknown>;
726
+ }
727
+ type ViewMetricGroupBy = string | ViewMetricGroupByConfig;
707
728
  interface ViewSubMetric {
708
- /** Short label for the sub-metric (e.g. "Pending", "Collected"). */
729
+ /** Short label for the sub-metric (e.g. "Pending", "Collected"). Supports `{{group.label}}` and `{{group.value}}` when `groupBy` is used. */
709
730
  label: string;
731
+ /** Filter scope override for this sub-metric: `'view' | 'filtered' | 'collection'`. Defaults to parent metric's scope. */
732
+ scope?: 'view' | 'filtered' | 'collection';
733
+ /** Dynamic breakdown: groups this sub-metric by a field or relationship, expanding into multiple sub-metric rows in the card footer. */
734
+ groupBy?: ViewMetricGroupBy;
710
735
  /** Single database aggregate operation. */
711
736
  aggregate?: AggregateOperation;
712
737
  /** Map of named aggregate operations referenced in `expression` as `aggregates.key`. */
@@ -737,12 +762,22 @@ interface ViewSubMetric {
737
762
  * ```
738
763
  */
739
764
  interface ViewMetric {
740
- /** Title displayed on the metric card header. */
765
+ /** Title displayed on the metric card header. Supports `{{group.label}}` and `{{group.value}}` when `groupBy` is used. */
741
766
  label: string;
742
767
  /** Accent color for the card's visual indicator. */
743
768
  color?: MetricColor;
744
769
  /** Unit badge shown alongside the numeric value (e.g. `"Guests"`, `"Orders"`, `"Tables"`). */
745
770
  unit?: string;
771
+ /**
772
+ * Filter scope for this metric card:
773
+ * - `'view'`: evaluates within the view's base filter (default)
774
+ * - `'filtered'`: live summary reflecting active table/toolbar filters & search
775
+ * - `'collection'`: global collection totals ignoring view filters
776
+ * Defaults to view's `metricsScope` (or `'view'`).
777
+ */
778
+ scope?: 'view' | 'filtered' | 'collection';
779
+ /** Dynamic breakdown: groups this metric by a field or relationship, expanding into 1 card per group. */
780
+ groupBy?: ViewMetricGroupBy;
746
781
  /** Single database aggregate operation (`count`, `distinctCount`, `sum`, `avg`, `min`, `max`). */
747
782
  aggregate?: AggregateOperation;
748
783
  /** Map of named aggregate operations referenced in `expression` as `aggregates.key`. */
@@ -858,6 +893,13 @@ interface ViewConfigBase {
858
893
  actionOrder?: string[];
859
894
  /** KPI summary cards rendered in the hero row above the view. */
860
895
  metrics?: ViewMetric[];
896
+ /**
897
+ * Default filter scope for all metric cards in this view:
898
+ * - `'view'`: evaluates within the view's base filter (default)
899
+ * - `'filtered'`: live summary reflecting active table/toolbar filters & search
900
+ * - `'collection'`: global collection totals ignoring view filters
901
+ */
902
+ metricsScope?: 'view' | 'filtered' | 'collection';
861
903
  /** Optional real-time counter badge or status indicator displayed on this view in navigation and tabs. */
862
904
  badge?: NavBadgeConfig | string;
863
905
  /** Custom component slots rendered around this operational view. */
@@ -4464,4 +4506,4 @@ interface DyrectedContext {
4464
4506
  */
4465
4507
  declare function createDyrectedApp(rawConfig: DyrectedConfig | any): Promise<Hono<DyrectedContext, hono_types.BlankSchema, "/">>;
4466
4508
 
4467
- export { type RelationshipField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTab as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTabsOptions as I, type DetailTabs as J, type DetailTextOptions as K, type LifecycleEventName as L, type DetailText as M, type DetailSchema as N, type DyrectedContext as O, type PublicAdminAuthConfig as P, type AIConfig as Q, type AIPIIConfig as R, type IdStrategy as S, type TaskRunResult as T, type CompiledNavTree as U, type CompiledNavItem as V, type WorkflowConfig as W, type UserNavigationPreferences as X, type DefineWorkspaceOptions as Y, type ViewConfig as Z, type DateTimeField as _, type DeclarativeHookExpression as a, type AggregateArgs as a$, type SelectField as a0, type ArrayField as a1, type FieldType as a2, type BooleanField as a3, type AuthConfig as a4, type AccessPolicyResolver as a5, type DateField as a6, type TextField as a7, type EmailField as a8, type IconField as a9, AI_ACTIONS_COLLECTION as aA, AI_AUDIT_COLLECTION as aB, AI_CHUNKS_COLLECTION as aC, AI_MESSAGES_COLLECTION as aD, AI_THREADS_COLLECTION as aE, type AccessConfig as aF, type AccessFunction as aG, type AccessFunctionArgs as aH, type AccessResult as aI, type AccessRule as aJ, type ActionConfig as aK, type ActionConfigBase as aL, type ActionConfigWithHandler as aM, type ActionConfigWithMutation as aN, type ActionContext as aO, type ActionType as aP, type AdminAuthAccessResolution as aQ, type AdminAuthClaimMapping as aR, type AdminAuthMember as aS, type AdminAuthProvider as aT, type AdminAuthProviderMembersConfig as aU, type AdminAuthProvisioningMode as aV, type AdminAuthResolveAccessArgs as aW, type AdminAuthResolvedIdentity as aX, type AdminConfig as aY, type AdminDashboardComponentSlots as aZ, type AdminIconName as a_, type ImageField as aa, type JoinField as ab, type JsonField as ac, type MoneyField as ad, type MultiSelectField as ae, type NumberField as af, type ObjectField as ag, type RadioField as ah, type RichTextField as ai, type RowField as aj, type TextareaField as ak, type TimeField as al, type UrlField as am, type AIAction as an, type AIActionStatus as ao, type AIActionType as ap, type AIAuditActionType as aq, type AIAuditRecord as ar, type AIChunk as as, type AIMessage as at, type AIPIIPattern as au, type AIRateLimitResult as av, type AIRateLimitStore as aw, type AIThread as ax, type AIToolContext as ay, type AIToolDefinition as az, type AuthenticatedUser as b, type DynamicOptionsResolverArgs as b$, type AggregateCastType as b0, type AggregateCollectionResult as b1, type AggregateInput as b2, type AggregateOperation as b3, type AggregateResult as b4, type AppTrashConfig as b5, type BaseAdminAuthProvider as b6, type BaseFieldAdmin as b7, type BlockVariant as b8, type BlocksField as b9, type CollectionRAGConfig as bA, type CollectionSchemaResult as bB, type CollectionSummaryResult as bC, type CollectionViewComponentSlots as bD, type CompiledNavGroup as bE, type CountOperation as bF, type CustomAdminAuthProvider as bG, DEFAULT_USER_NAV_PREFERENCES as bH, type DateFieldAdmin as bI, type DateFormat as bJ, type DefaultValueContext as bK, type DefineActionOptions as bL, type DefineCalendarViewOptions as bM, type DefineCardsViewOptions as bN, type DefineGanttViewOptions as bO, type DefineKanbanViewOptions as bP, type DefineTableViewOptions as bQ, type DefineViewBaseOptions as bR, type DefineViewOptions as bS, type DetailSpan as bT, type DisplayTone as bU, type DisplayVariant as bV, type DistinctCountOperation as bW, type DistinctValuesOperation as bX, type DynamicOptionItem as bY, type DynamicOptionsConfig as bZ, type DynamicOptionsResolver as b_, type BooleanFieldAdmin as ba, type BooleanFormat as bb, CURRENT_NAV_PREFERENCES_VERSION as bc, type CalendarViewConfig as bd, type CardsViewConfig as be, type CharacterLimitFieldAdmin as bf, type CharacterLimitFieldConfig as bg, type CollectionAfterChangeHook as bh, type CollectionAfterDeleteHook as bi, type CollectionAfterReadHook as bj, type CollectionAfterReadHookEntry as bk, type CollectionAfterRestoreHook as bl, type CollectionAfterTransitionHook as bm, type CollectionAfterTrashHook as bn, type CollectionBeforeChangeHook as bo, type CollectionBeforeChangeHookEntry as bp, type CollectionBeforeCommitHook as bq, type CollectionBeforeDeleteHook as br, type CollectionBeforeReadHook as bs, type CollectionBeforeReadHookEntry as bt, type CollectionBeforeRestoreHook as bu, type CollectionBeforeTransitionHook as bv, type CollectionBeforeTrashHook as bw, type CollectionEmailConfig as bx, type CollectionIndex as by, type CollectionListComponentSlots as bz, type WorkflowTransition as c, type PublicAdminAuthProvider as c$, type DyrectedAIContext as c0, type DyrectedLoggerConfig as c1, type DyrectedObservabilityConfig as c2, type EmailFieldAdmin as c3, type EmailTemplateArgs as c4, type EmailTemplateResult as c5, type FieldAdminHooks as c6, type FieldAdminOnChangeHook as c7, type FieldAdminOnChangeHookArgs as c8, type FieldAdminOptionsHook as c9, type ImageTransformOptions as cA, type InferAggregateResult as cB, type JoinFieldAdmin as cC, type JsonFieldAdmin as cD, type JsonFormat as cE, type KanbanViewConfig as cF, LIFECYCLE_EVENT_NAMES as cG, type LifecycleEventHandler as cH, type LinkFormat as cI, type MetricColor as cJ, type MoneyFieldAdmin as cK, type MoneyFieldConfig as cL, type MultiSelectFieldAdmin as cM, type NamedAccessPolicy as cN, type NavBadgeConfig as cO, type NavGroup as cP, type NumberFieldAdmin as cQ, type NumberFormat as cR, type NumberLimitFieldAdmin as cS, type NumberLimitFieldConfig as cT, type NumericOperation as cU, type NumericUpdateOperator as cV, type OIDCAdminAuthProvider as cW, type OptionFormat as cX, type OutboundEmail as cY, type PaginatedResult as cZ, type PinnedNavItemRef as c_, type FieldAdminOptionsHookArgs as ca, type FieldAdminOptionsHookResult as cb, type FieldAfterReadHook as cc, type FieldAfterReadHookArgs as cd, type FieldBase as ce, type FieldBeforeChangeHook as cf, type FieldBeforeChangeHookArgs as cg, type FieldHook as ch, type FieldHooks as ci, type FileData as cj, type GanttViewConfig as ck, type GetDocumentResult as cl, type GlobalAfterChangeHook as cm, type GlobalAfterReadHook as cn, type GlobalAfterReadHookEntry as co, type GlobalBeforeChangeHook as cp, type GlobalBeforeChangeHookEntry as cq, type GlobalBeforeReadHook as cr, type GlobalBeforeReadHookEntry as cs, type GlobalRAGConfig as ct, type GlobalSchemaResult as cu, type GlobalSummaryResult as cv, type HeadingLevel as cw, type HookFunction as cx, type IconFieldAdmin as cy, type ImageService as cz, type LifecycleEvent as d, buildRequestLogger as d$, type QueryCollectionResult as d0, type RAGSearchResult as d1, type RadioFieldAdmin as d2, type RateLimitConfig as d3, type ReadonlyDatabaseAdapter as d4, type RichTextFeature as d5, type RichTextFieldConfig as d6, type SelectFieldAdmin as d7, type SqlWhereResult as d8, type StorageAdapter as d9, type WorkflowOnTransitionContext as dA, type WorkflowOnTransitionHook as dB, type WorkflowRole as dC, type WorkflowState as dD, type WorkflowTransitionContext as dE, coerceBooleanWhere as dF, defineAction as dG, defineCalendarView as dH, defineCardsView as dI, defineGanttView as dJ, defineKanbanView as dK, defineTableView as dL, defineView as dM, defineWorkspace as dN, isAICollection as dO, parseMongoWhere as dP, parseSqlWhere as dQ, type CollectionTokenPayload as dR, DEFAULT_INVITE_EXPIRY as dS, DEFAULT_RESET_PASSWORD_EXPIRY as dT, DEFAULT_SESSION_EXPIRY as dU, type DyrectedObservabilityRuntime as dV, type RequestBodyCapture as dW, type RequestTraceContext as dX, type ResolvedObservabilityConfig as dY, attachRequestMetrics as dZ, bindObservabilityRuntime as d_, type TableViewConfig as da, type TaskContext as db, type TaskLogger as dc, type TaskRunStatus as dd, type TextFieldAdmin as de, type TextFormat as df, type TextareaFieldAdmin as dg, type TrashConfig as dh, type TrustProxyConfig as di, type TypedField as dj, type UploadConfig as dk, type UrlFieldAdmin as dl, type UrlLinkValue as dm, type ViewActionFeatures as dn, type ViewComponentSlots as dp, type ViewConfigBase as dq, type ViewLayout as dr, type ViewMetric as ds, type ViewSubMetric as dt, type WhereClause as du, type WhereOperator as dv, type WhereOperatorName as dw, type WordLimitFieldAdmin as dx, type WordLimitFieldConfig as dy, type WorkflowMetadata as dz, type DatabaseAdapter as e, captureRequestBody as e0, createDyrectedApp as e1, createObservabilityRuntime as e2, createRequestSpan as e3, decodeCollectionToken as e4, endRequestSpan as e5, getConfigLogger as e6, getObservabilityRuntime as e7, getRequestLogger as e8, redactBody as e9, redactHeaders as ea, renderPrometheusMetrics as eb, resolveInviteTokenExpiry as ec, resolveObservabilityConfig as ed, resolveResetPasswordTokenExpiry as ee, resolveSessionTokenExpiry as ef, shouldSampleRequest as eg, signCollectionToken as eh, verifyCollectionToken as ei, type BaseDocument as f, type TaskConfig as g, type DetailActionOptions as h, type DetailAction as i, type DetailComputedOptions as j, type ComputedHandler as k, type DetailComputed as l, type DetailCustomOptions as m, type DetailCustom as n, type DetailDividerOptions as o, type DetailDivider as p, type DisplayFieldOptions as q, type DetailField as r, type DetailItem as s, type DetailGridOptions as t, type DetailGrid as u, type DetailRepeatOptions as v, type DetailRepeat as w, type DetailSectionOptions as x, type DetailSection as y, type DetailTabOptions as z };
4509
+ export { type RelationshipField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTab as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTabsOptions as I, type DetailTabs as J, type DetailTextOptions as K, type LifecycleEventName as L, type DetailText as M, type DetailSchema as N, type DyrectedContext as O, type PublicAdminAuthConfig as P, type AIConfig as Q, type AIPIIConfig as R, type IdStrategy as S, type TaskRunResult as T, type CompiledNavTree as U, type CompiledNavItem as V, type WorkflowConfig as W, type UserNavigationPreferences as X, type DefineWorkspaceOptions as Y, type ViewConfig as Z, type DateTimeField as _, type DeclarativeHookExpression as a, type AggregateArgs as a$, type SelectField as a0, type ArrayField as a1, type FieldType as a2, type BooleanField as a3, type AuthConfig as a4, type AccessPolicyResolver as a5, type DateField as a6, type TextField as a7, type EmailField as a8, type IconField as a9, AI_ACTIONS_COLLECTION as aA, AI_AUDIT_COLLECTION as aB, AI_CHUNKS_COLLECTION as aC, AI_MESSAGES_COLLECTION as aD, AI_THREADS_COLLECTION as aE, type AccessConfig as aF, type AccessFunction as aG, type AccessFunctionArgs as aH, type AccessResult as aI, type AccessRule as aJ, type ActionConfig as aK, type ActionConfigBase as aL, type ActionConfigWithHandler as aM, type ActionConfigWithMutation as aN, type ActionContext as aO, type ActionType as aP, type AdminAuthAccessResolution as aQ, type AdminAuthClaimMapping as aR, type AdminAuthMember as aS, type AdminAuthProvider as aT, type AdminAuthProviderMembersConfig as aU, type AdminAuthProvisioningMode as aV, type AdminAuthResolveAccessArgs as aW, type AdminAuthResolvedIdentity as aX, type AdminConfig as aY, type AdminDashboardComponentSlots as aZ, type AdminIconName as a_, type ImageField as aa, type JoinField as ab, type JsonField as ac, type MoneyField as ad, type MultiSelectField as ae, type NumberField as af, type ObjectField as ag, type RadioField as ah, type RichTextField as ai, type RowField as aj, type TextareaField as ak, type TimeField as al, type UrlField as am, type AIAction as an, type AIActionStatus as ao, type AIActionType as ap, type AIAuditActionType as aq, type AIAuditRecord as ar, type AIChunk as as, type AIMessage as at, type AIPIIPattern as au, type AIRateLimitResult as av, type AIRateLimitStore as aw, type AIThread as ax, type AIToolContext as ay, type AIToolDefinition as az, type AuthenticatedUser as b, type DynamicOptionsResolverArgs as b$, type AggregateCastType as b0, type AggregateCollectionResult as b1, type AggregateInput as b2, type AggregateOperation as b3, type AggregateResult as b4, type AppTrashConfig as b5, type BaseAdminAuthProvider as b6, type BaseFieldAdmin as b7, type BlockVariant as b8, type BlocksField as b9, type CollectionRAGConfig as bA, type CollectionSchemaResult as bB, type CollectionSummaryResult as bC, type CollectionViewComponentSlots as bD, type CompiledNavGroup as bE, type CountOperation as bF, type CustomAdminAuthProvider as bG, DEFAULT_USER_NAV_PREFERENCES as bH, type DateFieldAdmin as bI, type DateFormat as bJ, type DefaultValueContext as bK, type DefineActionOptions as bL, type DefineCalendarViewOptions as bM, type DefineCardsViewOptions as bN, type DefineGanttViewOptions as bO, type DefineKanbanViewOptions as bP, type DefineTableViewOptions as bQ, type DefineViewBaseOptions as bR, type DefineViewOptions as bS, type DetailSpan as bT, type DisplayTone as bU, type DisplayVariant as bV, type DistinctCountOperation as bW, type DistinctValuesOperation as bX, type DynamicOptionItem as bY, type DynamicOptionsConfig as bZ, type DynamicOptionsResolver as b_, type BooleanFieldAdmin as ba, type BooleanFormat as bb, CURRENT_NAV_PREFERENCES_VERSION as bc, type CalendarViewConfig as bd, type CardsViewConfig as be, type CharacterLimitFieldAdmin as bf, type CharacterLimitFieldConfig as bg, type CollectionAfterChangeHook as bh, type CollectionAfterDeleteHook as bi, type CollectionAfterReadHook as bj, type CollectionAfterReadHookEntry as bk, type CollectionAfterRestoreHook as bl, type CollectionAfterTransitionHook as bm, type CollectionAfterTrashHook as bn, type CollectionBeforeChangeHook as bo, type CollectionBeforeChangeHookEntry as bp, type CollectionBeforeCommitHook as bq, type CollectionBeforeDeleteHook as br, type CollectionBeforeReadHook as bs, type CollectionBeforeReadHookEntry as bt, type CollectionBeforeRestoreHook as bu, type CollectionBeforeTransitionHook as bv, type CollectionBeforeTrashHook as bw, type CollectionEmailConfig as bx, type CollectionIndex as by, type CollectionListComponentSlots as bz, type WorkflowTransition as c, type PublicAdminAuthProvider as c$, type DyrectedAIContext as c0, type DyrectedLoggerConfig as c1, type DyrectedObservabilityConfig as c2, type EmailFieldAdmin as c3, type EmailTemplateArgs as c4, type EmailTemplateResult as c5, type FieldAdminHooks as c6, type FieldAdminOnChangeHook as c7, type FieldAdminOnChangeHookArgs as c8, type FieldAdminOptionsHook as c9, type ImageTransformOptions as cA, type InferAggregateResult as cB, type JoinFieldAdmin as cC, type JsonFieldAdmin as cD, type JsonFormat as cE, type KanbanViewConfig as cF, LIFECYCLE_EVENT_NAMES as cG, type LifecycleEventHandler as cH, type LinkFormat as cI, type MetricColor as cJ, type MoneyFieldAdmin as cK, type MoneyFieldConfig as cL, type MultiSelectFieldAdmin as cM, type NamedAccessPolicy as cN, type NavBadgeConfig as cO, type NavGroup as cP, type NumberFieldAdmin as cQ, type NumberFormat as cR, type NumberLimitFieldAdmin as cS, type NumberLimitFieldConfig as cT, type NumericOperation as cU, type NumericUpdateOperator as cV, type OIDCAdminAuthProvider as cW, type OptionFormat as cX, type OutboundEmail as cY, type PaginatedResult as cZ, type PinnedNavItemRef as c_, type FieldAdminOptionsHookArgs as ca, type FieldAdminOptionsHookResult as cb, type FieldAfterReadHook as cc, type FieldAfterReadHookArgs as cd, type FieldBase as ce, type FieldBeforeChangeHook as cf, type FieldBeforeChangeHookArgs as cg, type FieldHook as ch, type FieldHooks as ci, type FileData as cj, type GanttViewConfig as ck, type GetDocumentResult as cl, type GlobalAfterChangeHook as cm, type GlobalAfterReadHook as cn, type GlobalAfterReadHookEntry as co, type GlobalBeforeChangeHook as cp, type GlobalBeforeChangeHookEntry as cq, type GlobalBeforeReadHook as cr, type GlobalBeforeReadHookEntry as cs, type GlobalRAGConfig as ct, type GlobalSchemaResult as cu, type GlobalSummaryResult as cv, type HeadingLevel as cw, type HookFunction as cx, type IconFieldAdmin as cy, type ImageService as cz, type LifecycleEvent as d, attachRequestMetrics as d$, type QueryCollectionResult as d0, type RAGSearchResult as d1, type RadioFieldAdmin as d2, type RateLimitConfig as d3, type ReadonlyDatabaseAdapter as d4, type RichTextFeature as d5, type RichTextFieldConfig as d6, type SelectFieldAdmin as d7, type SqlWhereResult as d8, type StorageAdapter as d9, type WordLimitFieldConfig as dA, type WorkflowMetadata as dB, type WorkflowOnTransitionContext as dC, type WorkflowOnTransitionHook as dD, type WorkflowRole as dE, type WorkflowState as dF, type WorkflowTransitionContext as dG, coerceBooleanWhere as dH, defineAction as dI, defineCalendarView as dJ, defineCardsView as dK, defineGanttView as dL, defineKanbanView as dM, defineTableView as dN, defineView as dO, defineWorkspace as dP, isAICollection as dQ, parseMongoWhere as dR, parseSqlWhere as dS, type CollectionTokenPayload as dT, DEFAULT_INVITE_EXPIRY as dU, DEFAULT_RESET_PASSWORD_EXPIRY as dV, DEFAULT_SESSION_EXPIRY as dW, type DyrectedObservabilityRuntime as dX, type RequestBodyCapture as dY, type RequestTraceContext as dZ, type ResolvedObservabilityConfig as d_, type TableViewConfig as da, type TaskContext as db, type TaskLogger as dc, type TaskRunStatus as dd, type TextFieldAdmin as de, type TextFormat as df, type TextareaFieldAdmin as dg, type TrashConfig as dh, type TrustProxyConfig as di, type TypedField as dj, type UploadConfig as dk, type UrlFieldAdmin as dl, type UrlLinkValue as dm, type ViewActionFeatures as dn, type ViewComponentSlots as dp, type ViewConfigBase as dq, type ViewLayout as dr, type ViewMetric as ds, type ViewMetricGroupBy as dt, type ViewMetricGroupByConfig as du, type ViewSubMetric as dv, type WhereClause as dw, type WhereOperator as dx, type WhereOperatorName as dy, type WordLimitFieldAdmin as dz, type DatabaseAdapter as e, bindObservabilityRuntime as e0, buildRequestLogger as e1, captureRequestBody as e2, createDyrectedApp as e3, createObservabilityRuntime as e4, createRequestSpan as e5, decodeCollectionToken as e6, endRequestSpan as e7, getConfigLogger as e8, getObservabilityRuntime as e9, getRequestLogger as ea, redactBody as eb, redactHeaders as ec, renderPrometheusMetrics as ed, resolveInviteTokenExpiry as ee, resolveObservabilityConfig as ef, resolveResetPasswordTokenExpiry as eg, resolveSessionTokenExpiry as eh, shouldSampleRequest as ei, signCollectionToken as ej, verifyCollectionToken as ek, type BaseDocument as f, type TaskConfig as g, type DetailActionOptions as h, type DetailAction as i, type DetailComputedOptions as j, type ComputedHandler as k, type DetailComputed as l, type DetailCustomOptions as m, type DetailCustom as n, type DetailDividerOptions as o, type DetailDivider as p, type DisplayFieldOptions as q, type DetailField as r, type DetailItem as s, type DetailGridOptions as t, type DetailGrid as u, type DetailRepeatOptions as v, type DetailRepeat as w, type DetailSectionOptions as x, type DetailSection as y, type DetailTabOptions as z };
@@ -553,11 +553,19 @@ type InferAggregateResult<T extends AggregateInput> = {
553
553
  * so adding a new operator without handling it will produce a TypeScript error
554
554
  * in every adapter translator.
555
555
  */
556
- type WhereOperatorName = 'equals' | 'not_equals' | 'in' | 'not_in' | 'gt' | 'greater_than' | 'gte' | 'greater_than_equal' | 'greater_than_or_equal' | 'lt' | 'less_than' | 'lte' | 'less_than_equal' | 'less_than_or_equal' | 'contains' | 'like' | 'starts_with' | 'exists';
556
+ type WhereOperatorName = 'equals' | 'not_equals' | 'not' | 'ne' | 'not_equal' | 'notEquals' | 'in' | 'not_in' | 'gt' | 'greater_than' | 'gte' | 'greater_than_equal' | 'greater_than_or_equal' | 'lt' | 'less_than' | 'lte' | 'less_than_equal' | 'less_than_or_equal' | 'contains' | 'like' | 'starts_with' | 'exists';
557
557
  type WhereOperator = {
558
558
  equals: any;
559
559
  } | {
560
560
  not_equals: any;
561
+ } | {
562
+ not: any;
563
+ } | {
564
+ ne: any;
565
+ } | {
566
+ not_equal: any;
567
+ } | {
568
+ notEquals: any;
561
569
  } | {
562
570
  in: any[];
563
571
  } | {
@@ -598,6 +606,8 @@ type WhereClause = {
598
606
  or?: WhereClause[] | readonly WhereClause[];
599
607
  AND?: WhereClause[] | readonly WhereClause[];
600
608
  and?: WhereClause[] | readonly WhereClause[];
609
+ NOT?: WhereClause[] | readonly WhereClause[] | WhereClause;
610
+ not?: WhereClause[] | readonly WhereClause[] | WhereClause;
601
611
  };
602
612
  interface SqlWhereResult {
603
613
  sql: string;
@@ -704,9 +714,24 @@ type MetricColor = 'purple' | 'emerald' | 'amber' | 'rose' | 'blue' | 'indigo' |
704
714
  * }
705
715
  * ```
706
716
  */
717
+ interface ViewMetricGroupByConfig {
718
+ /** Field or relationship name to group by. */
719
+ field: string;
720
+ /** Maximum number of groups to evaluate (defaults to 12). */
721
+ limit?: number;
722
+ /** Optional explicit ordering: `'count'` (descending) or `'asc'` / `'desc'`. */
723
+ orderBy?: 'count' | 'asc' | 'desc';
724
+ /** Optional where filter when discovering groups. */
725
+ where?: Record<string, unknown>;
726
+ }
727
+ type ViewMetricGroupBy = string | ViewMetricGroupByConfig;
707
728
  interface ViewSubMetric {
708
- /** Short label for the sub-metric (e.g. "Pending", "Collected"). */
729
+ /** Short label for the sub-metric (e.g. "Pending", "Collected"). Supports `{{group.label}}` and `{{group.value}}` when `groupBy` is used. */
709
730
  label: string;
731
+ /** Filter scope override for this sub-metric: `'view' | 'filtered' | 'collection'`. Defaults to parent metric's scope. */
732
+ scope?: 'view' | 'filtered' | 'collection';
733
+ /** Dynamic breakdown: groups this sub-metric by a field or relationship, expanding into multiple sub-metric rows in the card footer. */
734
+ groupBy?: ViewMetricGroupBy;
710
735
  /** Single database aggregate operation. */
711
736
  aggregate?: AggregateOperation;
712
737
  /** Map of named aggregate operations referenced in `expression` as `aggregates.key`. */
@@ -737,12 +762,22 @@ interface ViewSubMetric {
737
762
  * ```
738
763
  */
739
764
  interface ViewMetric {
740
- /** Title displayed on the metric card header. */
765
+ /** Title displayed on the metric card header. Supports `{{group.label}}` and `{{group.value}}` when `groupBy` is used. */
741
766
  label: string;
742
767
  /** Accent color for the card's visual indicator. */
743
768
  color?: MetricColor;
744
769
  /** Unit badge shown alongside the numeric value (e.g. `"Guests"`, `"Orders"`, `"Tables"`). */
745
770
  unit?: string;
771
+ /**
772
+ * Filter scope for this metric card:
773
+ * - `'view'`: evaluates within the view's base filter (default)
774
+ * - `'filtered'`: live summary reflecting active table/toolbar filters & search
775
+ * - `'collection'`: global collection totals ignoring view filters
776
+ * Defaults to view's `metricsScope` (or `'view'`).
777
+ */
778
+ scope?: 'view' | 'filtered' | 'collection';
779
+ /** Dynamic breakdown: groups this metric by a field or relationship, expanding into 1 card per group. */
780
+ groupBy?: ViewMetricGroupBy;
746
781
  /** Single database aggregate operation (`count`, `distinctCount`, `sum`, `avg`, `min`, `max`). */
747
782
  aggregate?: AggregateOperation;
748
783
  /** Map of named aggregate operations referenced in `expression` as `aggregates.key`. */
@@ -858,6 +893,13 @@ interface ViewConfigBase {
858
893
  actionOrder?: string[];
859
894
  /** KPI summary cards rendered in the hero row above the view. */
860
895
  metrics?: ViewMetric[];
896
+ /**
897
+ * Default filter scope for all metric cards in this view:
898
+ * - `'view'`: evaluates within the view's base filter (default)
899
+ * - `'filtered'`: live summary reflecting active table/toolbar filters & search
900
+ * - `'collection'`: global collection totals ignoring view filters
901
+ */
902
+ metricsScope?: 'view' | 'filtered' | 'collection';
861
903
  /** Optional real-time counter badge or status indicator displayed on this view in navigation and tabs. */
862
904
  badge?: NavBadgeConfig | string;
863
905
  /** Custom component slots rendered around this operational view. */
@@ -4464,4 +4506,4 @@ interface DyrectedContext {
4464
4506
  */
4465
4507
  declare function createDyrectedApp(rawConfig: DyrectedConfig | any): Promise<Hono<DyrectedContext, hono_types.BlankSchema, "/">>;
4466
4508
 
4467
- export { type RelationshipField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTab as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTabsOptions as I, type DetailTabs as J, type DetailTextOptions as K, type LifecycleEventName as L, type DetailText as M, type DetailSchema as N, type DyrectedContext as O, type PublicAdminAuthConfig as P, type AIConfig as Q, type AIPIIConfig as R, type IdStrategy as S, type TaskRunResult as T, type CompiledNavTree as U, type CompiledNavItem as V, type WorkflowConfig as W, type UserNavigationPreferences as X, type DefineWorkspaceOptions as Y, type ViewConfig as Z, type DateTimeField as _, type DeclarativeHookExpression as a, type AggregateArgs as a$, type SelectField as a0, type ArrayField as a1, type FieldType as a2, type BooleanField as a3, type AuthConfig as a4, type AccessPolicyResolver as a5, type DateField as a6, type TextField as a7, type EmailField as a8, type IconField as a9, AI_ACTIONS_COLLECTION as aA, AI_AUDIT_COLLECTION as aB, AI_CHUNKS_COLLECTION as aC, AI_MESSAGES_COLLECTION as aD, AI_THREADS_COLLECTION as aE, type AccessConfig as aF, type AccessFunction as aG, type AccessFunctionArgs as aH, type AccessResult as aI, type AccessRule as aJ, type ActionConfig as aK, type ActionConfigBase as aL, type ActionConfigWithHandler as aM, type ActionConfigWithMutation as aN, type ActionContext as aO, type ActionType as aP, type AdminAuthAccessResolution as aQ, type AdminAuthClaimMapping as aR, type AdminAuthMember as aS, type AdminAuthProvider as aT, type AdminAuthProviderMembersConfig as aU, type AdminAuthProvisioningMode as aV, type AdminAuthResolveAccessArgs as aW, type AdminAuthResolvedIdentity as aX, type AdminConfig as aY, type AdminDashboardComponentSlots as aZ, type AdminIconName as a_, type ImageField as aa, type JoinField as ab, type JsonField as ac, type MoneyField as ad, type MultiSelectField as ae, type NumberField as af, type ObjectField as ag, type RadioField as ah, type RichTextField as ai, type RowField as aj, type TextareaField as ak, type TimeField as al, type UrlField as am, type AIAction as an, type AIActionStatus as ao, type AIActionType as ap, type AIAuditActionType as aq, type AIAuditRecord as ar, type AIChunk as as, type AIMessage as at, type AIPIIPattern as au, type AIRateLimitResult as av, type AIRateLimitStore as aw, type AIThread as ax, type AIToolContext as ay, type AIToolDefinition as az, type AuthenticatedUser as b, type DynamicOptionsResolverArgs as b$, type AggregateCastType as b0, type AggregateCollectionResult as b1, type AggregateInput as b2, type AggregateOperation as b3, type AggregateResult as b4, type AppTrashConfig as b5, type BaseAdminAuthProvider as b6, type BaseFieldAdmin as b7, type BlockVariant as b8, type BlocksField as b9, type CollectionRAGConfig as bA, type CollectionSchemaResult as bB, type CollectionSummaryResult as bC, type CollectionViewComponentSlots as bD, type CompiledNavGroup as bE, type CountOperation as bF, type CustomAdminAuthProvider as bG, DEFAULT_USER_NAV_PREFERENCES as bH, type DateFieldAdmin as bI, type DateFormat as bJ, type DefaultValueContext as bK, type DefineActionOptions as bL, type DefineCalendarViewOptions as bM, type DefineCardsViewOptions as bN, type DefineGanttViewOptions as bO, type DefineKanbanViewOptions as bP, type DefineTableViewOptions as bQ, type DefineViewBaseOptions as bR, type DefineViewOptions as bS, type DetailSpan as bT, type DisplayTone as bU, type DisplayVariant as bV, type DistinctCountOperation as bW, type DistinctValuesOperation as bX, type DynamicOptionItem as bY, type DynamicOptionsConfig as bZ, type DynamicOptionsResolver as b_, type BooleanFieldAdmin as ba, type BooleanFormat as bb, CURRENT_NAV_PREFERENCES_VERSION as bc, type CalendarViewConfig as bd, type CardsViewConfig as be, type CharacterLimitFieldAdmin as bf, type CharacterLimitFieldConfig as bg, type CollectionAfterChangeHook as bh, type CollectionAfterDeleteHook as bi, type CollectionAfterReadHook as bj, type CollectionAfterReadHookEntry as bk, type CollectionAfterRestoreHook as bl, type CollectionAfterTransitionHook as bm, type CollectionAfterTrashHook as bn, type CollectionBeforeChangeHook as bo, type CollectionBeforeChangeHookEntry as bp, type CollectionBeforeCommitHook as bq, type CollectionBeforeDeleteHook as br, type CollectionBeforeReadHook as bs, type CollectionBeforeReadHookEntry as bt, type CollectionBeforeRestoreHook as bu, type CollectionBeforeTransitionHook as bv, type CollectionBeforeTrashHook as bw, type CollectionEmailConfig as bx, type CollectionIndex as by, type CollectionListComponentSlots as bz, type WorkflowTransition as c, type PublicAdminAuthProvider as c$, type DyrectedAIContext as c0, type DyrectedLoggerConfig as c1, type DyrectedObservabilityConfig as c2, type EmailFieldAdmin as c3, type EmailTemplateArgs as c4, type EmailTemplateResult as c5, type FieldAdminHooks as c6, type FieldAdminOnChangeHook as c7, type FieldAdminOnChangeHookArgs as c8, type FieldAdminOptionsHook as c9, type ImageTransformOptions as cA, type InferAggregateResult as cB, type JoinFieldAdmin as cC, type JsonFieldAdmin as cD, type JsonFormat as cE, type KanbanViewConfig as cF, LIFECYCLE_EVENT_NAMES as cG, type LifecycleEventHandler as cH, type LinkFormat as cI, type MetricColor as cJ, type MoneyFieldAdmin as cK, type MoneyFieldConfig as cL, type MultiSelectFieldAdmin as cM, type NamedAccessPolicy as cN, type NavBadgeConfig as cO, type NavGroup as cP, type NumberFieldAdmin as cQ, type NumberFormat as cR, type NumberLimitFieldAdmin as cS, type NumberLimitFieldConfig as cT, type NumericOperation as cU, type NumericUpdateOperator as cV, type OIDCAdminAuthProvider as cW, type OptionFormat as cX, type OutboundEmail as cY, type PaginatedResult as cZ, type PinnedNavItemRef as c_, type FieldAdminOptionsHookArgs as ca, type FieldAdminOptionsHookResult as cb, type FieldAfterReadHook as cc, type FieldAfterReadHookArgs as cd, type FieldBase as ce, type FieldBeforeChangeHook as cf, type FieldBeforeChangeHookArgs as cg, type FieldHook as ch, type FieldHooks as ci, type FileData as cj, type GanttViewConfig as ck, type GetDocumentResult as cl, type GlobalAfterChangeHook as cm, type GlobalAfterReadHook as cn, type GlobalAfterReadHookEntry as co, type GlobalBeforeChangeHook as cp, type GlobalBeforeChangeHookEntry as cq, type GlobalBeforeReadHook as cr, type GlobalBeforeReadHookEntry as cs, type GlobalRAGConfig as ct, type GlobalSchemaResult as cu, type GlobalSummaryResult as cv, type HeadingLevel as cw, type HookFunction as cx, type IconFieldAdmin as cy, type ImageService as cz, type LifecycleEvent as d, buildRequestLogger as d$, type QueryCollectionResult as d0, type RAGSearchResult as d1, type RadioFieldAdmin as d2, type RateLimitConfig as d3, type ReadonlyDatabaseAdapter as d4, type RichTextFeature as d5, type RichTextFieldConfig as d6, type SelectFieldAdmin as d7, type SqlWhereResult as d8, type StorageAdapter as d9, type WorkflowOnTransitionContext as dA, type WorkflowOnTransitionHook as dB, type WorkflowRole as dC, type WorkflowState as dD, type WorkflowTransitionContext as dE, coerceBooleanWhere as dF, defineAction as dG, defineCalendarView as dH, defineCardsView as dI, defineGanttView as dJ, defineKanbanView as dK, defineTableView as dL, defineView as dM, defineWorkspace as dN, isAICollection as dO, parseMongoWhere as dP, parseSqlWhere as dQ, type CollectionTokenPayload as dR, DEFAULT_INVITE_EXPIRY as dS, DEFAULT_RESET_PASSWORD_EXPIRY as dT, DEFAULT_SESSION_EXPIRY as dU, type DyrectedObservabilityRuntime as dV, type RequestBodyCapture as dW, type RequestTraceContext as dX, type ResolvedObservabilityConfig as dY, attachRequestMetrics as dZ, bindObservabilityRuntime as d_, type TableViewConfig as da, type TaskContext as db, type TaskLogger as dc, type TaskRunStatus as dd, type TextFieldAdmin as de, type TextFormat as df, type TextareaFieldAdmin as dg, type TrashConfig as dh, type TrustProxyConfig as di, type TypedField as dj, type UploadConfig as dk, type UrlFieldAdmin as dl, type UrlLinkValue as dm, type ViewActionFeatures as dn, type ViewComponentSlots as dp, type ViewConfigBase as dq, type ViewLayout as dr, type ViewMetric as ds, type ViewSubMetric as dt, type WhereClause as du, type WhereOperator as dv, type WhereOperatorName as dw, type WordLimitFieldAdmin as dx, type WordLimitFieldConfig as dy, type WorkflowMetadata as dz, type DatabaseAdapter as e, captureRequestBody as e0, createDyrectedApp as e1, createObservabilityRuntime as e2, createRequestSpan as e3, decodeCollectionToken as e4, endRequestSpan as e5, getConfigLogger as e6, getObservabilityRuntime as e7, getRequestLogger as e8, redactBody as e9, redactHeaders as ea, renderPrometheusMetrics as eb, resolveInviteTokenExpiry as ec, resolveObservabilityConfig as ed, resolveResetPasswordTokenExpiry as ee, resolveSessionTokenExpiry as ef, shouldSampleRequest as eg, signCollectionToken as eh, verifyCollectionToken as ei, type BaseDocument as f, type TaskConfig as g, type DetailActionOptions as h, type DetailAction as i, type DetailComputedOptions as j, type ComputedHandler as k, type DetailComputed as l, type DetailCustomOptions as m, type DetailCustom as n, type DetailDividerOptions as o, type DetailDivider as p, type DisplayFieldOptions as q, type DetailField as r, type DetailItem as s, type DetailGridOptions as t, type DetailGrid as u, type DetailRepeatOptions as v, type DetailRepeat as w, type DetailSectionOptions as x, type DetailSection as y, type DetailTabOptions as z };
4509
+ export { type RelationshipField as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type DetailTab as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type DetailTabsOptions as I, type DetailTabs as J, type DetailTextOptions as K, type LifecycleEventName as L, type DetailText as M, type DetailSchema as N, type DyrectedContext as O, type PublicAdminAuthConfig as P, type AIConfig as Q, type AIPIIConfig as R, type IdStrategy as S, type TaskRunResult as T, type CompiledNavTree as U, type CompiledNavItem as V, type WorkflowConfig as W, type UserNavigationPreferences as X, type DefineWorkspaceOptions as Y, type ViewConfig as Z, type DateTimeField as _, type DeclarativeHookExpression as a, type AggregateArgs as a$, type SelectField as a0, type ArrayField as a1, type FieldType as a2, type BooleanField as a3, type AuthConfig as a4, type AccessPolicyResolver as a5, type DateField as a6, type TextField as a7, type EmailField as a8, type IconField as a9, AI_ACTIONS_COLLECTION as aA, AI_AUDIT_COLLECTION as aB, AI_CHUNKS_COLLECTION as aC, AI_MESSAGES_COLLECTION as aD, AI_THREADS_COLLECTION as aE, type AccessConfig as aF, type AccessFunction as aG, type AccessFunctionArgs as aH, type AccessResult as aI, type AccessRule as aJ, type ActionConfig as aK, type ActionConfigBase as aL, type ActionConfigWithHandler as aM, type ActionConfigWithMutation as aN, type ActionContext as aO, type ActionType as aP, type AdminAuthAccessResolution as aQ, type AdminAuthClaimMapping as aR, type AdminAuthMember as aS, type AdminAuthProvider as aT, type AdminAuthProviderMembersConfig as aU, type AdminAuthProvisioningMode as aV, type AdminAuthResolveAccessArgs as aW, type AdminAuthResolvedIdentity as aX, type AdminConfig as aY, type AdminDashboardComponentSlots as aZ, type AdminIconName as a_, type ImageField as aa, type JoinField as ab, type JsonField as ac, type MoneyField as ad, type MultiSelectField as ae, type NumberField as af, type ObjectField as ag, type RadioField as ah, type RichTextField as ai, type RowField as aj, type TextareaField as ak, type TimeField as al, type UrlField as am, type AIAction as an, type AIActionStatus as ao, type AIActionType as ap, type AIAuditActionType as aq, type AIAuditRecord as ar, type AIChunk as as, type AIMessage as at, type AIPIIPattern as au, type AIRateLimitResult as av, type AIRateLimitStore as aw, type AIThread as ax, type AIToolContext as ay, type AIToolDefinition as az, type AuthenticatedUser as b, type DynamicOptionsResolverArgs as b$, type AggregateCastType as b0, type AggregateCollectionResult as b1, type AggregateInput as b2, type AggregateOperation as b3, type AggregateResult as b4, type AppTrashConfig as b5, type BaseAdminAuthProvider as b6, type BaseFieldAdmin as b7, type BlockVariant as b8, type BlocksField as b9, type CollectionRAGConfig as bA, type CollectionSchemaResult as bB, type CollectionSummaryResult as bC, type CollectionViewComponentSlots as bD, type CompiledNavGroup as bE, type CountOperation as bF, type CustomAdminAuthProvider as bG, DEFAULT_USER_NAV_PREFERENCES as bH, type DateFieldAdmin as bI, type DateFormat as bJ, type DefaultValueContext as bK, type DefineActionOptions as bL, type DefineCalendarViewOptions as bM, type DefineCardsViewOptions as bN, type DefineGanttViewOptions as bO, type DefineKanbanViewOptions as bP, type DefineTableViewOptions as bQ, type DefineViewBaseOptions as bR, type DefineViewOptions as bS, type DetailSpan as bT, type DisplayTone as bU, type DisplayVariant as bV, type DistinctCountOperation as bW, type DistinctValuesOperation as bX, type DynamicOptionItem as bY, type DynamicOptionsConfig as bZ, type DynamicOptionsResolver as b_, type BooleanFieldAdmin as ba, type BooleanFormat as bb, CURRENT_NAV_PREFERENCES_VERSION as bc, type CalendarViewConfig as bd, type CardsViewConfig as be, type CharacterLimitFieldAdmin as bf, type CharacterLimitFieldConfig as bg, type CollectionAfterChangeHook as bh, type CollectionAfterDeleteHook as bi, type CollectionAfterReadHook as bj, type CollectionAfterReadHookEntry as bk, type CollectionAfterRestoreHook as bl, type CollectionAfterTransitionHook as bm, type CollectionAfterTrashHook as bn, type CollectionBeforeChangeHook as bo, type CollectionBeforeChangeHookEntry as bp, type CollectionBeforeCommitHook as bq, type CollectionBeforeDeleteHook as br, type CollectionBeforeReadHook as bs, type CollectionBeforeReadHookEntry as bt, type CollectionBeforeRestoreHook as bu, type CollectionBeforeTransitionHook as bv, type CollectionBeforeTrashHook as bw, type CollectionEmailConfig as bx, type CollectionIndex as by, type CollectionListComponentSlots as bz, type WorkflowTransition as c, type PublicAdminAuthProvider as c$, type DyrectedAIContext as c0, type DyrectedLoggerConfig as c1, type DyrectedObservabilityConfig as c2, type EmailFieldAdmin as c3, type EmailTemplateArgs as c4, type EmailTemplateResult as c5, type FieldAdminHooks as c6, type FieldAdminOnChangeHook as c7, type FieldAdminOnChangeHookArgs as c8, type FieldAdminOptionsHook as c9, type ImageTransformOptions as cA, type InferAggregateResult as cB, type JoinFieldAdmin as cC, type JsonFieldAdmin as cD, type JsonFormat as cE, type KanbanViewConfig as cF, LIFECYCLE_EVENT_NAMES as cG, type LifecycleEventHandler as cH, type LinkFormat as cI, type MetricColor as cJ, type MoneyFieldAdmin as cK, type MoneyFieldConfig as cL, type MultiSelectFieldAdmin as cM, type NamedAccessPolicy as cN, type NavBadgeConfig as cO, type NavGroup as cP, type NumberFieldAdmin as cQ, type NumberFormat as cR, type NumberLimitFieldAdmin as cS, type NumberLimitFieldConfig as cT, type NumericOperation as cU, type NumericUpdateOperator as cV, type OIDCAdminAuthProvider as cW, type OptionFormat as cX, type OutboundEmail as cY, type PaginatedResult as cZ, type PinnedNavItemRef as c_, type FieldAdminOptionsHookArgs as ca, type FieldAdminOptionsHookResult as cb, type FieldAfterReadHook as cc, type FieldAfterReadHookArgs as cd, type FieldBase as ce, type FieldBeforeChangeHook as cf, type FieldBeforeChangeHookArgs as cg, type FieldHook as ch, type FieldHooks as ci, type FileData as cj, type GanttViewConfig as ck, type GetDocumentResult as cl, type GlobalAfterChangeHook as cm, type GlobalAfterReadHook as cn, type GlobalAfterReadHookEntry as co, type GlobalBeforeChangeHook as cp, type GlobalBeforeChangeHookEntry as cq, type GlobalBeforeReadHook as cr, type GlobalBeforeReadHookEntry as cs, type GlobalRAGConfig as ct, type GlobalSchemaResult as cu, type GlobalSummaryResult as cv, type HeadingLevel as cw, type HookFunction as cx, type IconFieldAdmin as cy, type ImageService as cz, type LifecycleEvent as d, attachRequestMetrics as d$, type QueryCollectionResult as d0, type RAGSearchResult as d1, type RadioFieldAdmin as d2, type RateLimitConfig as d3, type ReadonlyDatabaseAdapter as d4, type RichTextFeature as d5, type RichTextFieldConfig as d6, type SelectFieldAdmin as d7, type SqlWhereResult as d8, type StorageAdapter as d9, type WordLimitFieldConfig as dA, type WorkflowMetadata as dB, type WorkflowOnTransitionContext as dC, type WorkflowOnTransitionHook as dD, type WorkflowRole as dE, type WorkflowState as dF, type WorkflowTransitionContext as dG, coerceBooleanWhere as dH, defineAction as dI, defineCalendarView as dJ, defineCardsView as dK, defineGanttView as dL, defineKanbanView as dM, defineTableView as dN, defineView as dO, defineWorkspace as dP, isAICollection as dQ, parseMongoWhere as dR, parseSqlWhere as dS, type CollectionTokenPayload as dT, DEFAULT_INVITE_EXPIRY as dU, DEFAULT_RESET_PASSWORD_EXPIRY as dV, DEFAULT_SESSION_EXPIRY as dW, type DyrectedObservabilityRuntime as dX, type RequestBodyCapture as dY, type RequestTraceContext as dZ, type ResolvedObservabilityConfig as d_, type TableViewConfig as da, type TaskContext as db, type TaskLogger as dc, type TaskRunStatus as dd, type TextFieldAdmin as de, type TextFormat as df, type TextareaFieldAdmin as dg, type TrashConfig as dh, type TrustProxyConfig as di, type TypedField as dj, type UploadConfig as dk, type UrlFieldAdmin as dl, type UrlLinkValue as dm, type ViewActionFeatures as dn, type ViewComponentSlots as dp, type ViewConfigBase as dq, type ViewLayout as dr, type ViewMetric as ds, type ViewMetricGroupBy as dt, type ViewMetricGroupByConfig as du, type ViewSubMetric as dv, type WhereClause as dw, type WhereOperator as dx, type WhereOperatorName as dy, type WordLimitFieldAdmin as dz, type DatabaseAdapter as e, bindObservabilityRuntime as e0, buildRequestLogger as e1, captureRequestBody as e2, createDyrectedApp as e3, createObservabilityRuntime as e4, createRequestSpan as e5, decodeCollectionToken as e6, endRequestSpan as e7, getConfigLogger as e8, getObservabilityRuntime as e9, getRequestLogger as ea, redactBody as eb, redactHeaders as ec, renderPrometheusMetrics as ed, resolveInviteTokenExpiry as ee, resolveObservabilityConfig as ef, resolveResetPasswordTokenExpiry as eg, resolveSessionTokenExpiry as eh, shouldSampleRequest as ei, signCollectionToken as ej, verifyCollectionToken as ek, type BaseDocument as f, type TaskConfig as g, type DetailActionOptions as h, type DetailAction as i, type DetailComputedOptions as j, type ComputedHandler as k, type DetailComputed as l, type DetailCustomOptions as m, type DetailCustom as n, type DetailDividerOptions as o, type DetailDivider as p, type DisplayFieldOptions as q, type DetailField as r, type DetailItem as s, type DetailGridOptions as t, type DetailGrid as u, type DetailRepeatOptions as v, type DetailRepeat as w, type DetailSectionOptions as x, type DetailSection as y, type DetailTabOptions as z };
package/dist/index.cjs CHANGED
@@ -5499,6 +5499,10 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5499
5499
  }
5500
5500
  return `${c} = ${next()}`;
5501
5501
  case "not_equals":
5502
+ case "not":
5503
+ case "ne":
5504
+ case "not_equal":
5505
+ case "notEquals":
5502
5506
  if (operand === null) {
5503
5507
  return `${c} IS NOT NULL`;
5504
5508
  }
@@ -5514,9 +5518,33 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5514
5518
  } else {
5515
5519
  params.push(operand);
5516
5520
  }
5517
- } else {
5518
- params.push(operand);
5521
+ return `${c} != ${next()}`;
5522
+ }
5523
+ if (Array.isArray(operand)) {
5524
+ if (operand.length === 0) return "1=1";
5525
+ const placeholders = operand.map((v) => {
5526
+ if (typeof v === "boolean") {
5527
+ if (placeholder === "?") {
5528
+ params.push(v ? 1 : 0);
5529
+ } else if (isJsonExtract) {
5530
+ params.push(String(v));
5531
+ } else {
5532
+ params.push(v);
5533
+ }
5534
+ } else {
5535
+ params.push(v);
5536
+ }
5537
+ return next();
5538
+ });
5539
+ return `${c} NOT IN (${placeholders.join(", ")})`;
5540
+ }
5541
+ if (typeof operand === "object") {
5542
+ const innerEntries = Object.entries(operand);
5543
+ if (innerEntries.length === 0) return "1=1";
5544
+ const innerSql = innerEntries.map(([innerOp, innerOperand]) => buildSingleOp(c, innerOp, innerOperand)).join(" AND ");
5545
+ return `NOT (${innerSql})`;
5519
5546
  }
5547
+ params.push(operand);
5520
5548
  return `${c} != ${next()}`;
5521
5549
  case "in": {
5522
5550
  const vals = Array.isArray(operand) ? operand : [operand];
@@ -5587,6 +5615,15 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5587
5615
  } else if (upperField === "AND" && Array.isArray(value)) {
5588
5616
  const sub = value.map((v) => `(${buildClause(v)})`).join(" AND ");
5589
5617
  parts.push(`(${sub})`);
5618
+ } else if (upperField === "NOT") {
5619
+ if (Array.isArray(value)) {
5620
+ const sub = value.map((v) => `(${buildClause(v)})`).join(" AND ");
5621
+ parts.push(`(NOT (${sub}))`);
5622
+ } else if (typeof value === "object" && value !== null && !("equals" in value || "not_equals" in value || "not" in value || "ne" in value || "not_equal" in value || "notEquals" in value || "in" in value || "not_in" in value || "gt" in value || "gte" in value || "lt" in value || "lte" in value || "contains" in value || "like" in value || "starts_with" in value || "exists" in value)) {
5623
+ parts.push(`(NOT (${buildClause(value)}))`);
5624
+ } else {
5625
+ parts.push(buildOperator(field, value));
5626
+ }
5590
5627
  } else {
5591
5628
  parts.push(buildOperator(field, value));
5592
5629
  }
@@ -5617,7 +5654,28 @@ function parseMongoWhere(where) {
5617
5654
  case "equals":
5618
5655
  return { [field]: { $eq: operand } };
5619
5656
  case "not_equals":
5657
+ case "not":
5658
+ case "ne":
5659
+ case "not_equal":
5660
+ case "notEquals": {
5661
+ if (Array.isArray(operand)) {
5662
+ return { [field]: { $nin: operand } };
5663
+ }
5664
+ if (typeof operand === "object" && operand !== null) {
5665
+ const innerEntries = Object.entries(operand);
5666
+ if (innerEntries.length === 1) {
5667
+ const [innerOp, innerOperand] = innerEntries[0];
5668
+ const inner = buildSingleOp(field, innerOp, innerOperand)[field];
5669
+ return { [field]: { $not: inner } };
5670
+ }
5671
+ const merged = {};
5672
+ for (const [innerOp, innerOperand] of innerEntries) {
5673
+ Object.assign(merged, buildSingleOp(field, innerOp, innerOperand)[field]);
5674
+ }
5675
+ return { [field]: { $not: merged } };
5676
+ }
5620
5677
  return { [field]: { $ne: operand } };
5678
+ }
5621
5679
  case "in":
5622
5680
  return { [field]: { $in: Array.isArray(operand) ? operand : [operand] } };
5623
5681
  case "not_in":
@@ -5655,6 +5713,14 @@ function parseMongoWhere(where) {
5655
5713
  conditions.push({ $or: value.map(buildClause) });
5656
5714
  } else if (upperField === "AND" && Array.isArray(value)) {
5657
5715
  conditions.push({ $and: value.map(buildClause) });
5716
+ } else if (upperField === "NOT") {
5717
+ if (Array.isArray(value)) {
5718
+ conditions.push({ $nor: value.map(buildClause) });
5719
+ } else if (typeof value === "object" && value !== null && !("equals" in value || "not_equals" in value || "not" in value || "ne" in value || "not_equal" in value || "notEquals" in value || "in" in value || "not_in" in value || "gt" in value || "gte" in value || "lt" in value || "lte" in value || "contains" in value || "like" in value || "starts_with" in value || "exists" in value)) {
5720
+ conditions.push({ $nor: [buildClause(value)] });
5721
+ } else {
5722
+ conditions.push(buildOperator(field, value));
5723
+ }
5658
5724
  } else {
5659
5725
  conditions.push(buildOperator(field, value));
5660
5726
  }
@@ -5676,7 +5742,7 @@ function coerceBooleanWhere(where, fields) {
5676
5742
  if (!node || typeof node !== "object") return node;
5677
5743
  const out = {};
5678
5744
  for (const [key, value] of Object.entries(node)) {
5679
- if (key.toUpperCase() === "AND" || key.toUpperCase() === "OR") {
5745
+ if (key.toUpperCase() === "AND" || key.toUpperCase() === "OR" || key.toUpperCase() === "NOT") {
5680
5746
  out[key] = walk(value);
5681
5747
  } else if (booleanFields.has(key)) {
5682
5748
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -7999,8 +8065,19 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
7999
8065
  }
8000
8066
  }
8001
8067
  for (const itemOpt of effectivePrefs.items || []) {
8002
- const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group;
8003
- const groupKey = targetGroup || "Custom";
8068
+ const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
8069
+ let existingItem;
8070
+ let existingParentGroup;
8071
+ for (const g of groupsList) {
8072
+ const found = g.items.find((i) => i.id === itemId || i.slug === itemOpt.slug);
8073
+ if (found) {
8074
+ existingItem = found;
8075
+ existingParentGroup = g;
8076
+ break;
8077
+ }
8078
+ }
8079
+ const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group || existingParentGroup?.name || "Custom";
8080
+ const groupKey = targetGroup;
8004
8081
  let group = findGroup(groupKey);
8005
8082
  if (!group) {
8006
8083
  group = {
@@ -8014,18 +8091,45 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
8014
8091
  };
8015
8092
  groupsList.push(group);
8016
8093
  }
8017
- const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
8018
8094
  for (const otherGroup of groupsList) {
8019
8095
  if (otherGroup !== group) {
8020
8096
  otherGroup.items = otherGroup.items.filter((i) => i.slug !== itemOpt.slug && i.id !== itemId);
8021
8097
  }
8022
8098
  }
8023
8099
  const existingIndex = group.items.findIndex((i) => i.id === itemId || i.slug === itemOpt.slug);
8024
- const existingItem = existingIndex >= 0 ? group.items[existingIndex] : void 0;
8100
+ if (existingIndex >= 0) {
8101
+ existingItem = group.items[existingIndex];
8102
+ }
8025
8103
  const col = schemas?.collections?.find((c) => c.slug === itemOpt.collection);
8026
8104
  const colViews = col?.views || [];
8027
8105
  const baseViews = existingItem?.views || [];
8028
- const userViews = itemOpt.views || [];
8106
+ const userViews = (itemOpt.views || []).map((uv) => {
8107
+ const bv = baseViews.find((b) => b.slug === uv.slug);
8108
+ if (!bv) return uv;
8109
+ const metricsScope = uv.metricsScope ?? bv.metricsScope;
8110
+ let metrics = uv.metrics;
8111
+ if (Array.isArray(uv.metrics) && Array.isArray(bv.metrics)) {
8112
+ metrics = uv.metrics.map((um) => {
8113
+ const bm = bv.metrics?.find((m) => m.label === um.label);
8114
+ if (!bm) return um;
8115
+ return {
8116
+ ...bm,
8117
+ ...um,
8118
+ scope: um.scope ?? bm.scope,
8119
+ groupBy: um.groupBy ?? bm.groupBy,
8120
+ subMetrics: um.subMetrics ?? bm.subMetrics
8121
+ };
8122
+ });
8123
+ } else if (!uv.metrics && bv.metrics) {
8124
+ metrics = bv.metrics;
8125
+ }
8126
+ return {
8127
+ ...bv,
8128
+ ...uv,
8129
+ metricsScope,
8130
+ metrics
8131
+ };
8132
+ });
8029
8133
  const userViewSlugs = new Set(userViews.map((v) => v.slug));
8030
8134
  let mergedViews = [
8031
8135
  ...baseViews.filter((v) => !userViewSlugs.has(v.slug)),
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as DatabaseAdapter, f as BaseDocument, H as HookRequestContext, T as TaskRunResult, g as TaskConfig, h as DetailActionOptions, i as DetailAction, j as DetailComputedOptions, k as ComputedHandler, l as DetailComputed, m as DetailCustomOptions, n as DetailCustom, o as DetailDividerOptions, p as DetailDivider, q as DisplayFieldOptions, r as DetailField, s as DetailItem, t as DetailGridOptions, u as DetailGrid, v as DetailRepeatOptions, w as DetailRepeat, x as DetailSectionOptions, y as DetailSection, z as DetailTabOptions, E as DetailTab, I as DetailTabsOptions, J as DetailTabs, K as DetailTextOptions, M as DetailText, N as DetailSchema, O as DyrectedContext, Q as AIConfig, R as AIPIIConfig, S as IdStrategy, U as CompiledNavTree, V as CompiledNavItem, X as UserNavigationPreferences, Y as DefineWorkspaceOptions, Z as ViewConfig, _ as DateTimeField, $ as RelationshipField, a0 as SelectField, a1 as ArrayField, a2 as FieldType, a3 as BooleanField, a4 as AuthConfig, a5 as AccessPolicyResolver, a6 as DateField, a7 as TextField, a8 as EmailField, a9 as IconField, aa as ImageField, ab as JoinField, ac as JsonField, ad as MoneyField, ae as MultiSelectField, af as NumberField, ag as ObjectField, ah as RadioField, ai as RichTextField, aj as RowField, ak as TextareaField, al as TimeField, am as UrlField } from './app-v23fNf58.cjs';
2
- export { an as AIAction, ao as AIActionStatus, ap as AIActionType, aq as AIAuditActionType, ar as AIAuditRecord, as as AIChunk, at as AIMessage, au as AIPIIPattern, av as AIRateLimitResult, aw as AIRateLimitStore, ax as AIThread, ay as AIToolContext, az as AIToolDefinition, aA as AI_ACTIONS_COLLECTION, aB as AI_AUDIT_COLLECTION, aC as AI_CHUNKS_COLLECTION, aD as AI_MESSAGES_COLLECTION, aE as AI_THREADS_COLLECTION, aF as AccessConfig, aG as AccessFunction, aH as AccessFunctionArgs, aI as AccessResult, aJ as AccessRule, aK as ActionConfig, aL as ActionConfigBase, aM as ActionConfigWithHandler, aN as ActionConfigWithMutation, aO as ActionContext, aP as ActionType, aQ as AdminAuthAccessResolution, aR as AdminAuthClaimMapping, aS as AdminAuthMember, aT as AdminAuthProvider, aU as AdminAuthProviderMembersConfig, aV as AdminAuthProvisioningMode, aW as AdminAuthResolveAccessArgs, aX as AdminAuthResolvedIdentity, aY as AdminConfig, aZ as AdminDashboardComponentSlots, a_ as AdminIconName, a$ as AggregateArgs, b0 as AggregateCastType, b1 as AggregateCollectionResult, b2 as AggregateInput, b3 as AggregateOperation, b4 as AggregateResult, b5 as AppTrashConfig, b6 as BaseAdminAuthProvider, b7 as BaseFieldAdmin, b8 as BlockVariant, b9 as BlocksField, ba as BooleanFieldAdmin, bb as BooleanFormat, bc as CURRENT_NAV_PREFERENCES_VERSION, bd as CalendarViewConfig, be as CardsViewConfig, bf as CharacterLimitFieldAdmin, bg as CharacterLimitFieldConfig, bh as CollectionAfterChangeHook, bi as CollectionAfterDeleteHook, bj as CollectionAfterReadHook, bk as CollectionAfterReadHookEntry, bl as CollectionAfterRestoreHook, bm as CollectionAfterTransitionHook, bn as CollectionAfterTrashHook, bo as CollectionBeforeChangeHook, bp as CollectionBeforeChangeHookEntry, bq as CollectionBeforeCommitHook, br as CollectionBeforeDeleteHook, bs as CollectionBeforeReadHook, bt as CollectionBeforeReadHookEntry, bu as CollectionBeforeRestoreHook, bv as CollectionBeforeTransitionHook, bw as CollectionBeforeTrashHook, bx as CollectionEmailConfig, by as CollectionIndex, bz as CollectionListComponentSlots, bA as CollectionRAGConfig, bB as CollectionSchemaResult, bC as CollectionSummaryResult, bD as CollectionViewComponentSlots, bE as CompiledNavGroup, bF as CountOperation, bG as CustomAdminAuthProvider, bH as DEFAULT_USER_NAV_PREFERENCES, bI as DateFieldAdmin, bJ as DateFormat, bK as DefaultValueContext, bL as DefineActionOptions, bM as DefineCalendarViewOptions, bN as DefineCardsViewOptions, bO as DefineGanttViewOptions, bP as DefineKanbanViewOptions, bQ as DefineTableViewOptions, bR as DefineViewBaseOptions, bS as DefineViewOptions, bT as DetailSpan, bU as DisplayTone, bV as DisplayVariant, bW as DistinctCountOperation, bX as DistinctValuesOperation, bY as DynamicOptionItem, bZ as DynamicOptionsConfig, b_ as DynamicOptionsResolver, b$ as DynamicOptionsResolverArgs, c0 as DyrectedAIContext, c1 as DyrectedLoggerConfig, c2 as DyrectedObservabilityConfig, c3 as EmailFieldAdmin, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, c6 as FieldAdminHooks, c7 as FieldAdminOnChangeHook, c8 as FieldAdminOnChangeHookArgs, c9 as FieldAdminOptionsHook, ca as FieldAdminOptionsHookArgs, cb as FieldAdminOptionsHookResult, cc as FieldAfterReadHook, cd as FieldAfterReadHookArgs, ce as FieldBase, cf as FieldBeforeChangeHook, cg as FieldBeforeChangeHookArgs, ch as FieldHook, ci as FieldHooks, cj as FileData, ck as GanttViewConfig, cl as GetDocumentResult, cm as GlobalAfterChangeHook, cn as GlobalAfterReadHook, co as GlobalAfterReadHookEntry, cp as GlobalBeforeChangeHook, cq as GlobalBeforeChangeHookEntry, cr as GlobalBeforeReadHook, cs as GlobalBeforeReadHookEntry, ct as GlobalRAGConfig, cu as GlobalSchemaResult, cv as GlobalSummaryResult, cw as HeadingLevel, cx as HookFunction, cy as IconFieldAdmin, cz as ImageService, cA as ImageTransformOptions, cB as InferAggregateResult, cC as JoinFieldAdmin, cD as JsonFieldAdmin, cE as JsonFormat, cF as KanbanViewConfig, cG as LIFECYCLE_EVENT_NAMES, cH as LifecycleEventHandler, cI as LinkFormat, cJ as MetricColor, cK as MoneyFieldAdmin, cL as MoneyFieldConfig, cM as MultiSelectFieldAdmin, cN as NamedAccessPolicy, cO as NavBadgeConfig, cP as NavGroup, cQ as NumberFieldAdmin, cR as NumberFormat, cS as NumberLimitFieldAdmin, cT as NumberLimitFieldConfig, cU as NumericOperation, cV as NumericUpdateOperator, cW as OIDCAdminAuthProvider, cX as OptionFormat, cY as OutboundEmail, cZ as PaginatedResult, c_ as PinnedNavItemRef, c$ as PublicAdminAuthProvider, d0 as QueryCollectionResult, d1 as RAGSearchResult, d2 as RadioFieldAdmin, d3 as RateLimitConfig, d4 as ReadonlyDatabaseAdapter, d5 as RichTextFeature, d6 as RichTextFieldConfig, d7 as SelectFieldAdmin, d8 as SqlWhereResult, d9 as StorageAdapter, da as TableViewConfig, db as TaskContext, dc as TaskLogger, dd as TaskRunStatus, de as TextFieldAdmin, df as TextFormat, dg as TextareaFieldAdmin, dh as TrashConfig, di as TrustProxyConfig, dj as TypedField, dk as UploadConfig, dl as UrlFieldAdmin, dm as UrlLinkValue, dn as ViewActionFeatures, dp as ViewComponentSlots, dq as ViewConfigBase, dr as ViewLayout, ds as ViewMetric, dt as ViewSubMetric, du as WhereClause, dv as WhereOperator, dw as WhereOperatorName, dx as WordLimitFieldAdmin, dy as WordLimitFieldConfig, dz as WorkflowMetadata, dA as WorkflowOnTransitionContext, dB as WorkflowOnTransitionHook, dC as WorkflowRole, dD as WorkflowState, dE as WorkflowTransitionContext, dF as coerceBooleanWhere, dG as defineAction, dH as defineCalendarView, dI as defineCardsView, dJ as defineGanttView, dK as defineKanbanView, dL as defineTableView, dM as defineView, dN as defineWorkspace, dO as isAICollection, dP as parseMongoWhere, dQ as parseSqlWhere } from './app-v23fNf58.cjs';
1
+ import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as DatabaseAdapter, f as BaseDocument, H as HookRequestContext, T as TaskRunResult, g as TaskConfig, h as DetailActionOptions, i as DetailAction, j as DetailComputedOptions, k as ComputedHandler, l as DetailComputed, m as DetailCustomOptions, n as DetailCustom, o as DetailDividerOptions, p as DetailDivider, q as DisplayFieldOptions, r as DetailField, s as DetailItem, t as DetailGridOptions, u as DetailGrid, v as DetailRepeatOptions, w as DetailRepeat, x as DetailSectionOptions, y as DetailSection, z as DetailTabOptions, E as DetailTab, I as DetailTabsOptions, J as DetailTabs, K as DetailTextOptions, M as DetailText, N as DetailSchema, O as DyrectedContext, Q as AIConfig, R as AIPIIConfig, S as IdStrategy, U as CompiledNavTree, V as CompiledNavItem, X as UserNavigationPreferences, Y as DefineWorkspaceOptions, Z as ViewConfig, _ as DateTimeField, $ as RelationshipField, a0 as SelectField, a1 as ArrayField, a2 as FieldType, a3 as BooleanField, a4 as AuthConfig, a5 as AccessPolicyResolver, a6 as DateField, a7 as TextField, a8 as EmailField, a9 as IconField, aa as ImageField, ab as JoinField, ac as JsonField, ad as MoneyField, ae as MultiSelectField, af as NumberField, ag as ObjectField, ah as RadioField, ai as RichTextField, aj as RowField, ak as TextareaField, al as TimeField, am as UrlField } from './app-BNdnl0s-.cjs';
2
+ export { an as AIAction, ao as AIActionStatus, ap as AIActionType, aq as AIAuditActionType, ar as AIAuditRecord, as as AIChunk, at as AIMessage, au as AIPIIPattern, av as AIRateLimitResult, aw as AIRateLimitStore, ax as AIThread, ay as AIToolContext, az as AIToolDefinition, aA as AI_ACTIONS_COLLECTION, aB as AI_AUDIT_COLLECTION, aC as AI_CHUNKS_COLLECTION, aD as AI_MESSAGES_COLLECTION, aE as AI_THREADS_COLLECTION, aF as AccessConfig, aG as AccessFunction, aH as AccessFunctionArgs, aI as AccessResult, aJ as AccessRule, aK as ActionConfig, aL as ActionConfigBase, aM as ActionConfigWithHandler, aN as ActionConfigWithMutation, aO as ActionContext, aP as ActionType, aQ as AdminAuthAccessResolution, aR as AdminAuthClaimMapping, aS as AdminAuthMember, aT as AdminAuthProvider, aU as AdminAuthProviderMembersConfig, aV as AdminAuthProvisioningMode, aW as AdminAuthResolveAccessArgs, aX as AdminAuthResolvedIdentity, aY as AdminConfig, aZ as AdminDashboardComponentSlots, a_ as AdminIconName, a$ as AggregateArgs, b0 as AggregateCastType, b1 as AggregateCollectionResult, b2 as AggregateInput, b3 as AggregateOperation, b4 as AggregateResult, b5 as AppTrashConfig, b6 as BaseAdminAuthProvider, b7 as BaseFieldAdmin, b8 as BlockVariant, b9 as BlocksField, ba as BooleanFieldAdmin, bb as BooleanFormat, bc as CURRENT_NAV_PREFERENCES_VERSION, bd as CalendarViewConfig, be as CardsViewConfig, bf as CharacterLimitFieldAdmin, bg as CharacterLimitFieldConfig, bh as CollectionAfterChangeHook, bi as CollectionAfterDeleteHook, bj as CollectionAfterReadHook, bk as CollectionAfterReadHookEntry, bl as CollectionAfterRestoreHook, bm as CollectionAfterTransitionHook, bn as CollectionAfterTrashHook, bo as CollectionBeforeChangeHook, bp as CollectionBeforeChangeHookEntry, bq as CollectionBeforeCommitHook, br as CollectionBeforeDeleteHook, bs as CollectionBeforeReadHook, bt as CollectionBeforeReadHookEntry, bu as CollectionBeforeRestoreHook, bv as CollectionBeforeTransitionHook, bw as CollectionBeforeTrashHook, bx as CollectionEmailConfig, by as CollectionIndex, bz as CollectionListComponentSlots, bA as CollectionRAGConfig, bB as CollectionSchemaResult, bC as CollectionSummaryResult, bD as CollectionViewComponentSlots, bE as CompiledNavGroup, bF as CountOperation, bG as CustomAdminAuthProvider, bH as DEFAULT_USER_NAV_PREFERENCES, bI as DateFieldAdmin, bJ as DateFormat, bK as DefaultValueContext, bL as DefineActionOptions, bM as DefineCalendarViewOptions, bN as DefineCardsViewOptions, bO as DefineGanttViewOptions, bP as DefineKanbanViewOptions, bQ as DefineTableViewOptions, bR as DefineViewBaseOptions, bS as DefineViewOptions, bT as DetailSpan, bU as DisplayTone, bV as DisplayVariant, bW as DistinctCountOperation, bX as DistinctValuesOperation, bY as DynamicOptionItem, bZ as DynamicOptionsConfig, b_ as DynamicOptionsResolver, b$ as DynamicOptionsResolverArgs, c0 as DyrectedAIContext, c1 as DyrectedLoggerConfig, c2 as DyrectedObservabilityConfig, c3 as EmailFieldAdmin, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, c6 as FieldAdminHooks, c7 as FieldAdminOnChangeHook, c8 as FieldAdminOnChangeHookArgs, c9 as FieldAdminOptionsHook, ca as FieldAdminOptionsHookArgs, cb as FieldAdminOptionsHookResult, cc as FieldAfterReadHook, cd as FieldAfterReadHookArgs, ce as FieldBase, cf as FieldBeforeChangeHook, cg as FieldBeforeChangeHookArgs, ch as FieldHook, ci as FieldHooks, cj as FileData, ck as GanttViewConfig, cl as GetDocumentResult, cm as GlobalAfterChangeHook, cn as GlobalAfterReadHook, co as GlobalAfterReadHookEntry, cp as GlobalBeforeChangeHook, cq as GlobalBeforeChangeHookEntry, cr as GlobalBeforeReadHook, cs as GlobalBeforeReadHookEntry, ct as GlobalRAGConfig, cu as GlobalSchemaResult, cv as GlobalSummaryResult, cw as HeadingLevel, cx as HookFunction, cy as IconFieldAdmin, cz as ImageService, cA as ImageTransformOptions, cB as InferAggregateResult, cC as JoinFieldAdmin, cD as JsonFieldAdmin, cE as JsonFormat, cF as KanbanViewConfig, cG as LIFECYCLE_EVENT_NAMES, cH as LifecycleEventHandler, cI as LinkFormat, cJ as MetricColor, cK as MoneyFieldAdmin, cL as MoneyFieldConfig, cM as MultiSelectFieldAdmin, cN as NamedAccessPolicy, cO as NavBadgeConfig, cP as NavGroup, cQ as NumberFieldAdmin, cR as NumberFormat, cS as NumberLimitFieldAdmin, cT as NumberLimitFieldConfig, cU as NumericOperation, cV as NumericUpdateOperator, cW as OIDCAdminAuthProvider, cX as OptionFormat, cY as OutboundEmail, cZ as PaginatedResult, c_ as PinnedNavItemRef, c$ as PublicAdminAuthProvider, d0 as QueryCollectionResult, d1 as RAGSearchResult, d2 as RadioFieldAdmin, d3 as RateLimitConfig, d4 as ReadonlyDatabaseAdapter, d5 as RichTextFeature, d6 as RichTextFieldConfig, d7 as SelectFieldAdmin, d8 as SqlWhereResult, d9 as StorageAdapter, da as TableViewConfig, db as TaskContext, dc as TaskLogger, dd as TaskRunStatus, de as TextFieldAdmin, df as TextFormat, dg as TextareaFieldAdmin, dh as TrashConfig, di as TrustProxyConfig, dj as TypedField, dk as UploadConfig, dl as UrlFieldAdmin, dm as UrlLinkValue, dn as ViewActionFeatures, dp as ViewComponentSlots, dq as ViewConfigBase, dr as ViewLayout, ds as ViewMetric, dt as ViewMetricGroupBy, du as ViewMetricGroupByConfig, dv as ViewSubMetric, dw as WhereClause, dx as WhereOperator, dy as WhereOperatorName, dz as WordLimitFieldAdmin, dA as WordLimitFieldConfig, dB as WorkflowMetadata, dC as WorkflowOnTransitionContext, dD as WorkflowOnTransitionHook, dE as WorkflowRole, dF as WorkflowState, dG as WorkflowTransitionContext, dH as coerceBooleanWhere, dI as defineAction, dJ as defineCalendarView, dK as defineCardsView, dL as defineGanttView, dM as defineKanbanView, dN as defineTableView, dO as defineView, dP as defineWorkspace, dQ as isAICollection, dR as parseMongoWhere, dS as parseSqlWhere } from './app-BNdnl0s-.cjs';
3
3
  import jexl from 'jexl';
4
4
  import { Context } from 'hono';
5
5
  export { z } from 'zod';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as DatabaseAdapter, f as BaseDocument, H as HookRequestContext, T as TaskRunResult, g as TaskConfig, h as DetailActionOptions, i as DetailAction, j as DetailComputedOptions, k as ComputedHandler, l as DetailComputed, m as DetailCustomOptions, n as DetailCustom, o as DetailDividerOptions, p as DetailDivider, q as DisplayFieldOptions, r as DetailField, s as DetailItem, t as DetailGridOptions, u as DetailGrid, v as DetailRepeatOptions, w as DetailRepeat, x as DetailSectionOptions, y as DetailSection, z as DetailTabOptions, E as DetailTab, I as DetailTabsOptions, J as DetailTabs, K as DetailTextOptions, M as DetailText, N as DetailSchema, O as DyrectedContext, Q as AIConfig, R as AIPIIConfig, S as IdStrategy, U as CompiledNavTree, V as CompiledNavItem, X as UserNavigationPreferences, Y as DefineWorkspaceOptions, Z as ViewConfig, _ as DateTimeField, $ as RelationshipField, a0 as SelectField, a1 as ArrayField, a2 as FieldType, a3 as BooleanField, a4 as AuthConfig, a5 as AccessPolicyResolver, a6 as DateField, a7 as TextField, a8 as EmailField, a9 as IconField, aa as ImageField, ab as JoinField, ac as JsonField, ad as MoneyField, ae as MultiSelectField, af as NumberField, ag as ObjectField, ah as RadioField, ai as RichTextField, aj as RowField, ak as TextareaField, al as TimeField, am as UrlField } from './app-v23fNf58.js';
2
- export { an as AIAction, ao as AIActionStatus, ap as AIActionType, aq as AIAuditActionType, ar as AIAuditRecord, as as AIChunk, at as AIMessage, au as AIPIIPattern, av as AIRateLimitResult, aw as AIRateLimitStore, ax as AIThread, ay as AIToolContext, az as AIToolDefinition, aA as AI_ACTIONS_COLLECTION, aB as AI_AUDIT_COLLECTION, aC as AI_CHUNKS_COLLECTION, aD as AI_MESSAGES_COLLECTION, aE as AI_THREADS_COLLECTION, aF as AccessConfig, aG as AccessFunction, aH as AccessFunctionArgs, aI as AccessResult, aJ as AccessRule, aK as ActionConfig, aL as ActionConfigBase, aM as ActionConfigWithHandler, aN as ActionConfigWithMutation, aO as ActionContext, aP as ActionType, aQ as AdminAuthAccessResolution, aR as AdminAuthClaimMapping, aS as AdminAuthMember, aT as AdminAuthProvider, aU as AdminAuthProviderMembersConfig, aV as AdminAuthProvisioningMode, aW as AdminAuthResolveAccessArgs, aX as AdminAuthResolvedIdentity, aY as AdminConfig, aZ as AdminDashboardComponentSlots, a_ as AdminIconName, a$ as AggregateArgs, b0 as AggregateCastType, b1 as AggregateCollectionResult, b2 as AggregateInput, b3 as AggregateOperation, b4 as AggregateResult, b5 as AppTrashConfig, b6 as BaseAdminAuthProvider, b7 as BaseFieldAdmin, b8 as BlockVariant, b9 as BlocksField, ba as BooleanFieldAdmin, bb as BooleanFormat, bc as CURRENT_NAV_PREFERENCES_VERSION, bd as CalendarViewConfig, be as CardsViewConfig, bf as CharacterLimitFieldAdmin, bg as CharacterLimitFieldConfig, bh as CollectionAfterChangeHook, bi as CollectionAfterDeleteHook, bj as CollectionAfterReadHook, bk as CollectionAfterReadHookEntry, bl as CollectionAfterRestoreHook, bm as CollectionAfterTransitionHook, bn as CollectionAfterTrashHook, bo as CollectionBeforeChangeHook, bp as CollectionBeforeChangeHookEntry, bq as CollectionBeforeCommitHook, br as CollectionBeforeDeleteHook, bs as CollectionBeforeReadHook, bt as CollectionBeforeReadHookEntry, bu as CollectionBeforeRestoreHook, bv as CollectionBeforeTransitionHook, bw as CollectionBeforeTrashHook, bx as CollectionEmailConfig, by as CollectionIndex, bz as CollectionListComponentSlots, bA as CollectionRAGConfig, bB as CollectionSchemaResult, bC as CollectionSummaryResult, bD as CollectionViewComponentSlots, bE as CompiledNavGroup, bF as CountOperation, bG as CustomAdminAuthProvider, bH as DEFAULT_USER_NAV_PREFERENCES, bI as DateFieldAdmin, bJ as DateFormat, bK as DefaultValueContext, bL as DefineActionOptions, bM as DefineCalendarViewOptions, bN as DefineCardsViewOptions, bO as DefineGanttViewOptions, bP as DefineKanbanViewOptions, bQ as DefineTableViewOptions, bR as DefineViewBaseOptions, bS as DefineViewOptions, bT as DetailSpan, bU as DisplayTone, bV as DisplayVariant, bW as DistinctCountOperation, bX as DistinctValuesOperation, bY as DynamicOptionItem, bZ as DynamicOptionsConfig, b_ as DynamicOptionsResolver, b$ as DynamicOptionsResolverArgs, c0 as DyrectedAIContext, c1 as DyrectedLoggerConfig, c2 as DyrectedObservabilityConfig, c3 as EmailFieldAdmin, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, c6 as FieldAdminHooks, c7 as FieldAdminOnChangeHook, c8 as FieldAdminOnChangeHookArgs, c9 as FieldAdminOptionsHook, ca as FieldAdminOptionsHookArgs, cb as FieldAdminOptionsHookResult, cc as FieldAfterReadHook, cd as FieldAfterReadHookArgs, ce as FieldBase, cf as FieldBeforeChangeHook, cg as FieldBeforeChangeHookArgs, ch as FieldHook, ci as FieldHooks, cj as FileData, ck as GanttViewConfig, cl as GetDocumentResult, cm as GlobalAfterChangeHook, cn as GlobalAfterReadHook, co as GlobalAfterReadHookEntry, cp as GlobalBeforeChangeHook, cq as GlobalBeforeChangeHookEntry, cr as GlobalBeforeReadHook, cs as GlobalBeforeReadHookEntry, ct as GlobalRAGConfig, cu as GlobalSchemaResult, cv as GlobalSummaryResult, cw as HeadingLevel, cx as HookFunction, cy as IconFieldAdmin, cz as ImageService, cA as ImageTransformOptions, cB as InferAggregateResult, cC as JoinFieldAdmin, cD as JsonFieldAdmin, cE as JsonFormat, cF as KanbanViewConfig, cG as LIFECYCLE_EVENT_NAMES, cH as LifecycleEventHandler, cI as LinkFormat, cJ as MetricColor, cK as MoneyFieldAdmin, cL as MoneyFieldConfig, cM as MultiSelectFieldAdmin, cN as NamedAccessPolicy, cO as NavBadgeConfig, cP as NavGroup, cQ as NumberFieldAdmin, cR as NumberFormat, cS as NumberLimitFieldAdmin, cT as NumberLimitFieldConfig, cU as NumericOperation, cV as NumericUpdateOperator, cW as OIDCAdminAuthProvider, cX as OptionFormat, cY as OutboundEmail, cZ as PaginatedResult, c_ as PinnedNavItemRef, c$ as PublicAdminAuthProvider, d0 as QueryCollectionResult, d1 as RAGSearchResult, d2 as RadioFieldAdmin, d3 as RateLimitConfig, d4 as ReadonlyDatabaseAdapter, d5 as RichTextFeature, d6 as RichTextFieldConfig, d7 as SelectFieldAdmin, d8 as SqlWhereResult, d9 as StorageAdapter, da as TableViewConfig, db as TaskContext, dc as TaskLogger, dd as TaskRunStatus, de as TextFieldAdmin, df as TextFormat, dg as TextareaFieldAdmin, dh as TrashConfig, di as TrustProxyConfig, dj as TypedField, dk as UploadConfig, dl as UrlFieldAdmin, dm as UrlLinkValue, dn as ViewActionFeatures, dp as ViewComponentSlots, dq as ViewConfigBase, dr as ViewLayout, ds as ViewMetric, dt as ViewSubMetric, du as WhereClause, dv as WhereOperator, dw as WhereOperatorName, dx as WordLimitFieldAdmin, dy as WordLimitFieldConfig, dz as WorkflowMetadata, dA as WorkflowOnTransitionContext, dB as WorkflowOnTransitionHook, dC as WorkflowRole, dD as WorkflowState, dE as WorkflowTransitionContext, dF as coerceBooleanWhere, dG as defineAction, dH as defineCalendarView, dI as defineCardsView, dJ as defineGanttView, dK as defineKanbanView, dL as defineTableView, dM as defineView, dN as defineWorkspace, dO as isAICollection, dP as parseMongoWhere, dQ as parseSqlWhere } from './app-v23fNf58.js';
1
+ import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as DatabaseAdapter, f as BaseDocument, H as HookRequestContext, T as TaskRunResult, g as TaskConfig, h as DetailActionOptions, i as DetailAction, j as DetailComputedOptions, k as ComputedHandler, l as DetailComputed, m as DetailCustomOptions, n as DetailCustom, o as DetailDividerOptions, p as DetailDivider, q as DisplayFieldOptions, r as DetailField, s as DetailItem, t as DetailGridOptions, u as DetailGrid, v as DetailRepeatOptions, w as DetailRepeat, x as DetailSectionOptions, y as DetailSection, z as DetailTabOptions, E as DetailTab, I as DetailTabsOptions, J as DetailTabs, K as DetailTextOptions, M as DetailText, N as DetailSchema, O as DyrectedContext, Q as AIConfig, R as AIPIIConfig, S as IdStrategy, U as CompiledNavTree, V as CompiledNavItem, X as UserNavigationPreferences, Y as DefineWorkspaceOptions, Z as ViewConfig, _ as DateTimeField, $ as RelationshipField, a0 as SelectField, a1 as ArrayField, a2 as FieldType, a3 as BooleanField, a4 as AuthConfig, a5 as AccessPolicyResolver, a6 as DateField, a7 as TextField, a8 as EmailField, a9 as IconField, aa as ImageField, ab as JoinField, ac as JsonField, ad as MoneyField, ae as MultiSelectField, af as NumberField, ag as ObjectField, ah as RadioField, ai as RichTextField, aj as RowField, ak as TextareaField, al as TimeField, am as UrlField } from './app-BNdnl0s-.js';
2
+ export { an as AIAction, ao as AIActionStatus, ap as AIActionType, aq as AIAuditActionType, ar as AIAuditRecord, as as AIChunk, at as AIMessage, au as AIPIIPattern, av as AIRateLimitResult, aw as AIRateLimitStore, ax as AIThread, ay as AIToolContext, az as AIToolDefinition, aA as AI_ACTIONS_COLLECTION, aB as AI_AUDIT_COLLECTION, aC as AI_CHUNKS_COLLECTION, aD as AI_MESSAGES_COLLECTION, aE as AI_THREADS_COLLECTION, aF as AccessConfig, aG as AccessFunction, aH as AccessFunctionArgs, aI as AccessResult, aJ as AccessRule, aK as ActionConfig, aL as ActionConfigBase, aM as ActionConfigWithHandler, aN as ActionConfigWithMutation, aO as ActionContext, aP as ActionType, aQ as AdminAuthAccessResolution, aR as AdminAuthClaimMapping, aS as AdminAuthMember, aT as AdminAuthProvider, aU as AdminAuthProviderMembersConfig, aV as AdminAuthProvisioningMode, aW as AdminAuthResolveAccessArgs, aX as AdminAuthResolvedIdentity, aY as AdminConfig, aZ as AdminDashboardComponentSlots, a_ as AdminIconName, a$ as AggregateArgs, b0 as AggregateCastType, b1 as AggregateCollectionResult, b2 as AggregateInput, b3 as AggregateOperation, b4 as AggregateResult, b5 as AppTrashConfig, b6 as BaseAdminAuthProvider, b7 as BaseFieldAdmin, b8 as BlockVariant, b9 as BlocksField, ba as BooleanFieldAdmin, bb as BooleanFormat, bc as CURRENT_NAV_PREFERENCES_VERSION, bd as CalendarViewConfig, be as CardsViewConfig, bf as CharacterLimitFieldAdmin, bg as CharacterLimitFieldConfig, bh as CollectionAfterChangeHook, bi as CollectionAfterDeleteHook, bj as CollectionAfterReadHook, bk as CollectionAfterReadHookEntry, bl as CollectionAfterRestoreHook, bm as CollectionAfterTransitionHook, bn as CollectionAfterTrashHook, bo as CollectionBeforeChangeHook, bp as CollectionBeforeChangeHookEntry, bq as CollectionBeforeCommitHook, br as CollectionBeforeDeleteHook, bs as CollectionBeforeReadHook, bt as CollectionBeforeReadHookEntry, bu as CollectionBeforeRestoreHook, bv as CollectionBeforeTransitionHook, bw as CollectionBeforeTrashHook, bx as CollectionEmailConfig, by as CollectionIndex, bz as CollectionListComponentSlots, bA as CollectionRAGConfig, bB as CollectionSchemaResult, bC as CollectionSummaryResult, bD as CollectionViewComponentSlots, bE as CompiledNavGroup, bF as CountOperation, bG as CustomAdminAuthProvider, bH as DEFAULT_USER_NAV_PREFERENCES, bI as DateFieldAdmin, bJ as DateFormat, bK as DefaultValueContext, bL as DefineActionOptions, bM as DefineCalendarViewOptions, bN as DefineCardsViewOptions, bO as DefineGanttViewOptions, bP as DefineKanbanViewOptions, bQ as DefineTableViewOptions, bR as DefineViewBaseOptions, bS as DefineViewOptions, bT as DetailSpan, bU as DisplayTone, bV as DisplayVariant, bW as DistinctCountOperation, bX as DistinctValuesOperation, bY as DynamicOptionItem, bZ as DynamicOptionsConfig, b_ as DynamicOptionsResolver, b$ as DynamicOptionsResolverArgs, c0 as DyrectedAIContext, c1 as DyrectedLoggerConfig, c2 as DyrectedObservabilityConfig, c3 as EmailFieldAdmin, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, c6 as FieldAdminHooks, c7 as FieldAdminOnChangeHook, c8 as FieldAdminOnChangeHookArgs, c9 as FieldAdminOptionsHook, ca as FieldAdminOptionsHookArgs, cb as FieldAdminOptionsHookResult, cc as FieldAfterReadHook, cd as FieldAfterReadHookArgs, ce as FieldBase, cf as FieldBeforeChangeHook, cg as FieldBeforeChangeHookArgs, ch as FieldHook, ci as FieldHooks, cj as FileData, ck as GanttViewConfig, cl as GetDocumentResult, cm as GlobalAfterChangeHook, cn as GlobalAfterReadHook, co as GlobalAfterReadHookEntry, cp as GlobalBeforeChangeHook, cq as GlobalBeforeChangeHookEntry, cr as GlobalBeforeReadHook, cs as GlobalBeforeReadHookEntry, ct as GlobalRAGConfig, cu as GlobalSchemaResult, cv as GlobalSummaryResult, cw as HeadingLevel, cx as HookFunction, cy as IconFieldAdmin, cz as ImageService, cA as ImageTransformOptions, cB as InferAggregateResult, cC as JoinFieldAdmin, cD as JsonFieldAdmin, cE as JsonFormat, cF as KanbanViewConfig, cG as LIFECYCLE_EVENT_NAMES, cH as LifecycleEventHandler, cI as LinkFormat, cJ as MetricColor, cK as MoneyFieldAdmin, cL as MoneyFieldConfig, cM as MultiSelectFieldAdmin, cN as NamedAccessPolicy, cO as NavBadgeConfig, cP as NavGroup, cQ as NumberFieldAdmin, cR as NumberFormat, cS as NumberLimitFieldAdmin, cT as NumberLimitFieldConfig, cU as NumericOperation, cV as NumericUpdateOperator, cW as OIDCAdminAuthProvider, cX as OptionFormat, cY as OutboundEmail, cZ as PaginatedResult, c_ as PinnedNavItemRef, c$ as PublicAdminAuthProvider, d0 as QueryCollectionResult, d1 as RAGSearchResult, d2 as RadioFieldAdmin, d3 as RateLimitConfig, d4 as ReadonlyDatabaseAdapter, d5 as RichTextFeature, d6 as RichTextFieldConfig, d7 as SelectFieldAdmin, d8 as SqlWhereResult, d9 as StorageAdapter, da as TableViewConfig, db as TaskContext, dc as TaskLogger, dd as TaskRunStatus, de as TextFieldAdmin, df as TextFormat, dg as TextareaFieldAdmin, dh as TrashConfig, di as TrustProxyConfig, dj as TypedField, dk as UploadConfig, dl as UrlFieldAdmin, dm as UrlLinkValue, dn as ViewActionFeatures, dp as ViewComponentSlots, dq as ViewConfigBase, dr as ViewLayout, ds as ViewMetric, dt as ViewMetricGroupBy, du as ViewMetricGroupByConfig, dv as ViewSubMetric, dw as WhereClause, dx as WhereOperator, dy as WhereOperatorName, dz as WordLimitFieldAdmin, dA as WordLimitFieldConfig, dB as WorkflowMetadata, dC as WorkflowOnTransitionContext, dD as WorkflowOnTransitionHook, dE as WorkflowRole, dF as WorkflowState, dG as WorkflowTransitionContext, dH as coerceBooleanWhere, dI as defineAction, dJ as defineCalendarView, dK as defineCardsView, dL as defineGanttView, dM as defineKanbanView, dN as defineTableView, dO as defineView, dP as defineWorkspace, dQ as isAICollection, dR as parseMongoWhere, dS as parseSqlWhere } from './app-BNdnl0s-.js';
3
3
  import jexl from 'jexl';
4
4
  import { Context } from 'hono';
5
5
  export { z } from 'zod';
package/dist/index.js CHANGED
@@ -5247,6 +5247,10 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5247
5247
  }
5248
5248
  return `${c} = ${next()}`;
5249
5249
  case "not_equals":
5250
+ case "not":
5251
+ case "ne":
5252
+ case "not_equal":
5253
+ case "notEquals":
5250
5254
  if (operand === null) {
5251
5255
  return `${c} IS NOT NULL`;
5252
5256
  }
@@ -5262,9 +5266,33 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5262
5266
  } else {
5263
5267
  params.push(operand);
5264
5268
  }
5265
- } else {
5266
- params.push(operand);
5269
+ return `${c} != ${next()}`;
5270
+ }
5271
+ if (Array.isArray(operand)) {
5272
+ if (operand.length === 0) return "1=1";
5273
+ const placeholders = operand.map((v) => {
5274
+ if (typeof v === "boolean") {
5275
+ if (placeholder === "?") {
5276
+ params.push(v ? 1 : 0);
5277
+ } else if (isJsonExtract) {
5278
+ params.push(String(v));
5279
+ } else {
5280
+ params.push(v);
5281
+ }
5282
+ } else {
5283
+ params.push(v);
5284
+ }
5285
+ return next();
5286
+ });
5287
+ return `${c} NOT IN (${placeholders.join(", ")})`;
5288
+ }
5289
+ if (typeof operand === "object") {
5290
+ const innerEntries = Object.entries(operand);
5291
+ if (innerEntries.length === 0) return "1=1";
5292
+ const innerSql = innerEntries.map(([innerOp, innerOperand]) => buildSingleOp(c, innerOp, innerOperand)).join(" AND ");
5293
+ return `NOT (${innerSql})`;
5267
5294
  }
5295
+ params.push(operand);
5268
5296
  return `${c} != ${next()}`;
5269
5297
  case "in": {
5270
5298
  const vals = Array.isArray(operand) ? operand : [operand];
@@ -5335,6 +5363,15 @@ function parseSqlWhere(where, getJsonField, placeholder = "?", likeOperator = pl
5335
5363
  } else if (upperField === "AND" && Array.isArray(value)) {
5336
5364
  const sub = value.map((v) => `(${buildClause(v)})`).join(" AND ");
5337
5365
  parts.push(`(${sub})`);
5366
+ } else if (upperField === "NOT") {
5367
+ if (Array.isArray(value)) {
5368
+ const sub = value.map((v) => `(${buildClause(v)})`).join(" AND ");
5369
+ parts.push(`(NOT (${sub}))`);
5370
+ } else if (typeof value === "object" && value !== null && !("equals" in value || "not_equals" in value || "not" in value || "ne" in value || "not_equal" in value || "notEquals" in value || "in" in value || "not_in" in value || "gt" in value || "gte" in value || "lt" in value || "lte" in value || "contains" in value || "like" in value || "starts_with" in value || "exists" in value)) {
5371
+ parts.push(`(NOT (${buildClause(value)}))`);
5372
+ } else {
5373
+ parts.push(buildOperator(field, value));
5374
+ }
5338
5375
  } else {
5339
5376
  parts.push(buildOperator(field, value));
5340
5377
  }
@@ -5365,7 +5402,28 @@ function parseMongoWhere(where) {
5365
5402
  case "equals":
5366
5403
  return { [field]: { $eq: operand } };
5367
5404
  case "not_equals":
5405
+ case "not":
5406
+ case "ne":
5407
+ case "not_equal":
5408
+ case "notEquals": {
5409
+ if (Array.isArray(operand)) {
5410
+ return { [field]: { $nin: operand } };
5411
+ }
5412
+ if (typeof operand === "object" && operand !== null) {
5413
+ const innerEntries = Object.entries(operand);
5414
+ if (innerEntries.length === 1) {
5415
+ const [innerOp, innerOperand] = innerEntries[0];
5416
+ const inner = buildSingleOp(field, innerOp, innerOperand)[field];
5417
+ return { [field]: { $not: inner } };
5418
+ }
5419
+ const merged = {};
5420
+ for (const [innerOp, innerOperand] of innerEntries) {
5421
+ Object.assign(merged, buildSingleOp(field, innerOp, innerOperand)[field]);
5422
+ }
5423
+ return { [field]: { $not: merged } };
5424
+ }
5368
5425
  return { [field]: { $ne: operand } };
5426
+ }
5369
5427
  case "in":
5370
5428
  return { [field]: { $in: Array.isArray(operand) ? operand : [operand] } };
5371
5429
  case "not_in":
@@ -5403,6 +5461,14 @@ function parseMongoWhere(where) {
5403
5461
  conditions.push({ $or: value.map(buildClause) });
5404
5462
  } else if (upperField === "AND" && Array.isArray(value)) {
5405
5463
  conditions.push({ $and: value.map(buildClause) });
5464
+ } else if (upperField === "NOT") {
5465
+ if (Array.isArray(value)) {
5466
+ conditions.push({ $nor: value.map(buildClause) });
5467
+ } else if (typeof value === "object" && value !== null && !("equals" in value || "not_equals" in value || "not" in value || "ne" in value || "not_equal" in value || "notEquals" in value || "in" in value || "not_in" in value || "gt" in value || "gte" in value || "lt" in value || "lte" in value || "contains" in value || "like" in value || "starts_with" in value || "exists" in value)) {
5468
+ conditions.push({ $nor: [buildClause(value)] });
5469
+ } else {
5470
+ conditions.push(buildOperator(field, value));
5471
+ }
5406
5472
  } else {
5407
5473
  conditions.push(buildOperator(field, value));
5408
5474
  }
@@ -5424,7 +5490,7 @@ function coerceBooleanWhere(where, fields) {
5424
5490
  if (!node || typeof node !== "object") return node;
5425
5491
  const out = {};
5426
5492
  for (const [key, value] of Object.entries(node)) {
5427
- if (key.toUpperCase() === "AND" || key.toUpperCase() === "OR") {
5493
+ if (key.toUpperCase() === "AND" || key.toUpperCase() === "OR" || key.toUpperCase() === "NOT") {
5428
5494
  out[key] = walk(value);
5429
5495
  } else if (booleanFields.has(key)) {
5430
5496
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -7747,8 +7813,19 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
7747
7813
  }
7748
7814
  }
7749
7815
  for (const itemOpt of effectivePrefs.items || []) {
7750
- const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group;
7751
- const groupKey = targetGroup || "Custom";
7816
+ const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
7817
+ let existingItem;
7818
+ let existingParentGroup;
7819
+ for (const g of groupsList) {
7820
+ const found = g.items.find((i) => i.id === itemId || i.slug === itemOpt.slug);
7821
+ if (found) {
7822
+ existingItem = found;
7823
+ existingParentGroup = g;
7824
+ break;
7825
+ }
7826
+ }
7827
+ const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group || existingParentGroup?.name || "Custom";
7828
+ const groupKey = targetGroup;
7752
7829
  let group = findGroup(groupKey);
7753
7830
  if (!group) {
7754
7831
  group = {
@@ -7762,18 +7839,45 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
7762
7839
  };
7763
7840
  groupsList.push(group);
7764
7841
  }
7765
- const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
7766
7842
  for (const otherGroup of groupsList) {
7767
7843
  if (otherGroup !== group) {
7768
7844
  otherGroup.items = otherGroup.items.filter((i) => i.slug !== itemOpt.slug && i.id !== itemId);
7769
7845
  }
7770
7846
  }
7771
7847
  const existingIndex = group.items.findIndex((i) => i.id === itemId || i.slug === itemOpt.slug);
7772
- const existingItem = existingIndex >= 0 ? group.items[existingIndex] : void 0;
7848
+ if (existingIndex >= 0) {
7849
+ existingItem = group.items[existingIndex];
7850
+ }
7773
7851
  const col = schemas?.collections?.find((c) => c.slug === itemOpt.collection);
7774
7852
  const colViews = col?.views || [];
7775
7853
  const baseViews = existingItem?.views || [];
7776
- const userViews = itemOpt.views || [];
7854
+ const userViews = (itemOpt.views || []).map((uv) => {
7855
+ const bv = baseViews.find((b) => b.slug === uv.slug);
7856
+ if (!bv) return uv;
7857
+ const metricsScope = uv.metricsScope ?? bv.metricsScope;
7858
+ let metrics = uv.metrics;
7859
+ if (Array.isArray(uv.metrics) && Array.isArray(bv.metrics)) {
7860
+ metrics = uv.metrics.map((um) => {
7861
+ const bm = bv.metrics?.find((m) => m.label === um.label);
7862
+ if (!bm) return um;
7863
+ return {
7864
+ ...bm,
7865
+ ...um,
7866
+ scope: um.scope ?? bm.scope,
7867
+ groupBy: um.groupBy ?? bm.groupBy,
7868
+ subMetrics: um.subMetrics ?? bm.subMetrics
7869
+ };
7870
+ });
7871
+ } else if (!uv.metrics && bv.metrics) {
7872
+ metrics = bv.metrics;
7873
+ }
7874
+ return {
7875
+ ...bv,
7876
+ ...uv,
7877
+ metricsScope,
7878
+ metrics
7879
+ };
7880
+ });
7777
7881
  const userViewSlugs = new Set(userViews.map((v) => v.slug));
7778
7882
  let mergedViews = [
7779
7883
  ...baseViews.filter((v) => !userViewSlugs.has(v.slug)),
package/dist/server.cjs CHANGED
@@ -4307,12 +4307,17 @@ function sanitizeWhereClause(where, fields) {
4307
4307
  const result = {};
4308
4308
  for (const [key, value] of Object.entries(node)) {
4309
4309
  const upperKey = key.toUpperCase();
4310
- if (upperKey === "AND" || upperKey === "OR") {
4310
+ if (upperKey === "AND" || upperKey === "OR" || upperKey === "NOT") {
4311
4311
  if (Array.isArray(value)) {
4312
4312
  const processed = value.map((v) => walk(v)).filter((v) => Object.keys(v).length > 0);
4313
4313
  if (processed.length > 0) {
4314
4314
  result[upperKey] = processed;
4315
4315
  }
4316
+ } else if (typeof value === "object" && value !== null) {
4317
+ const processed = walk(value);
4318
+ if (Object.keys(processed).length > 0) {
4319
+ result[upperKey] = processed;
4320
+ }
4316
4321
  }
4317
4322
  continue;
4318
4323
  }
@@ -6950,8 +6955,19 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
6950
6955
  }
6951
6956
  }
6952
6957
  for (const itemOpt of effectivePrefs.items || []) {
6953
- const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group;
6954
- const groupKey = targetGroup || "Custom";
6958
+ const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
6959
+ let existingItem;
6960
+ let existingParentGroup;
6961
+ for (const g of groupsList) {
6962
+ const found = g.items.find((i) => i.id === itemId || i.slug === itemOpt.slug);
6963
+ if (found) {
6964
+ existingItem = found;
6965
+ existingParentGroup = g;
6966
+ break;
6967
+ }
6968
+ }
6969
+ const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group || existingParentGroup?.name || "Custom";
6970
+ const groupKey = targetGroup;
6955
6971
  let group = findGroup(groupKey);
6956
6972
  if (!group) {
6957
6973
  group = {
@@ -6965,18 +6981,45 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
6965
6981
  };
6966
6982
  groupsList.push(group);
6967
6983
  }
6968
- const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
6969
6984
  for (const otherGroup of groupsList) {
6970
6985
  if (otherGroup !== group) {
6971
6986
  otherGroup.items = otherGroup.items.filter((i) => i.slug !== itemOpt.slug && i.id !== itemId);
6972
6987
  }
6973
6988
  }
6974
6989
  const existingIndex = group.items.findIndex((i) => i.id === itemId || i.slug === itemOpt.slug);
6975
- const existingItem = existingIndex >= 0 ? group.items[existingIndex] : void 0;
6990
+ if (existingIndex >= 0) {
6991
+ existingItem = group.items[existingIndex];
6992
+ }
6976
6993
  const col = schemas?.collections?.find((c) => c.slug === itemOpt.collection);
6977
6994
  const colViews = col?.views || [];
6978
6995
  const baseViews = existingItem?.views || [];
6979
- const userViews = itemOpt.views || [];
6996
+ const userViews = (itemOpt.views || []).map((uv) => {
6997
+ const bv = baseViews.find((b) => b.slug === uv.slug);
6998
+ if (!bv) return uv;
6999
+ const metricsScope = uv.metricsScope ?? bv.metricsScope;
7000
+ let metrics = uv.metrics;
7001
+ if (Array.isArray(uv.metrics) && Array.isArray(bv.metrics)) {
7002
+ metrics = uv.metrics.map((um) => {
7003
+ const bm = bv.metrics?.find((m) => m.label === um.label);
7004
+ if (!bm) return um;
7005
+ return {
7006
+ ...bm,
7007
+ ...um,
7008
+ scope: um.scope ?? bm.scope,
7009
+ groupBy: um.groupBy ?? bm.groupBy,
7010
+ subMetrics: um.subMetrics ?? bm.subMetrics
7011
+ };
7012
+ });
7013
+ } else if (!uv.metrics && bv.metrics) {
7014
+ metrics = bv.metrics;
7015
+ }
7016
+ return {
7017
+ ...bv,
7018
+ ...uv,
7019
+ metricsScope,
7020
+ metrics
7021
+ };
7022
+ });
6980
7023
  const userViewSlugs = new Set(userViews.map((v) => v.slug));
6981
7024
  let mergedViews = [
6982
7025
  ...baseViews.filter((v) => !userViewSlugs.has(v.slug)),
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, cY as OutboundEmail, e as DatabaseAdapter, b as AuthenticatedUser, c0 as DyrectedAIContext, ax as AIThread, at as AIMessage, d1 as RAGSearchResult, aw as AIRateLimitStore, av as AIRateLimitResult } from './app-v23fNf58.cjs';
2
- export { dR as CollectionTokenPayload, dS as DEFAULT_INVITE_EXPIRY, dT as DEFAULT_RESET_PASSWORD_EXPIRY, dU as DEFAULT_SESSION_EXPIRY, dV as DyrectedObservabilityRuntime, dW as RequestBodyCapture, dX as RequestTraceContext, dY as ResolvedObservabilityConfig, dZ as attachRequestMetrics, d_ as bindObservabilityRuntime, d$ as buildRequestLogger, e0 as captureRequestBody, e1 as createDyrectedApp, e2 as createObservabilityRuntime, e3 as createRequestSpan, e4 as decodeCollectionToken, e5 as endRequestSpan, e6 as getConfigLogger, e7 as getObservabilityRuntime, e8 as getRequestLogger, e9 as redactBody, ea as redactHeaders, eb as renderPrometheusMetrics, ec as resolveInviteTokenExpiry, ed as resolveObservabilityConfig, ee as resolveResetPasswordTokenExpiry, ef as resolveSessionTokenExpiry, eg as shouldSampleRequest, eh as signCollectionToken, ei as verifyCollectionToken } from './app-v23fNf58.cjs';
1
+ import { O as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, cY as OutboundEmail, e as DatabaseAdapter, b as AuthenticatedUser, c0 as DyrectedAIContext, ax as AIThread, at as AIMessage, d1 as RAGSearchResult, aw as AIRateLimitStore, av as AIRateLimitResult } from './app-BNdnl0s-.cjs';
2
+ export { dT as CollectionTokenPayload, dU as DEFAULT_INVITE_EXPIRY, dV as DEFAULT_RESET_PASSWORD_EXPIRY, dW as DEFAULT_SESSION_EXPIRY, dX as DyrectedObservabilityRuntime, dY as RequestBodyCapture, dZ as RequestTraceContext, d_ as ResolvedObservabilityConfig, d$ as attachRequestMetrics, e0 as bindObservabilityRuntime, e1 as buildRequestLogger, e2 as captureRequestBody, e3 as createDyrectedApp, e4 as createObservabilityRuntime, e5 as createRequestSpan, e6 as decodeCollectionToken, e7 as endRequestSpan, e8 as getConfigLogger, e9 as getObservabilityRuntime, ea as getRequestLogger, eb as redactBody, ec as redactHeaders, ed as renderPrometheusMetrics, ee as resolveInviteTokenExpiry, ef as resolveObservabilityConfig, eg as resolveResetPasswordTokenExpiry, eh as resolveSessionTokenExpiry, ei as shouldSampleRequest, ej as signCollectionToken, ek as verifyCollectionToken } from './app-BNdnl0s-.cjs';
3
3
  import * as hono from 'hono';
4
4
  import { Hono, Context, Next } from 'hono';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, cY as OutboundEmail, e as DatabaseAdapter, b as AuthenticatedUser, c0 as DyrectedAIContext, ax as AIThread, at as AIMessage, d1 as RAGSearchResult, aw as AIRateLimitStore, av as AIRateLimitResult } from './app-v23fNf58.js';
2
- export { dR as CollectionTokenPayload, dS as DEFAULT_INVITE_EXPIRY, dT as DEFAULT_RESET_PASSWORD_EXPIRY, dU as DEFAULT_SESSION_EXPIRY, dV as DyrectedObservabilityRuntime, dW as RequestBodyCapture, dX as RequestTraceContext, dY as ResolvedObservabilityConfig, dZ as attachRequestMetrics, d_ as bindObservabilityRuntime, d$ as buildRequestLogger, e0 as captureRequestBody, e1 as createDyrectedApp, e2 as createObservabilityRuntime, e3 as createRequestSpan, e4 as decodeCollectionToken, e5 as endRequestSpan, e6 as getConfigLogger, e7 as getObservabilityRuntime, e8 as getRequestLogger, e9 as redactBody, ea as redactHeaders, eb as renderPrometheusMetrics, ec as resolveInviteTokenExpiry, ed as resolveObservabilityConfig, ee as resolveResetPasswordTokenExpiry, ef as resolveSessionTokenExpiry, eg as shouldSampleRequest, eh as signCollectionToken, ei as verifyCollectionToken } from './app-v23fNf58.js';
1
+ import { O as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig, c4 as EmailTemplateArgs, c5 as EmailTemplateResult, cY as OutboundEmail, e as DatabaseAdapter, b as AuthenticatedUser, c0 as DyrectedAIContext, ax as AIThread, at as AIMessage, d1 as RAGSearchResult, aw as AIRateLimitStore, av as AIRateLimitResult } from './app-BNdnl0s-.js';
2
+ export { dT as CollectionTokenPayload, dU as DEFAULT_INVITE_EXPIRY, dV as DEFAULT_RESET_PASSWORD_EXPIRY, dW as DEFAULT_SESSION_EXPIRY, dX as DyrectedObservabilityRuntime, dY as RequestBodyCapture, dZ as RequestTraceContext, d_ as ResolvedObservabilityConfig, d$ as attachRequestMetrics, e0 as bindObservabilityRuntime, e1 as buildRequestLogger, e2 as captureRequestBody, e3 as createDyrectedApp, e4 as createObservabilityRuntime, e5 as createRequestSpan, e6 as decodeCollectionToken, e7 as endRequestSpan, e8 as getConfigLogger, e9 as getObservabilityRuntime, ea as getRequestLogger, eb as redactBody, ec as redactHeaders, ed as renderPrometheusMetrics, ee as resolveInviteTokenExpiry, ef as resolveObservabilityConfig, eg as resolveResetPasswordTokenExpiry, eh as resolveSessionTokenExpiry, ei as shouldSampleRequest, ej as signCollectionToken, ek as verifyCollectionToken } from './app-BNdnl0s-.js';
3
3
  import * as hono from 'hono';
4
4
  import { Hono, Context, Next } from 'hono';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
package/dist/server.js CHANGED
@@ -4305,12 +4305,17 @@ function sanitizeWhereClause(where, fields) {
4305
4305
  const result = {};
4306
4306
  for (const [key, value] of Object.entries(node)) {
4307
4307
  const upperKey = key.toUpperCase();
4308
- if (upperKey === "AND" || upperKey === "OR") {
4308
+ if (upperKey === "AND" || upperKey === "OR" || upperKey === "NOT") {
4309
4309
  if (Array.isArray(value)) {
4310
4310
  const processed = value.map((v) => walk(v)).filter((v) => Object.keys(v).length > 0);
4311
4311
  if (processed.length > 0) {
4312
4312
  result[upperKey] = processed;
4313
4313
  }
4314
+ } else if (typeof value === "object" && value !== null) {
4315
+ const processed = walk(value);
4316
+ if (Object.keys(processed).length > 0) {
4317
+ result[upperKey] = processed;
4318
+ }
4314
4319
  }
4315
4320
  continue;
4316
4321
  }
@@ -6880,8 +6885,19 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
6880
6885
  }
6881
6886
  }
6882
6887
  for (const itemOpt of effectivePrefs.items || []) {
6883
- const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group;
6884
- const groupKey = targetGroup || "Custom";
6888
+ const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
6889
+ let existingItem;
6890
+ let existingParentGroup;
6891
+ for (const g of groupsList) {
6892
+ const found = g.items.find((i) => i.id === itemId || i.slug === itemOpt.slug);
6893
+ if (found) {
6894
+ existingItem = found;
6895
+ existingParentGroup = g;
6896
+ break;
6897
+ }
6898
+ }
6899
+ const targetGroup = typeof itemOpt.group === "object" ? itemOpt.group?.name : itemOpt.group || existingParentGroup?.name || "Custom";
6900
+ const groupKey = targetGroup;
6885
6901
  let group = findGroup(groupKey);
6886
6902
  if (!group) {
6887
6903
  group = {
@@ -6895,18 +6911,45 @@ function reconcileNavigation(baseTree, prefs, schemas, options) {
6895
6911
  };
6896
6912
  groupsList.push(group);
6897
6913
  }
6898
- const itemId = itemOpt.slug ? `workspace_${itemOpt.slug}` : itemOpt.collection ? `collection_${itemOpt.collection}` : `custom_${Math.random()}`;
6899
6914
  for (const otherGroup of groupsList) {
6900
6915
  if (otherGroup !== group) {
6901
6916
  otherGroup.items = otherGroup.items.filter((i) => i.slug !== itemOpt.slug && i.id !== itemId);
6902
6917
  }
6903
6918
  }
6904
6919
  const existingIndex = group.items.findIndex((i) => i.id === itemId || i.slug === itemOpt.slug);
6905
- const existingItem = existingIndex >= 0 ? group.items[existingIndex] : void 0;
6920
+ if (existingIndex >= 0) {
6921
+ existingItem = group.items[existingIndex];
6922
+ }
6906
6923
  const col = schemas?.collections?.find((c) => c.slug === itemOpt.collection);
6907
6924
  const colViews = col?.views || [];
6908
6925
  const baseViews = existingItem?.views || [];
6909
- const userViews = itemOpt.views || [];
6926
+ const userViews = (itemOpt.views || []).map((uv) => {
6927
+ const bv = baseViews.find((b) => b.slug === uv.slug);
6928
+ if (!bv) return uv;
6929
+ const metricsScope = uv.metricsScope ?? bv.metricsScope;
6930
+ let metrics = uv.metrics;
6931
+ if (Array.isArray(uv.metrics) && Array.isArray(bv.metrics)) {
6932
+ metrics = uv.metrics.map((um) => {
6933
+ const bm = bv.metrics?.find((m) => m.label === um.label);
6934
+ if (!bm) return um;
6935
+ return {
6936
+ ...bm,
6937
+ ...um,
6938
+ scope: um.scope ?? bm.scope,
6939
+ groupBy: um.groupBy ?? bm.groupBy,
6940
+ subMetrics: um.subMetrics ?? bm.subMetrics
6941
+ };
6942
+ });
6943
+ } else if (!uv.metrics && bv.metrics) {
6944
+ metrics = bv.metrics;
6945
+ }
6946
+ return {
6947
+ ...bv,
6948
+ ...uv,
6949
+ metricsScope,
6950
+ metrics
6951
+ };
6952
+ });
6910
6953
  const userViewSlugs = new Set(userViews.map((v) => v.slug));
6911
6954
  let mergedViews = [
6912
6955
  ...baseViews.filter((v) => !userViewSlugs.has(v.slug)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/core",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -44,8 +44,8 @@
44
44
  "devDependencies": {
45
45
  "@types/node": "^20.12.12",
46
46
  "@types/nodemailer": "^6.4.23",
47
- "tsup": "^8.0.0",
48
- "typescript": "^5.0.0",
47
+ "tsup": "^8.5.1",
48
+ "typescript": "^6.0.3",
49
49
  "vite-plugin-node-polyfills": "^0.26.0",
50
50
  "vitest": "^1.0.0"
51
51
  },