@dyrected/core 2.10.1 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, 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 BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as ArrayField, K as BlocksField, M as BooleanField, N as AuthConfig, O as AccessPolicyResolver, Q as DateField, R as DateTimeField, S as EmailField, T as IconField, U as ImageField, V as JoinField, X as JsonField, Y as MultiSelectField, Z as NumberField, _ as ObjectField, $ as RadioField, a0 as RelationshipField, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TextField, a5 as TextareaField, a6 as TimeField, a7 as UrlField } from './app-config-BLC7WoyL.cjs';
2
- export { a8 as AccessConfig, a9 as AccessFunction, aa as AccessFunctionArgs, ab as AccessResult, ac as AccessRule, ad as ActionConfig, ae as ActionContext, af as ActionType, ag as AdminAuthAccessResolution, ah as AdminAuthClaimMapping, ai as AdminAuthMember, aj as AdminAuthProvider, ak as AdminAuthProviderMembersConfig, al as AdminAuthProvisioningMode, am as AdminAuthResolveAccessArgs, an as AdminAuthResolvedIdentity, ao as AdminConfig, ap as AdminDashboardComponentSlots, aq as AdminIconName, ar as AggregateArgs, as as AggregateCastType, at as AggregateInput, au as AggregateOperation, av as AggregateResult, aw as BaseAdminAuthProvider, ax as BaseFieldAdmin, ay as BlockVariant, az as BooleanFieldAdmin, aA as BooleanFormat, aB as CharacterLimitFieldAdmin, aC as CharacterLimitFieldConfig, aD as CollectionAfterChangeHook, aE as CollectionAfterDeleteHook, aF as CollectionAfterReadHook, aG as CollectionAfterReadHookEntry, aH as CollectionAfterTransitionHook, aI as CollectionBeforeChangeHook, aJ as CollectionBeforeChangeHookEntry, aK as CollectionBeforeDeleteHook, aL as CollectionBeforeReadHook, aM as CollectionBeforeReadHookEntry, aN as CollectionBeforeTransitionHook, aO as CollectionListComponentSlots, aP as CollectionViewComponentSlots, aQ as CountOperation, aR as CustomAdminAuthProvider, aS as DatabaseAdapter, aT as DateFieldAdmin, aU as DateFormat, aV as DefineActionOptions, aW as DefineViewOptions, aX as DetailSpan, aY as DisplayTone, aZ as DisplayVariant, a_ as DistinctCountOperation, a$ as DistinctValuesOperation, b0 as DynamicOptionItem, b1 as DynamicOptionsConfig, b2 as DynamicOptionsResolver, b3 as DynamicOptionsResolverArgs, b4 as DyrectedLoggerConfig, b5 as DyrectedObservabilityConfig, b6 as EmailFieldAdmin, b7 as FieldAdminHooks, b8 as FieldAdminOnChangeHook, b9 as FieldAdminOnChangeHookArgs, ba as FieldAdminOptionsHook, bb as FieldAdminOptionsHookArgs, bc as FieldAdminOptionsHookResult, bd as FieldAfterReadHook, be as FieldAfterReadHookArgs, bf as FieldBase, bg as FieldBeforeChangeHook, bh as FieldBeforeChangeHookArgs, bi as FieldHook, bj as FieldHooks, bk as FieldType, bl as FileData, bm as GlobalAfterChangeHook, bn as GlobalAfterReadHook, bo as GlobalAfterReadHookEntry, bp as GlobalBeforeChangeHook, bq as GlobalBeforeChangeHookEntry, br as GlobalBeforeReadHook, bs as GlobalBeforeReadHookEntry, bt as HeadingLevel, bu as HookFunction, bv as IconFieldAdmin, bw as ImageService, bx as InferAggregateResult, by as JoinFieldAdmin, bz as JsonFieldAdmin, bA as JsonFormat, bB as LIFECYCLE_EVENT_NAMES, bC as LifecycleEventHandler, bD as LinkFormat, bE as MetricColor, bF as MultiSelectFieldAdmin, bG as NamedAccessPolicy, bH as NumberFieldAdmin, bI as NumberFormat, bJ as NumberLimitFieldAdmin, bK as NumberLimitFieldConfig, bL as NumericOperation, bM as OIDCAdminAuthProvider, bN as OptionFormat, bO as PaginatedResult, bP as PublicAdminAuthProvider, bQ as RadioFieldAdmin, bR as RateLimitConfig, bS as ReadonlyDatabaseAdapter, bT as RichTextFeature, bU as RichTextFieldConfig, bV as SelectFieldAdmin, bW as SqlWhereResult, bX as StorageAdapter, bY as TextFieldAdmin, bZ as TextFormat, b_ as TextareaFieldAdmin, b$ as TrustProxyConfig, c0 as TypedField, c1 as UploadConfig, c2 as UrlFieldAdmin, c3 as UrlLinkValue, c4 as ViewActionFeatures, c5 as ViewComponentSlots, c6 as ViewConfig, c7 as ViewLayout, c8 as ViewMetric, c9 as ViewSubMetric, ca as WhereClause, cb as WhereOperator, cc as WhereOperatorName, cd as WordLimitFieldAdmin, ce as WordLimitFieldConfig, cf as WorkflowMetadata, cg as WorkflowRole, ch as WorkflowState, ci as WorkflowTransitionContext, cj as defineAction, ck as defineView, cl as parseMongoWhere, cm as parseSqlWhere } from './app-config-BLC7WoyL.cjs';
1
+ import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, 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 BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as ArrayField, K as BlocksField, M as BooleanField, N as AuthConfig, O as AccessPolicyResolver, Q as DateField, R as DateTimeField, S as EmailField, T as IconField, U as ImageField, V as JoinField, X as JsonField, Y as MultiSelectField, Z as NumberField, _ as ObjectField, $ as RadioField, a0 as RelationshipField, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TextField, a5 as TextareaField, a6 as TimeField, a7 as UrlField } from './app-config-C6hYM8WO.cjs';
2
+ export { a8 as AccessConfig, a9 as AccessFunction, aa as AccessFunctionArgs, ab as AccessResult, ac as AccessRule, ad as ActionConfig, ae as ActionContext, af as ActionType, ag as AdminAuthAccessResolution, ah as AdminAuthClaimMapping, ai as AdminAuthMember, aj as AdminAuthProvider, ak as AdminAuthProviderMembersConfig, al as AdminAuthProvisioningMode, am as AdminAuthResolveAccessArgs, an as AdminAuthResolvedIdentity, ao as AdminConfig, ap as AdminDashboardComponentSlots, aq as AdminIconName, ar as AggregateArgs, as as AggregateCastType, at as AggregateInput, au as AggregateOperation, av as AggregateResult, aw as BaseAdminAuthProvider, ax as BaseFieldAdmin, ay as BlockVariant, az as BooleanFieldAdmin, aA as BooleanFormat, aB as CharacterLimitFieldAdmin, aC as CharacterLimitFieldConfig, aD as CollectionAfterChangeHook, aE as CollectionAfterDeleteHook, aF as CollectionAfterReadHook, aG as CollectionAfterReadHookEntry, aH as CollectionAfterTransitionHook, aI as CollectionBeforeChangeHook, aJ as CollectionBeforeChangeHookEntry, aK as CollectionBeforeDeleteHook, aL as CollectionBeforeReadHook, aM as CollectionBeforeReadHookEntry, aN as CollectionBeforeTransitionHook, aO as CollectionListComponentSlots, aP as CollectionViewComponentSlots, aQ as CountOperation, aR as CustomAdminAuthProvider, aS as DatabaseAdapter, aT as DateFieldAdmin, aU as DateFormat, aV as DefineActionOptions, aW as DefineViewOptions, aX as DetailSpan, aY as DisplayTone, aZ as DisplayVariant, a_ as DistinctCountOperation, a$ as DistinctValuesOperation, b0 as DynamicOptionItem, b1 as DynamicOptionsConfig, b2 as DynamicOptionsResolver, b3 as DynamicOptionsResolverArgs, b4 as DyrectedLoggerConfig, b5 as DyrectedObservabilityConfig, b6 as EmailFieldAdmin, b7 as FieldAdminHooks, b8 as FieldAdminOnChangeHook, b9 as FieldAdminOnChangeHookArgs, ba as FieldAdminOptionsHook, bb as FieldAdminOptionsHookArgs, bc as FieldAdminOptionsHookResult, bd as FieldAfterReadHook, be as FieldAfterReadHookArgs, bf as FieldBase, bg as FieldBeforeChangeHook, bh as FieldBeforeChangeHookArgs, bi as FieldHook, bj as FieldHooks, bk as FieldType, bl as FileData, bm as GlobalAfterChangeHook, bn as GlobalAfterReadHook, bo as GlobalAfterReadHookEntry, bp as GlobalBeforeChangeHook, bq as GlobalBeforeChangeHookEntry, br as GlobalBeforeReadHook, bs as GlobalBeforeReadHookEntry, bt as HeadingLevel, bu as HookFunction, bv as IconFieldAdmin, bw as ImageService, bx as ImageTransformOptions, by as InferAggregateResult, bz as JoinFieldAdmin, bA as JsonFieldAdmin, bB as JsonFormat, bC as LIFECYCLE_EVENT_NAMES, bD as LifecycleEventHandler, bE as LinkFormat, bF as MetricColor, bG as MultiSelectFieldAdmin, bH as NamedAccessPolicy, bI as NumberFieldAdmin, bJ as NumberFormat, bK as NumberLimitFieldAdmin, bL as NumberLimitFieldConfig, bM as NumericOperation, bN as OIDCAdminAuthProvider, bO as OptionFormat, bP as PaginatedResult, bQ as PublicAdminAuthProvider, bR as RadioFieldAdmin, bS as RateLimitConfig, bT as ReadonlyDatabaseAdapter, bU as RichTextFeature, bV as RichTextFieldConfig, bW as SelectFieldAdmin, bX as SqlWhereResult, bY as StorageAdapter, bZ as TextFieldAdmin, b_ as TextFormat, b$ as TextareaFieldAdmin, c0 as TrustProxyConfig, c1 as TypedField, c2 as UploadConfig, c3 as UrlFieldAdmin, c4 as UrlLinkValue, c5 as ViewActionFeatures, c6 as ViewComponentSlots, c7 as ViewConfig, c8 as ViewLayout, c9 as ViewMetric, ca as ViewSubMetric, cb as WhereClause, cc as WhereOperator, cd as WhereOperatorName, ce as WordLimitFieldAdmin, cf as WordLimitFieldConfig, cg as WorkflowMetadata, ch as WorkflowRole, ci as WorkflowState, cj as WorkflowTransitionContext, ck as defineAction, cl as defineView, cm as parseMongoWhere, cn as parseSqlWhere } from './app-config-C6hYM8WO.cjs';
3
3
  import jexl from 'jexl';
4
4
  import 'lucide-react';
5
5
  import 'pino';
@@ -751,6 +751,10 @@ declare class FieldConditionBuilder {
751
751
  * Checks that the field is null, undefined, or an empty string.
752
752
  */
753
753
  isEmpty(): string;
754
+ /**
755
+ * Alias for `isEmpty()`.
756
+ */
757
+ empty(): string;
754
758
  /**
755
759
  * Numerical greater than (`field > num`).
756
760
  */
@@ -791,6 +795,22 @@ declare class FieldConditionBuilder {
791
795
  * Checks if array/string length is at least a threshold.
792
796
  */
793
797
  hasLengthAtLeast(length: number): string;
798
+ /**
799
+ * Generates a JEXL `slugify(field)` transform expression.
800
+ */
801
+ slugify(): string;
802
+ /**
803
+ * Generates a JEXL `lower(field)` transform expression.
804
+ */
805
+ lower(): string;
806
+ /**
807
+ * Generates a JEXL `upper(field)` transform expression.
808
+ */
809
+ upper(): string;
810
+ /**
811
+ * Generates a JEXL `trim(field)` transform expression.
812
+ */
813
+ trim(): string;
794
814
  }
795
815
  /**
796
816
  * Pre-built access control condition helpers.
@@ -830,22 +850,26 @@ interface AccessConditions {
830
850
  * Condition builder utilities for serializable JEXL expressions in `admin.condition`,
831
851
  * access control rules, computed fields, and dynamic `admin.previewUrl`.
832
852
  */
833
- interface WhenFunction {
853
+ /**
854
+ * Expression builder utilities for serializable JEXL expressions in `admin.condition`,
855
+ * access control rules, computed fields, transforms, and dynamic `admin.previewUrl`.
856
+ */
857
+ interface ExprFunction {
834
858
  /**
835
- * Starts a fluent condition builder for a specific field name.
859
+ * Starts a fluent condition/expression builder for a specific field name.
836
860
  *
837
861
  * @example
838
- * admin: { condition: when('price').greaterThan(100) }
839
- * admin: { condition: when('status').in('published', 'archived') }
840
- * admin: { previewUrl: when.then(when('slug').equals('home'), '/', "'/' + slug") }
862
+ * admin: { condition: expr('price').greaterThan(100) }
863
+ * admin: { condition: expr('status').in('published', 'archived') }
864
+ * admin: { previewUrl: expr.ifElse(expr('slug').equals('home'), '/', expr.concat('/', 'slug')) }
841
865
  */
842
866
  (fieldName: string): FieldConditionBuilder;
843
867
  /**
844
- * Starts a fluent condition builder on the `user` context (e.g. `when.user('email').endsWith('@company.com')`).
868
+ * Starts a fluent condition builder on the `user` context (e.g. `expr.user('email').endsWith('@company.com')`).
845
869
  */
846
870
  user: (userProp: string) => FieldConditionBuilder;
847
871
  /**
848
- * Starts a fluent condition builder on `siblingData` (e.g. `when.sibling('_variant').equals('split')`).
872
+ * Starts a fluent condition builder on `siblingData` (e.g. `expr.sibling('_variant').equals('split')`).
849
873
  */
850
874
  sibling: (siblingProp: string) => FieldConditionBuilder;
851
875
  /**
@@ -857,10 +881,10 @@ interface WhenFunction {
857
881
  * Automatically quotes literal segments (like paths) and preserves field identifiers.
858
882
  *
859
883
  * @example
860
- * when.concat('/country-portals/', 'slug')
884
+ * expr.concat('/country-portals/', 'slug')
861
885
  * // => "'/country-portals/' + slug"
862
886
  *
863
- * when.concat('/blog/', 'category', '/', 'slug')
887
+ * expr.concat('/blog/', 'category', '/', 'slug')
864
888
  * // => "'/blog/' + category + '/' + slug"
865
889
  */
866
890
  concat: (...parts: string[]) => string;
@@ -885,7 +909,11 @@ interface WhenFunction {
885
909
  * Can be nested to create ternary chains.
886
910
  *
887
911
  * @example
888
- * admin: { previewUrl: when.then(when.fieldEquals('slug', 'home'), '/', "'/' + slug") }
912
+ * admin: { previewUrl: expr.ifElse(expr.equals('slug', 'home'), '/', expr.concat('/', 'slug')) }
913
+ */
914
+ ifElse: (condition: string, ifTrue: string | number | boolean | null, ifFalse?: string | number | boolean | null) => string;
915
+ /**
916
+ * Alias for `ifElse`.
889
917
  */
890
918
  then: (condition: string, ifTrue: string | number | boolean | null, ifFalse?: string | number | boolean | null) => string;
891
919
  /**
@@ -893,10 +921,10 @@ interface WhenFunction {
893
921
  *
894
922
  * @example
895
923
  * admin: {
896
- * previewUrl: when.match()
897
- * .case(when('slug').equals('home'), '/')
898
- * .case(when.fieldNotEmpty('path'), 'path')
899
- * .case(when('category').equals('news'), "'/news/' + slug")
924
+ * previewUrl: expr.match()
925
+ * .case(expr('slug').equals('home'), '/')
926
+ * .case(expr.notEmpty('path'), 'path')
927
+ * .case(expr('category').equals('news'), "'/news/' + slug")
900
928
  * .otherwise("'/' + slug")
901
929
  * }
902
930
  */
@@ -906,9 +934,9 @@ interface WhenFunction {
906
934
  *
907
935
  * @example
908
936
  * admin: {
909
- * previewUrl: when.cases(
910
- * [when.fieldEquals('slug', 'home'), '/'],
911
- * [when.fieldNotEmpty('path'), 'path'],
937
+ * previewUrl: expr.cases(
938
+ * [expr.equals('slug', 'home'), '/'],
939
+ * [expr.notEmpty('path'), 'path'],
912
940
  * "'/' + slug"
913
941
  * )
914
942
  * }
@@ -919,7 +947,7 @@ interface WhenFunction {
919
947
  */
920
948
  all: (...conditions: (string | undefined | null | false)[]) => string;
921
949
  /**
922
- * Alias for `when.all(...)`.
950
+ * Alias for `expr.all(...)`.
923
951
  */
924
952
  and: (...conditions: (string | undefined | null | false)[]) => string;
925
953
  /**
@@ -927,7 +955,7 @@ interface WhenFunction {
927
955
  */
928
956
  any: (...conditions: (string | undefined | null | false)[]) => string;
929
957
  /**
930
- * Alias for `when.any(...)`.
958
+ * Alias for `expr.any(...)`.
931
959
  */
932
960
  or: (...conditions: (string | undefined | null | false)[]) => string;
933
961
  /**
@@ -938,8 +966,8 @@ interface WhenFunction {
938
966
  * Generates a condition matching one or multiple variant names.
939
967
  *
940
968
  * @example
941
- * admin: { condition: when.variant('split') }
942
- * admin: { condition: when.variant('imageLeft', 'imageRight') }
969
+ * admin: { condition: expr.variant('split') }
970
+ * admin: { condition: expr.variant('imageLeft', 'imageRight') }
943
971
  */
944
972
  variant: (...variants: (string | string[])[]) => string;
945
973
  /**
@@ -950,7 +978,7 @@ interface WhenFunction {
950
978
  * Generates a condition matching one or multiple block slugs.
951
979
  *
952
980
  * @example
953
- * admin: { condition: when.block('hero', 'cta') }
981
+ * admin: { condition: expr.block('hero', 'cta') }
954
982
  */
955
983
  block: (...blocks: (string | string[])[]) => string;
956
984
  /**
@@ -961,71 +989,90 @@ interface WhenFunction {
961
989
  * Generates a condition checking equality against a field value.
962
990
  *
963
991
  * @example
964
- * admin: { condition: when.fieldEquals('status', 'published') }
992
+ * admin: { condition: expr.equals('status', 'published') }
965
993
  */
966
- fieldEquals: (field: string, value: string | number | boolean | null) => string;
994
+ equals: (field: string, value: string | number | boolean | null) => string;
967
995
  /**
968
996
  * Generates a condition checking inequality against a field value.
969
997
  */
970
- fieldNotEquals: (field: string, value: string | number | boolean | null) => string;
998
+ notEquals: (field: string, value: string | number | boolean | null) => string;
971
999
  /**
972
1000
  * Generates a condition checking if a field is in a list of allowed values.
973
1001
  */
974
- fieldIn: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
1002
+ in: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
975
1003
  /**
976
1004
  * Generates a condition checking if a field is NOT in a list of values.
977
1005
  */
978
- fieldNotIn: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
1006
+ notIn: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
979
1007
  /**
980
1008
  * Generates a condition checking that a field is not null and not empty.
981
1009
  *
982
1010
  * @example
983
- * admin: { condition: when.fieldNotEmpty('couponCode') }
1011
+ * admin: { condition: expr.notEmpty('couponCode') }
984
1012
  */
985
- fieldNotEmpty: (field: string) => string;
1013
+ notEmpty: (field: string) => string;
986
1014
  /**
987
1015
  * Generates a condition checking that a field is null, undefined, or empty.
1016
+ *
1017
+ * @example
1018
+ * admin: { condition: expr.empty('couponCode') }
988
1019
  */
989
- fieldEmpty: (field: string) => string;
1020
+ empty: (field: string) => string;
990
1021
  /**
991
1022
  * Generates a condition checking that a boolean field is true.
992
1023
  */
993
- fieldIsTrue: (field: string) => string;
1024
+ isTrue: (field: string) => string;
994
1025
  /**
995
1026
  * Generates a condition checking that a boolean field is false / falsy.
996
1027
  */
997
- fieldIsFalse: (field: string) => string;
1028
+ isFalse: (field: string) => string;
998
1029
  /**
999
1030
  * Generates a numerical greater-than condition (`field > value`).
1000
1031
  */
1001
- fieldGreaterThan: (field: string, value: number | string) => string;
1032
+ greaterThan: (field: string, value: number | string) => string;
1002
1033
  /**
1003
1034
  * Generates a numerical greater-than-or-equal condition (`field >= value`).
1004
1035
  */
1005
- fieldGreaterThanOrEqual: (field: string, value: number | string) => string;
1036
+ greaterThanOrEqual: (field: string, value: number | string) => string;
1006
1037
  /**
1007
1038
  * Generates a numerical less-than condition (`field < value`).
1008
1039
  */
1009
- fieldLessThan: (field: string, value: number | string) => string;
1040
+ lessThan: (field: string, value: number | string) => string;
1010
1041
  /**
1011
1042
  * Generates a numerical less-than-or-equal condition (`field <= value`).
1012
1043
  */
1013
- fieldLessThanOrEqual: (field: string, value: number | string) => string;
1044
+ lessThanOrEqual: (field: string, value: number | string) => string;
1014
1045
  /**
1015
1046
  * Generates a range condition (`field >= min && field <= max`).
1016
1047
  */
1017
- fieldBetween: (field: string, min: number, max: number) => string;
1048
+ between: (field: string, min: number, max: number) => string;
1018
1049
  /**
1019
1050
  * Generates a string prefix condition using JEXL `startsWith(...)`.
1020
1051
  */
1021
- fieldStartsWith: (field: string, prefix: string) => string;
1052
+ startsWith: (field: string, prefix: string) => string;
1022
1053
  /**
1023
1054
  * Generates a string suffix condition using JEXL `endsWith(...)`.
1024
1055
  */
1025
- fieldEndsWith: (field: string, suffix: string) => string;
1056
+ endsWith: (field: string, suffix: string) => string;
1026
1057
  /**
1027
1058
  * Generates a string/array inclusion condition using JEXL `includes(...)`.
1028
1059
  */
1060
+ contains: (field: string, item: string | number) => string;
1061
+ fieldEquals: (field: string, value: string | number | boolean | null) => string;
1062
+ fieldNotEquals: (field: string, value: string | number | boolean | null) => string;
1063
+ fieldIn: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
1064
+ fieldNotIn: (field: string, ...values: (string | number | boolean | (string | number | boolean)[])[]) => string;
1065
+ fieldNotEmpty: (field: string) => string;
1066
+ fieldEmpty: (field: string) => string;
1067
+ fieldIsTrue: (field: string) => string;
1068
+ fieldIsFalse: (field: string) => string;
1069
+ fieldGreaterThan: (field: string, value: number | string) => string;
1070
+ fieldGreaterThanOrEqual: (field: string, value: number | string) => string;
1071
+ fieldLessThan: (field: string, value: number | string) => string;
1072
+ fieldLessThanOrEqual: (field: string, value: number | string) => string;
1073
+ fieldBetween: (field: string, min: number, max: number) => string;
1074
+ fieldStartsWith: (field: string, prefix: string) => string;
1075
+ fieldEndsWith: (field: string, suffix: string) => string;
1029
1076
  fieldContains: (field: string, item: string | number) => string;
1030
1077
  /**
1031
1078
  * Generates a condition checking that an array is non-empty (`length(field) > 0`).
@@ -1052,14 +1099,14 @@ interface WhenFunction {
1052
1099
  * Checks both `user.role` (string) and `user.roles` (array).
1053
1100
  *
1054
1101
  * @example
1055
- * admin: { condition: when.userRole('admin', 'developer') }
1102
+ * admin: { condition: expr.userRole('admin', 'developer') }
1056
1103
  */
1057
1104
  userRole: (...roles: (string | string[])[]) => string;
1058
1105
  /**
1059
1106
  * Generates a condition checking the editor's email domain.
1060
1107
  *
1061
1108
  * @example
1062
- * admin: { condition: when.userEmailDomain('agrictrail.com') }
1109
+ * admin: { condition: expr.userEmailDomain('agrictrail.com') }
1063
1110
  */
1064
1111
  userEmailDomain: (domain: string) => string;
1065
1112
  /**
@@ -1083,7 +1130,18 @@ interface WhenFunction {
1083
1130
  */
1084
1131
  statusIn: (...statuses: (string | string[])[]) => string;
1085
1132
  }
1086
- declare const when: WhenFunction;
1133
+ /**
1134
+ * Backwards compatibility type alias for `ExprFunction`.
1135
+ */
1136
+ type WhenFunction = ExprFunction;
1137
+ /**
1138
+ * Primary declarative expression builder for Dyrected schemas.
1139
+ */
1140
+ declare const expr: ExprFunction;
1141
+ /**
1142
+ * Backwards compatibility alias for `expr`.
1143
+ */
1144
+ declare const when: ExprFunction;
1087
1145
 
1088
1146
  type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
1089
1147
  name: string;
@@ -1504,4 +1562,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
1504
1562
  fields: T;
1505
1563
  }): T;
1506
1564
 
1507
- export { type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
1565
+ export { type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, type ExprFunction, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };