@stndrds/schema 0.1.0-alpha.57 → 0.1.0-alpha.58
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/{chunk-DPRLHGPO.js → chunk-2OS63USQ.js} +270 -916
- package/dist/{chunk-YVUSATKC.mjs → chunk-JRY236AO.mjs} +76 -722
- package/dist/chunk-NEVERCM3.js +41 -0
- package/dist/chunk-SV4BCGQU.mjs +617 -0
- package/dist/chunk-U4AB53AM.js +617 -0
- package/dist/chunk-V2RPPE2Y.mjs +41 -0
- package/dist/index.d.mts +51 -29
- package/dist/index.d.ts +51 -29
- package/dist/index.js +10 -100
- package/dist/index.mjs +76 -166
- package/dist/{runtime-BqJdmg_4.d.mts → runtime-C4vB_EcQ.d.ts} +5 -1645
- package/dist/{runtime-BqJdmg_4.d.ts → runtime-SCsDOQi0.d.mts} +5 -1645
- package/dist/runtime.d.mts +3 -1
- package/dist/runtime.d.ts +3 -1
- package/dist/runtime.js +4 -2
- package/dist/runtime.mjs +3 -1
- package/dist/utils.d.mts +154 -0
- package/dist/utils.d.ts +154 -0
- package/dist/utils.js +19 -0
- package/dist/utils.mjs +19 -0
- package/dist/validation/validators.d.mts +4 -0
- package/dist/validation/validators.d.ts +4 -0
- package/dist/validation/validators.js +121 -0
- package/dist/validation/validators.mjs +121 -0
- package/dist/validators-BgmWgr-G.d.mts +1488 -0
- package/dist/validators-miARInAq.d.ts +1488 -0
- package/package.json +12 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a0 as Timestamps, A as Attribute, o as AttributeType, I as Location, J as LocationGranularity, S as StatusAttribute, e as SelectAttribute, M as MultiselectAttribute, G as Phone, H as Currency, k as FormulaAttribute, m as RollupAttribute, a3 as CompletionStatus, a1 as SharingMode, a4 as ObjectRecord, p as ObjectDefinition, t as FeatureFlagsRepository, aT as ValidationResult, Q as RelationAttribute, l as FormulaReturnType } from './validators-miARInAq.js';
|
|
2
|
+
import { IconName, MimeType, ColorId, CountryIso3 } from '@stndrds/constants';
|
|
3
|
+
import { Uuid, TenantId, UserId } from './utils.js';
|
|
2
4
|
import { JWTPayload } from 'jose';
|
|
3
|
-
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* OCR Adapter Interface for extracting text from documents.
|
|
@@ -579,711 +580,6 @@ interface CreateAIMessageInput {
|
|
|
579
580
|
attachmentIds?: string[];
|
|
580
581
|
}
|
|
581
582
|
|
|
582
|
-
/**
|
|
583
|
-
* Brand symbol for nominal typing.
|
|
584
|
-
* This ensures type-safety by making IDs non-interchangeable.
|
|
585
|
-
*/
|
|
586
|
-
declare const __brand: unique symbol;
|
|
587
|
-
/**
|
|
588
|
-
* Creates a branded type from a base type.
|
|
589
|
-
* Branded types are structurally identical but nominally different.
|
|
590
|
-
*/
|
|
591
|
-
type Brand<T, B> = T & {
|
|
592
|
-
readonly [__brand]: B;
|
|
593
|
-
};
|
|
594
|
-
/**
|
|
595
|
-
* UUID string type for all identifiers
|
|
596
|
-
*/
|
|
597
|
-
type Uuid = string;
|
|
598
|
-
/**
|
|
599
|
-
* Tenant identifier for multi-tenant isolation.
|
|
600
|
-
* Branded type to prevent accidental mixing with other string IDs.
|
|
601
|
-
*
|
|
602
|
-
* @example
|
|
603
|
-
* ```typescript
|
|
604
|
-
* const tenantId: TenantId = asTenantId('tenant-123');
|
|
605
|
-
* const userId: UserId = asUserId('user-456');
|
|
606
|
-
*
|
|
607
|
-
* // Type error: cannot assign UserId to TenantId
|
|
608
|
-
* const wrong: TenantId = userId;
|
|
609
|
-
* ```
|
|
610
|
-
*/
|
|
611
|
-
type TenantId = Brand<string, "TenantId">;
|
|
612
|
-
/**
|
|
613
|
-
* User identifier for audit trails and permissions.
|
|
614
|
-
* Branded type to prevent accidental mixing with other string IDs.
|
|
615
|
-
*/
|
|
616
|
-
type UserId = Brand<string, "UserId">;
|
|
617
|
-
/**
|
|
618
|
-
* Convert a string to a TenantId.
|
|
619
|
-
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
620
|
-
*
|
|
621
|
-
* @param id - The string to convert
|
|
622
|
-
* @returns A branded TenantId
|
|
623
|
-
*
|
|
624
|
-
* @example
|
|
625
|
-
* ```typescript
|
|
626
|
-
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
627
|
-
* ```
|
|
628
|
-
*/
|
|
629
|
-
declare function asTenantId(id: string): TenantId;
|
|
630
|
-
/**
|
|
631
|
-
* Convert a string to a UserId.
|
|
632
|
-
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
633
|
-
*
|
|
634
|
-
* @param id - The string to convert
|
|
635
|
-
* @returns A branded UserId
|
|
636
|
-
*
|
|
637
|
-
* @example
|
|
638
|
-
* ```typescript
|
|
639
|
-
* const userId = asUserId(jwtPayload.sub);
|
|
640
|
-
* ```
|
|
641
|
-
*/
|
|
642
|
-
declare function asUserId(id: string): UserId;
|
|
643
|
-
/**
|
|
644
|
-
* Generate a unique UUID v4
|
|
645
|
-
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
646
|
-
* Falls back to a manual implementation for older environments
|
|
647
|
-
*
|
|
648
|
-
* @returns A UUID v4 string
|
|
649
|
-
*
|
|
650
|
-
* @example
|
|
651
|
-
* ```typescript
|
|
652
|
-
* const id = generateId();
|
|
653
|
-
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
654
|
-
* ```
|
|
655
|
-
*/
|
|
656
|
-
declare function generateId(): Uuid;
|
|
657
|
-
/**
|
|
658
|
-
* Generate a prefixed ID for better debugging and readability
|
|
659
|
-
*
|
|
660
|
-
* @param prefix - Prefix for the ID (e.g., "obj", "attr", "rec")
|
|
661
|
-
* @returns A prefixed UUID string
|
|
662
|
-
*
|
|
663
|
-
* @example
|
|
664
|
-
* ```typescript
|
|
665
|
-
* const objectId = generatePrefixedId("obj");
|
|
666
|
-
* // "obj_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
667
|
-
*
|
|
668
|
-
* const attrId = generatePrefixedId("attr");
|
|
669
|
-
* // "attr_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
670
|
-
* ```
|
|
671
|
-
*/
|
|
672
|
-
declare function generatePrefixedId(prefix: string): Uuid;
|
|
673
|
-
/**
|
|
674
|
-
* Convert a string to a valid kebab-case slug.
|
|
675
|
-
* Removes accents, special chars, and normalizes spaces.
|
|
676
|
-
*
|
|
677
|
-
* @param input - The string to slugify
|
|
678
|
-
* @returns A kebab-case slug matching pattern ^[a-z][a-z0-9-]*$
|
|
679
|
-
*
|
|
680
|
-
* @example
|
|
681
|
-
* ```typescript
|
|
682
|
-
* slugify("Contrat de Vente");
|
|
683
|
-
* // "contrat-de-vente"
|
|
684
|
-
*
|
|
685
|
-
* slugify("Éléphant café");
|
|
686
|
-
* // "elephant-cafe"
|
|
687
|
-
*
|
|
688
|
-
* slugify(" Multiple Spaces ");
|
|
689
|
-
* // "multiple-spaces"
|
|
690
|
-
* ```
|
|
691
|
-
*/
|
|
692
|
-
declare function slugify(input: string): string;
|
|
693
|
-
/**
|
|
694
|
-
* Generate a unique template name from a label.
|
|
695
|
-
* Format: {slugified-label}-{8-char-suffix}
|
|
696
|
-
* Matches DB constraint: ^[a-z][a-z0-9_-]*$
|
|
697
|
-
*
|
|
698
|
-
* @param label - The label to generate a name from
|
|
699
|
-
* @returns A unique kebab-case name
|
|
700
|
-
*
|
|
701
|
-
* @example
|
|
702
|
-
* ```typescript
|
|
703
|
-
* generateTemplateName("Contrat de Vente");
|
|
704
|
-
* // "contrat-de-vente-a1b2c3d4"
|
|
705
|
-
*
|
|
706
|
-
* generateTemplateName("");
|
|
707
|
-
* // "template-a1b2c3d4"
|
|
708
|
-
* ```
|
|
709
|
-
*/
|
|
710
|
-
declare function generateTemplateName(label: string): string;
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Feature flag levels (resolution priority: user > tenant > global).
|
|
714
|
-
*
|
|
715
|
-
* - `global`: Applies to all tenants and users
|
|
716
|
-
* - `tenant`: Applies to a specific tenant
|
|
717
|
-
* - `user`: Applies to a specific user within a tenant
|
|
718
|
-
*/
|
|
719
|
-
type FlagLevel = "global" | "tenant" | "user";
|
|
720
|
-
/**
|
|
721
|
-
* Flag value types supported by the system.
|
|
722
|
-
*/
|
|
723
|
-
type FlagValueType = "boolean" | "string" | "number" | "json";
|
|
724
|
-
/**
|
|
725
|
-
* Definition of a feature flag.
|
|
726
|
-
* Created using the flag builders (booleanFlag, stringFlag, etc.)
|
|
727
|
-
*/
|
|
728
|
-
interface FeatureFlagDefinition<T = unknown> {
|
|
729
|
-
/** Unique identifier for the flag (kebab-case) */
|
|
730
|
-
name: string;
|
|
731
|
-
/** Human-readable label */
|
|
732
|
-
label: string;
|
|
733
|
-
/** Optional description */
|
|
734
|
-
description?: string;
|
|
735
|
-
/** Type of the flag value */
|
|
736
|
-
valueType: FlagValueType;
|
|
737
|
-
/** Default value when no override exists */
|
|
738
|
-
defaultValue: T;
|
|
739
|
-
/** Levels at which this flag can be overridden */
|
|
740
|
-
allowedLevels: FlagLevel[];
|
|
741
|
-
/** Grouping category for UI */
|
|
742
|
-
category?: string;
|
|
743
|
-
/** System flag - cannot be modified via API */
|
|
744
|
-
system?: boolean;
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* Stored override for a feature flag.
|
|
748
|
-
* Represents a row in the feature_flag_overrides table.
|
|
749
|
-
*/
|
|
750
|
-
interface FlagOverride<T = unknown> {
|
|
751
|
-
/** Name of the flag being overridden */
|
|
752
|
-
flagName: string;
|
|
753
|
-
/** Level of the override */
|
|
754
|
-
level: FlagLevel;
|
|
755
|
-
/** Target ID (tenantId for tenant-level, userId for user-level) */
|
|
756
|
-
targetId?: string;
|
|
757
|
-
/** Override value */
|
|
758
|
-
value: T;
|
|
759
|
-
/** Optional expiration date */
|
|
760
|
-
expiresAt?: Date;
|
|
761
|
-
/** Who created this override */
|
|
762
|
-
createdBy?: string;
|
|
763
|
-
/** When the override was created */
|
|
764
|
-
createdAt: Date;
|
|
765
|
-
/** When the override was last updated */
|
|
766
|
-
updatedAt: Date;
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Resolved flag value with source information.
|
|
770
|
-
* Result of flag resolution including where the value came from.
|
|
771
|
-
*/
|
|
772
|
-
interface ResolvedFlag<T = unknown> {
|
|
773
|
-
/** Flag name */
|
|
774
|
-
name: string;
|
|
775
|
-
/** Resolved value */
|
|
776
|
-
value: T;
|
|
777
|
-
/** Where the value came from */
|
|
778
|
-
source: FlagLevel | "default";
|
|
779
|
-
/** ID of the source (tenantId or userId) if not default */
|
|
780
|
-
sourceId?: string;
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Feature gate configuration for conditional attribute visibility.
|
|
784
|
-
* Used with the `.featureGate()` builder method.
|
|
785
|
-
*/
|
|
786
|
-
interface FeatureGate {
|
|
787
|
-
/** Name of the flag to check */
|
|
788
|
-
flag: string;
|
|
789
|
-
/**
|
|
790
|
-
* Expected value for the gate to pass.
|
|
791
|
-
* For boolean flags, defaults to `true`.
|
|
792
|
-
* For other types, compares with strict equality.
|
|
793
|
-
*/
|
|
794
|
-
expectedValue?: unknown;
|
|
795
|
-
/**
|
|
796
|
-
* Behavior when the gate fails.
|
|
797
|
-
* - `hide`: Attribute is completely hidden (default)
|
|
798
|
-
* - `show`: Attribute is shown regardless (no gating)
|
|
799
|
-
* - `disable`: Attribute is visible but read-only
|
|
800
|
-
*/
|
|
801
|
-
fallback?: "hide" | "show" | "disable";
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Repository interface for feature flag overrides storage.
|
|
805
|
-
* Added to DatabaseAdapter as an optional repository.
|
|
806
|
-
*
|
|
807
|
-
* If not provided, only static defaults from module config are used.
|
|
808
|
-
*/
|
|
809
|
-
interface FeatureFlagsRepository {
|
|
810
|
-
/**
|
|
811
|
-
* Get all overrides matching the criteria.
|
|
812
|
-
* Returns overrides from the database (global, tenant, or user level).
|
|
813
|
-
*/
|
|
814
|
-
getOverrides(options: {
|
|
815
|
-
/** Filter by level */
|
|
816
|
-
level?: FlagLevel;
|
|
817
|
-
/** Filter by target ID (tenantId or userId) */
|
|
818
|
-
targetId?: string;
|
|
819
|
-
}): Promise<FlagOverride[]>;
|
|
820
|
-
/**
|
|
821
|
-
* Create or update an override.
|
|
822
|
-
* Uses upsert semantics based on (flagName, level, targetId).
|
|
823
|
-
*/
|
|
824
|
-
setOverride(override: Omit<FlagOverride, "createdAt" | "updatedAt">): Promise<FlagOverride>;
|
|
825
|
-
/**
|
|
826
|
-
* Delete an override.
|
|
827
|
-
*/
|
|
828
|
-
deleteOverride(flagName: string, level: FlagLevel, targetId?: string): Promise<void>;
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Static flag default value for module configuration.
|
|
832
|
-
*/
|
|
833
|
-
interface StaticFlagDefault {
|
|
834
|
-
/** Flag name */
|
|
835
|
-
name: string;
|
|
836
|
-
/** Default value */
|
|
837
|
-
value: unknown;
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* Feature flags configuration for SchemaModule.
|
|
841
|
-
*/
|
|
842
|
-
interface FeatureFlagsConfig {
|
|
843
|
-
/**
|
|
844
|
-
* Static default values for flags.
|
|
845
|
-
* These are always applied and used when no database override exists.
|
|
846
|
-
*
|
|
847
|
-
* @example
|
|
848
|
-
* ```typescript
|
|
849
|
-
* featureFlags: {
|
|
850
|
-
* defaults: [
|
|
851
|
-
* { name: "architect-mode", value: false },
|
|
852
|
-
* { name: "ai-chat", value: false },
|
|
853
|
-
* { name: "tier", value: "free" },
|
|
854
|
-
* ],
|
|
855
|
-
* }
|
|
856
|
-
* ```
|
|
857
|
-
*/
|
|
858
|
-
defaults?: StaticFlagDefault[];
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
type AttributeType = "text" | "textarea" | "richtext" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "location" | "select" | "multiselect" | "file" | "user" | "relation" | "rating" | "formula" | "rollup" | "document";
|
|
862
|
-
/**
|
|
863
|
-
* Status group categorization
|
|
864
|
-
*/
|
|
865
|
-
type StatusGroup = "idle" | "in_progress" | "finished";
|
|
866
|
-
/**
|
|
867
|
-
* Unified option type for select-like fields
|
|
868
|
-
*/
|
|
869
|
-
interface Option {
|
|
870
|
-
id: string;
|
|
871
|
-
label: string;
|
|
872
|
-
value: string;
|
|
873
|
-
color?: ColorId;
|
|
874
|
-
icon?: IconName;
|
|
875
|
-
description?: string;
|
|
876
|
-
group?: StatusGroup;
|
|
877
|
-
}
|
|
878
|
-
/**
|
|
879
|
-
* Attribute grouping for UI organization
|
|
880
|
-
*/
|
|
881
|
-
interface AttributeGroup {
|
|
882
|
-
id: string;
|
|
883
|
-
label: string;
|
|
884
|
-
description?: string;
|
|
885
|
-
attributeIds: string[];
|
|
886
|
-
collapsible?: boolean;
|
|
887
|
-
collapsed?: boolean;
|
|
888
|
-
order?: number;
|
|
889
|
-
}
|
|
890
|
-
interface BaseAttribute<DefaultValueType = unknown> {
|
|
891
|
-
id: Uuid;
|
|
892
|
-
name: string;
|
|
893
|
-
label: string;
|
|
894
|
-
type: AttributeType;
|
|
895
|
-
required: boolean;
|
|
896
|
-
disabled?: boolean;
|
|
897
|
-
placeholder?: string;
|
|
898
|
-
description?: string;
|
|
899
|
-
defaultValue?: DefaultValueType;
|
|
900
|
-
icon?: IconName;
|
|
901
|
-
order?: number;
|
|
902
|
-
hidden?: boolean;
|
|
903
|
-
archived?: boolean;
|
|
904
|
-
deprecated?: boolean;
|
|
905
|
-
system?: boolean;
|
|
906
|
-
/**
|
|
907
|
-
* Feature gate to conditionally show/hide/disable this attribute.
|
|
908
|
-
* When the flag condition is not met, the attribute behavior depends on `fallback`:
|
|
909
|
-
* - "hide" (default): Attribute is completely hidden
|
|
910
|
-
* - "disable": Attribute is visible but read-only
|
|
911
|
-
* - "show": No gating (useful for overriding parent settings)
|
|
912
|
-
*/
|
|
913
|
-
featureGate?: FeatureGate;
|
|
914
|
-
metadata?: Record<string, unknown>;
|
|
915
|
-
}
|
|
916
|
-
interface TextAttribute extends BaseAttribute<string> {
|
|
917
|
-
type: "text";
|
|
918
|
-
minLength?: number;
|
|
919
|
-
maxLength?: number;
|
|
920
|
-
pattern?: string;
|
|
921
|
-
}
|
|
922
|
-
type NumberUnit = "integer" | "decimal" | "percentage";
|
|
923
|
-
interface NumberAttribute extends BaseAttribute<number> {
|
|
924
|
-
type: "number";
|
|
925
|
-
min?: number;
|
|
926
|
-
max?: number;
|
|
927
|
-
unit?: NumberUnit;
|
|
928
|
-
decimals?: number;
|
|
929
|
-
}
|
|
930
|
-
interface CheckboxAttribute extends BaseAttribute<boolean> {
|
|
931
|
-
type: "checkbox";
|
|
932
|
-
}
|
|
933
|
-
type DateFormat = "short" | "long" | "full" | "relative";
|
|
934
|
-
type DateValue = string | "today";
|
|
935
|
-
interface DateAttribute extends BaseAttribute<string> {
|
|
936
|
-
type: "date";
|
|
937
|
-
dateFormat?: DateFormat;
|
|
938
|
-
minDate?: DateValue;
|
|
939
|
-
maxDate?: DateValue;
|
|
940
|
-
}
|
|
941
|
-
interface Phone {
|
|
942
|
-
countryCode: CountryIso3;
|
|
943
|
-
phoneNumber: string;
|
|
944
|
-
}
|
|
945
|
-
interface PhoneAttribute extends BaseAttribute<Phone> {
|
|
946
|
-
type: "phone";
|
|
947
|
-
defaultCountryCode?: CountryIso3;
|
|
948
|
-
}
|
|
949
|
-
interface Currency {
|
|
950
|
-
code: CurrencyCode;
|
|
951
|
-
value: number;
|
|
952
|
-
}
|
|
953
|
-
interface CurrencyAttribute extends BaseAttribute<Currency> {
|
|
954
|
-
type: "currency";
|
|
955
|
-
defaultCurrency?: CurrencyCode;
|
|
956
|
-
allowedCurrencies?: CurrencyCode[];
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* StatusAttribute - For workflow states with semantic grouping (idle/in_progress/finished)
|
|
960
|
-
* Use this for: Task status, Order status, Project phases, Process states
|
|
961
|
-
* Use SelectAttribute for: Categories, Types, simple choices without workflow
|
|
962
|
-
*/
|
|
963
|
-
interface StatusAttribute extends BaseAttribute<string> {
|
|
964
|
-
type: "status";
|
|
965
|
-
options: Option[];
|
|
966
|
-
}
|
|
967
|
-
interface Location {
|
|
968
|
-
address?: string;
|
|
969
|
-
address2?: string;
|
|
970
|
-
city?: string;
|
|
971
|
-
state?: string;
|
|
972
|
-
postalCode?: string;
|
|
973
|
-
country?: CountryIso3;
|
|
974
|
-
latitude?: number;
|
|
975
|
-
longitude?: number;
|
|
976
|
-
}
|
|
977
|
-
type LocationGranularity = "full" | "address" | "city" | "state" | "country" | "coordinates";
|
|
978
|
-
interface LocationAttribute extends BaseAttribute<Location> {
|
|
979
|
-
type: "location";
|
|
980
|
-
granularity: LocationGranularity;
|
|
981
|
-
enableAutocomplete?: boolean;
|
|
982
|
-
enableMap?: boolean;
|
|
983
|
-
defaultCountry?: CountryIso3;
|
|
984
|
-
allowedCountries?: CountryIso3[];
|
|
985
|
-
displayFormat?: "single_line" | "multi_line" | "compact";
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* SelectAttribute - For simple single-choice selection
|
|
989
|
-
* Use this for: Categories, Document types, Departments, Priorities
|
|
990
|
-
* Options can be grouped (e.g., countries by continent) but no workflow logic
|
|
991
|
-
*/
|
|
992
|
-
interface SelectAttribute extends BaseAttribute<string> {
|
|
993
|
-
type: "select";
|
|
994
|
-
options: Option[];
|
|
995
|
-
}
|
|
996
|
-
interface MultiselectAttribute extends BaseAttribute<string[]> {
|
|
997
|
-
type: "multiselect";
|
|
998
|
-
options: Option[];
|
|
999
|
-
}
|
|
1000
|
-
interface FileAttribute extends BaseAttribute<string> {
|
|
1001
|
-
type: "file";
|
|
1002
|
-
maxFiles?: number;
|
|
1003
|
-
maxSize?: number;
|
|
1004
|
-
allowedTypes?: MimeType[] | readonly MimeType[];
|
|
1005
|
-
multiple?: boolean;
|
|
1006
|
-
}
|
|
1007
|
-
interface UserAttribute extends BaseAttribute<string> {
|
|
1008
|
-
type: "user";
|
|
1009
|
-
allowedRoles?: string[];
|
|
1010
|
-
multiple?: boolean;
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Wildcard marker for universal relations (can link to any object)
|
|
1014
|
-
* Use with `.toAny()` builder method
|
|
1015
|
-
*/
|
|
1016
|
-
declare const RELATION_TARGET_ANY: "*";
|
|
1017
|
-
/**
|
|
1018
|
-
* Target object for a relation - defines which objects can be linked
|
|
1019
|
-
*/
|
|
1020
|
-
interface RelationTarget {
|
|
1021
|
-
/** Object name (e.g., "companies", "contacts") or "*" for any object */
|
|
1022
|
-
object: string;
|
|
1023
|
-
/**
|
|
1024
|
-
* Display template for the label using mustache-like syntax
|
|
1025
|
-
* @example "{name}" or "{firstName} {lastName} — {email}"
|
|
1026
|
-
*/
|
|
1027
|
-
displayTemplate?: string;
|
|
1028
|
-
/**
|
|
1029
|
-
* Optional filter to restrict available records
|
|
1030
|
-
* @example { status: "active" }
|
|
1031
|
-
*/
|
|
1032
|
-
filter?: Record<string, unknown>;
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* Base properties shared by both single and multi relation attributes
|
|
1036
|
-
*
|
|
1037
|
-
* Note: Deletion behavior is always "restrict" - if a record is referenced
|
|
1038
|
-
* by other records, it cannot be deleted until those references are removed.
|
|
1039
|
-
* This is enforced by RecordService.deleteRecord() which throws
|
|
1040
|
-
* RecordReferencedError when attempting to delete a referenced record.
|
|
1041
|
-
*/
|
|
1042
|
-
interface RelationAttributeBase extends Omit<BaseAttribute<unknown>, "defaultValue"> {
|
|
1043
|
-
type: "relation";
|
|
1044
|
-
/** Target objects that can be linked */
|
|
1045
|
-
targets: RelationTarget[];
|
|
1046
|
-
}
|
|
1047
|
-
/**
|
|
1048
|
-
* Single relation attribute (one-to-one or many-to-one)
|
|
1049
|
-
* Stores a single record ID or null
|
|
1050
|
-
*/
|
|
1051
|
-
interface SingleRelationAttribute extends RelationAttributeBase {
|
|
1052
|
-
cardinality: "one";
|
|
1053
|
-
defaultValue?: string | null;
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Multi relation attribute (one-to-many or many-to-many)
|
|
1057
|
-
* Stores an array of record IDs
|
|
1058
|
-
*/
|
|
1059
|
-
interface MultiRelationAttribute extends RelationAttributeBase {
|
|
1060
|
-
cardinality: "many";
|
|
1061
|
-
defaultValue?: string[];
|
|
1062
|
-
/** Minimum number of relations required */
|
|
1063
|
-
minItems?: number;
|
|
1064
|
-
/** Maximum number of relations allowed */
|
|
1065
|
-
maxItems?: number;
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* RelationAttribute links to other objects/records
|
|
1069
|
-
* Discriminated union by cardinality for type-safe value handling
|
|
1070
|
-
*
|
|
1071
|
-
* @example Single relation (many-to-one)
|
|
1072
|
-
* ```typescript
|
|
1073
|
-
* relation({ name: "company", label: "Company" })
|
|
1074
|
-
* .to("companies")
|
|
1075
|
-
* .required()
|
|
1076
|
-
* // → Value: "rec-uuid-123" | null
|
|
1077
|
-
* ```
|
|
1078
|
-
*
|
|
1079
|
-
* @example Multi relation (many-to-many)
|
|
1080
|
-
* ```typescript
|
|
1081
|
-
* relation({ name: "contacts", label: "Contacts" })
|
|
1082
|
-
* .to("contacts", { displayTemplate: "{firstName} {lastName}" })
|
|
1083
|
-
* .many()
|
|
1084
|
-
* .maxItems(5)
|
|
1085
|
-
* // → Value: ["rec-1", "rec-2", ...]
|
|
1086
|
-
* ```
|
|
1087
|
-
*
|
|
1088
|
-
* @example Polymorphic relation (multiple target objects)
|
|
1089
|
-
* ```typescript
|
|
1090
|
-
* relation({ name: "linked", label: "Linked Items" })
|
|
1091
|
-
* .to("companies")
|
|
1092
|
-
* .to("contacts")
|
|
1093
|
-
* .to("deals")
|
|
1094
|
-
* .many()
|
|
1095
|
-
* // → Can link to records from any of these objects
|
|
1096
|
-
* ```
|
|
1097
|
-
*/
|
|
1098
|
-
type RelationAttribute = SingleRelationAttribute | MultiRelationAttribute;
|
|
1099
|
-
/**
|
|
1100
|
-
* Check if a relation attribute is universal (can link to any object)
|
|
1101
|
-
* Universal relations have `targets: [{ object: "*" }]`
|
|
1102
|
-
*/
|
|
1103
|
-
declare function isUniversalRelation(attr: RelationAttribute): boolean;
|
|
1104
|
-
interface TextAreaAttribute extends BaseAttribute<string> {
|
|
1105
|
-
type: "textarea";
|
|
1106
|
-
}
|
|
1107
|
-
/**
|
|
1108
|
-
* Available features for richtext editor
|
|
1109
|
-
*/
|
|
1110
|
-
type RichtextFeature = "headings" | "bold" | "italic" | "lists" | "links" | "images" | "codeBlocks" | "tables";
|
|
1111
|
-
/**
|
|
1112
|
-
* RichtextAttribute - Rich text content using semantic markdown
|
|
1113
|
-
*
|
|
1114
|
-
* Stores content as semantic markdown string (with directives like :::callout).
|
|
1115
|
-
* Parsed at runtime to Tiptap JSON for editing.
|
|
1116
|
-
* Use this for: Notes, articles, descriptions, long-form content.
|
|
1117
|
-
*
|
|
1118
|
-
* @example
|
|
1119
|
-
* ```typescript
|
|
1120
|
-
* richtext({ name: "content", label: "Content" })
|
|
1121
|
-
* .features(["headings", "bold", "italic", "lists", "links"])
|
|
1122
|
-
* .required()
|
|
1123
|
-
* ```
|
|
1124
|
-
*/
|
|
1125
|
-
interface RichtextAttribute extends BaseAttribute<string> {
|
|
1126
|
-
type: "richtext";
|
|
1127
|
-
/** Enabled features. If undefined, all features are enabled. */
|
|
1128
|
-
features?: RichtextFeature[];
|
|
1129
|
-
}
|
|
1130
|
-
interface RatingAttribute extends BaseAttribute<number> {
|
|
1131
|
-
type: "rating";
|
|
1132
|
-
max?: number;
|
|
1133
|
-
iconType?: "star" | "heart" | "thumbs" | "number";
|
|
1134
|
-
}
|
|
1135
|
-
/**
|
|
1136
|
-
* Return type for formula expressions
|
|
1137
|
-
*/
|
|
1138
|
-
type FormulaReturnType = "text" | "number" | "boolean" | "date";
|
|
1139
|
-
/**
|
|
1140
|
-
* FormulaAttribute - Computed value based on other attributes
|
|
1141
|
-
*
|
|
1142
|
-
* Formulas are calculated at read-time and are always read-only.
|
|
1143
|
-
* Users cannot directly edit formula values.
|
|
1144
|
-
*
|
|
1145
|
-
* @example Simple calculation
|
|
1146
|
-
* ```typescript
|
|
1147
|
-
* formula({ name: "total", label: "Total" })
|
|
1148
|
-
* .expression("price * quantity")
|
|
1149
|
-
* .returns("number")
|
|
1150
|
-
* .decimals(2)
|
|
1151
|
-
* ```
|
|
1152
|
-
*
|
|
1153
|
-
* @example With functions
|
|
1154
|
-
* ```typescript
|
|
1155
|
-
* formula({ name: "fullName", label: "Full Name" })
|
|
1156
|
-
* .expression("CONCAT(firstName, ' ', lastName)")
|
|
1157
|
-
* .returns("text")
|
|
1158
|
-
* ```
|
|
1159
|
-
*/
|
|
1160
|
-
interface FormulaAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
|
|
1161
|
-
type: "formula";
|
|
1162
|
-
/** Expression to evaluate (e.g., "price * quantity") */
|
|
1163
|
-
expression: string;
|
|
1164
|
-
/** Expected return type for formatting */
|
|
1165
|
-
returnType: FormulaReturnType;
|
|
1166
|
-
/** Decimal places for number results */
|
|
1167
|
-
decimals?: number;
|
|
1168
|
-
/** Whether to allow relation references in the expression (e.g., "company.name") */
|
|
1169
|
-
allowRelations?: boolean;
|
|
1170
|
-
/** Formula is always not required (read-only) */
|
|
1171
|
-
required: false;
|
|
1172
|
-
}
|
|
1173
|
-
/**
|
|
1174
|
-
* Aggregation functions for rollup attributes
|
|
1175
|
-
*
|
|
1176
|
-
* Categories:
|
|
1177
|
-
* - Numeric (sum, avg): Only for number, currency, rating types
|
|
1178
|
-
* - Date (earliest, latest): Only for date type
|
|
1179
|
-
* - Count (count, countValues, countUniqueValues, countEmpty): Universal
|
|
1180
|
-
* - Percent (percentEmpty, percentNotEmpty): Universal
|
|
1181
|
-
* - Lookup (original): Returns all values as array, rendered as target type
|
|
1182
|
-
*/
|
|
1183
|
-
type RollupFunction = "sum" | "avg" | "earliest" | "latest" | "count" | "countValues" | "countUniqueValues" | "countEmpty" | "percentEmpty" | "percentNotEmpty" | "original";
|
|
1184
|
-
/**
|
|
1185
|
-
* RollupAttribute - Aggregates values from related records
|
|
1186
|
-
*
|
|
1187
|
-
* Rollups are calculated and stored (denormalized) for performance.
|
|
1188
|
-
* They are automatically recalculated when related records change.
|
|
1189
|
-
* Users cannot directly edit rollup values.
|
|
1190
|
-
*
|
|
1191
|
-
* @example Sum of related amounts
|
|
1192
|
-
* ```typescript
|
|
1193
|
-
* rollup({ name: "totalOrders", label: "Total Orders" })
|
|
1194
|
-
* .from("orders") // relation attribute name
|
|
1195
|
-
* .aggregate("amount") // target attribute to sum
|
|
1196
|
-
* .using("sum")
|
|
1197
|
-
* .decimals(2)
|
|
1198
|
-
* ```
|
|
1199
|
-
*
|
|
1200
|
-
* @example Count of related records
|
|
1201
|
-
* ```typescript
|
|
1202
|
-
* rollup({ name: "orderCount", label: "Number of Orders" })
|
|
1203
|
-
* .from("orders")
|
|
1204
|
-
* .using("count")
|
|
1205
|
-
* ```
|
|
1206
|
-
*/
|
|
1207
|
-
interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
|
|
1208
|
-
type: "rollup";
|
|
1209
|
-
/** Name of the relation attribute on this object */
|
|
1210
|
-
relationAttribute: string;
|
|
1211
|
-
/**
|
|
1212
|
-
* Dot notation path for multi-level traversal (Phase 4+)
|
|
1213
|
-
* @example "orders.items" - traverse through orders to items
|
|
1214
|
-
*/
|
|
1215
|
-
relationPath?: string;
|
|
1216
|
-
/** Attribute name on the target object to aggregate */
|
|
1217
|
-
targetAttribute: string;
|
|
1218
|
-
/** Aggregation function to apply */
|
|
1219
|
-
function: RollupFunction;
|
|
1220
|
-
/** Decimal places for numeric results */
|
|
1221
|
-
decimals?: number;
|
|
1222
|
-
/** Rollup is always not required (read-only) */
|
|
1223
|
-
required: false;
|
|
1224
|
-
/**
|
|
1225
|
-
* Cached type of the target attribute for display purposes
|
|
1226
|
-
* Used when function="original" to render values as the target type
|
|
1227
|
-
*/
|
|
1228
|
-
targetAttributeType?: AttributeType;
|
|
1229
|
-
/**
|
|
1230
|
-
* Cached options from target attribute (for select/status/multiselect display)
|
|
1231
|
-
* Required when function="original" and target is a select-like type
|
|
1232
|
-
*/
|
|
1233
|
-
targetAttributeOptions?: Option[];
|
|
1234
|
-
}
|
|
1235
|
-
/**
|
|
1236
|
-
* DocumentAttribute - References one or multiple documents with templates.
|
|
1237
|
-
*
|
|
1238
|
-
* Unlike FileAttribute which stores raw file references, DocumentAttribute
|
|
1239
|
-
* provides structured document handling with templates, multi-file support,
|
|
1240
|
-
* and automatic processing (OCR, signature, identity verification).
|
|
1241
|
-
*
|
|
1242
|
-
* @example Single document with template choice
|
|
1243
|
-
* ```typescript
|
|
1244
|
-
* document({ name: "identityDocument", label: "Pièce d'identité" })
|
|
1245
|
-
* .templates(["french_id_card", "passport"])
|
|
1246
|
-
* .autoProcess()
|
|
1247
|
-
* .required()
|
|
1248
|
-
* ```
|
|
1249
|
-
*
|
|
1250
|
-
* @example Multiple documents with fixed template
|
|
1251
|
-
* ```typescript
|
|
1252
|
-
* document({ name: "contracts", label: "Contrats" })
|
|
1253
|
-
* .template("signable_contract")
|
|
1254
|
-
* .multiple()
|
|
1255
|
-
* .maxDocuments(10)
|
|
1256
|
-
* ```
|
|
1257
|
-
*/
|
|
1258
|
-
interface DocumentAttribute extends BaseAttribute<string | string[]> {
|
|
1259
|
-
type: "document";
|
|
1260
|
-
/**
|
|
1261
|
-
* Single template ID (strict mode).
|
|
1262
|
-
* If set, only documents using this template can be attached.
|
|
1263
|
-
*/
|
|
1264
|
-
templateId?: string;
|
|
1265
|
-
/**
|
|
1266
|
-
* Multiple allowed template IDs.
|
|
1267
|
-
* User can choose which template to use when uploading.
|
|
1268
|
-
*/
|
|
1269
|
-
allowedTemplates?: string[];
|
|
1270
|
-
/**
|
|
1271
|
-
* Allow multiple documents.
|
|
1272
|
-
* If true, value is string[] (document IDs).
|
|
1273
|
-
* If false/undefined, value is string (single document ID).
|
|
1274
|
-
*/
|
|
1275
|
-
multiple?: boolean;
|
|
1276
|
-
/**
|
|
1277
|
-
* Maximum number of documents when multiple: true.
|
|
1278
|
-
*/
|
|
1279
|
-
maxDocuments?: number;
|
|
1280
|
-
/**
|
|
1281
|
-
* Automatically trigger processing (OCR, verification) on upload.
|
|
1282
|
-
*/
|
|
1283
|
-
autoProcess?: boolean;
|
|
1284
|
-
}
|
|
1285
|
-
type Attribute = TextAttribute | TextAreaAttribute | RichtextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | LocationAttribute | SelectAttribute | MultiselectAttribute | FileAttribute | UserAttribute | RelationAttribute | RatingAttribute | FormulaAttribute | RollupAttribute | DocumentAttribute;
|
|
1286
|
-
|
|
1287
583
|
/**
|
|
1288
584
|
* Type of resource that can be audited
|
|
1289
585
|
*/
|
|
@@ -1543,186 +839,6 @@ interface PendingDocumentRequest {
|
|
|
1543
839
|
/** File size in bytes (when completed) */
|
|
1544
840
|
size?: number;
|
|
1545
841
|
}
|
|
1546
|
-
/**
|
|
1547
|
-
* Check if a template source is PDF type
|
|
1548
|
-
*/
|
|
1549
|
-
declare function isPdfTemplateSource(source: TemplateSource): source is Extract<TemplateSource, {
|
|
1550
|
-
type: "pdf";
|
|
1551
|
-
}>;
|
|
1552
|
-
/**
|
|
1553
|
-
* Check if a template source is DOCX type
|
|
1554
|
-
*/
|
|
1555
|
-
declare function isDocxTemplateSource(source: TemplateSource): source is Extract<TemplateSource, {
|
|
1556
|
-
type: "docx";
|
|
1557
|
-
}>;
|
|
1558
|
-
|
|
1559
|
-
/**
|
|
1560
|
-
* Timestamps for tracking creation and updates
|
|
1561
|
-
*/
|
|
1562
|
-
interface Timestamps {
|
|
1563
|
-
createdAt: Date;
|
|
1564
|
-
updatedAt: Date;
|
|
1565
|
-
}
|
|
1566
|
-
/**
|
|
1567
|
-
* Sharing mode for multi-tenant object access.
|
|
1568
|
-
*
|
|
1569
|
-
* - `private`: Object is only visible to its owner tenant (default)
|
|
1570
|
-
* - `shared`: Object is readable by all tenants, but only writable by the owner tenant
|
|
1571
|
-
*
|
|
1572
|
-
* Records inherit the sharing mode of their parent object.
|
|
1573
|
-
*/
|
|
1574
|
-
type SharingMode = "private" | "shared";
|
|
1575
|
-
/**
|
|
1576
|
-
* Object definition - Represents a database table/entity
|
|
1577
|
-
*/
|
|
1578
|
-
interface ObjectDefinition {
|
|
1579
|
-
id?: Uuid;
|
|
1580
|
-
name: string;
|
|
1581
|
-
label: string;
|
|
1582
|
-
pluralLabel?: string;
|
|
1583
|
-
description?: string;
|
|
1584
|
-
icon?: IconName;
|
|
1585
|
-
/**
|
|
1586
|
-
* Template expression used to compute the object's display label.
|
|
1587
|
-
* Supports variable interpolation and pipes for formatting.
|
|
1588
|
-
*
|
|
1589
|
-
* @example
|
|
1590
|
-
* ```typescript
|
|
1591
|
-
* // Simple attribute reference
|
|
1592
|
-
* labelExpression: "{{ name }}"
|
|
1593
|
-
*
|
|
1594
|
-
* // Multiple attributes
|
|
1595
|
-
* labelExpression: "{{ firstName }} {{ lastName }}"
|
|
1596
|
-
*
|
|
1597
|
-
* // With pipes for formatting
|
|
1598
|
-
* labelExpression: "{{ code | UPPER }} - {{ name | capitalize }}"
|
|
1599
|
-
* ```
|
|
1600
|
-
*
|
|
1601
|
-
* Available pipes: UPPER, LOWER, capitalize, trim
|
|
1602
|
-
*/
|
|
1603
|
-
labelExpression: string;
|
|
1604
|
-
attributes: Attribute[];
|
|
1605
|
-
system?: boolean;
|
|
1606
|
-
/**
|
|
1607
|
-
* Sharing mode for multi-tenant access.
|
|
1608
|
-
* - `private`: Only visible to the owner tenant (default)
|
|
1609
|
-
* - `shared`: Readable by all tenants, writable only by the owner
|
|
1610
|
-
*
|
|
1611
|
-
* Records inherit the sharing mode of their parent object.
|
|
1612
|
-
* @default "private"
|
|
1613
|
-
*/
|
|
1614
|
-
sharingMode?: SharingMode;
|
|
1615
|
-
metadata?: Record<string, unknown>;
|
|
1616
|
-
}
|
|
1617
|
-
/**
|
|
1618
|
-
* Links an attribute to an object
|
|
1619
|
-
*/
|
|
1620
|
-
interface ObjectAttribute {
|
|
1621
|
-
objectId: Uuid;
|
|
1622
|
-
attributeId: Uuid;
|
|
1623
|
-
order?: number;
|
|
1624
|
-
required?: boolean;
|
|
1625
|
-
}
|
|
1626
|
-
/**
|
|
1627
|
-
* Completion status of a record based on data completeness.
|
|
1628
|
-
*
|
|
1629
|
-
* - `draft`: Record is missing one or more required attribute values.
|
|
1630
|
-
* Can be saved but is considered incomplete.
|
|
1631
|
-
* - `complete`: All required attribute values are present and valid.
|
|
1632
|
-
* Record is ready for use.
|
|
1633
|
-
*
|
|
1634
|
-
* This is different from workflow status (e.g., "pending", "approved").
|
|
1635
|
-
* Completion status is computed dynamically based on the object schema.
|
|
1636
|
-
*/
|
|
1637
|
-
type CompletionStatus = "draft" | "complete";
|
|
1638
|
-
/**
|
|
1639
|
-
* Record - Instance of an Object (a row in the database)
|
|
1640
|
-
*/
|
|
1641
|
-
interface ObjectRecord extends Timestamps {
|
|
1642
|
-
id: Uuid;
|
|
1643
|
-
objectId: Uuid;
|
|
1644
|
-
/**
|
|
1645
|
-
* Display label computed from the object's labelExpression.
|
|
1646
|
-
* Computed dynamically based on record values.
|
|
1647
|
-
*
|
|
1648
|
-
* @example "John Doe" (from "{{ firstName }} {{ lastName }}")
|
|
1649
|
-
*/
|
|
1650
|
-
label: string;
|
|
1651
|
-
/**
|
|
1652
|
-
* Completion status of the record.
|
|
1653
|
-
* - `draft`: Missing required values, record is incomplete
|
|
1654
|
-
* - `complete`: All required values present and valid
|
|
1655
|
-
*
|
|
1656
|
-
* Computed dynamically based on the object's schema.
|
|
1657
|
-
*/
|
|
1658
|
-
completionStatus: CompletionStatus;
|
|
1659
|
-
values: Record<string, unknown>;
|
|
1660
|
-
/**
|
|
1661
|
-
* Custom metadata for the record.
|
|
1662
|
-
* Use this for UI/UX state, feature flags, or any application-specific data.
|
|
1663
|
-
* Unlike system fields (id, createdAt, updatedAt), metadata can be updated.
|
|
1664
|
-
*/
|
|
1665
|
-
metadata?: Record<string, unknown>;
|
|
1666
|
-
/**
|
|
1667
|
-
* Soft delete timestamp.
|
|
1668
|
-
* If set, the record is considered deleted but can be restored.
|
|
1669
|
-
* Queries exclude soft-deleted records by default.
|
|
1670
|
-
*/
|
|
1671
|
-
deletedAt?: Date | null;
|
|
1672
|
-
/**
|
|
1673
|
-
* User ID who created this record.
|
|
1674
|
-
* Automatically set by RecordService when userId is configured.
|
|
1675
|
-
* Optional for backward compatibility with existing records.
|
|
1676
|
-
*/
|
|
1677
|
-
createdBy?: string;
|
|
1678
|
-
/**
|
|
1679
|
-
* User ID who last updated this record.
|
|
1680
|
-
* Automatically set by RecordService when userId is configured.
|
|
1681
|
-
* Optional for backward compatibility with existing records.
|
|
1682
|
-
*/
|
|
1683
|
-
lastUpdatedBy?: string;
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* System-managed field names on ObjectRecord.
|
|
1687
|
-
* These are stored as SQL columns (not in JSONB `values`).
|
|
1688
|
-
*
|
|
1689
|
-
* Use this in adapters to determine if a filter/sort attribute is a table column
|
|
1690
|
-
* vs. a JSONB value field.
|
|
1691
|
-
*
|
|
1692
|
-
* @example
|
|
1693
|
-
* ```typescript
|
|
1694
|
-
* if (SYSTEM_FIELD_NAMES.includes(filter.attribute)) {
|
|
1695
|
-
* // Filter on SQL column (e.g., WHERE created_at > ...)
|
|
1696
|
-
* } else {
|
|
1697
|
-
* // Filter on JSONB field (e.g., WHERE values->>'name' = ...)
|
|
1698
|
-
* }
|
|
1699
|
-
* ```
|
|
1700
|
-
*/
|
|
1701
|
-
declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy"];
|
|
1702
|
-
/**
|
|
1703
|
-
* Type for system field names
|
|
1704
|
-
*/
|
|
1705
|
-
type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
1706
|
-
/**
|
|
1707
|
-
* Reserved attribute names that cannot be used for custom attributes.
|
|
1708
|
-
* These names conflict with ObjectRecord properties.
|
|
1709
|
-
*
|
|
1710
|
-
* Includes:
|
|
1711
|
-
* - System fields (id, createdAt, updatedAt, createdBy, lastUpdatedBy)
|
|
1712
|
-
* - Other ObjectRecord properties (objectId, label, completionStatus, values, metadata, deletedAt)
|
|
1713
|
-
*
|
|
1714
|
-
* @example
|
|
1715
|
-
* ```typescript
|
|
1716
|
-
* if (RESERVED_ATTRIBUTE_NAMES.includes(attributeName)) {
|
|
1717
|
-
* throw new Error(`"${attributeName}" is a reserved name`);
|
|
1718
|
-
* }
|
|
1719
|
-
* ```
|
|
1720
|
-
*/
|
|
1721
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt"];
|
|
1722
|
-
/**
|
|
1723
|
-
* Type for reserved attribute names
|
|
1724
|
-
*/
|
|
1725
|
-
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
1726
842
|
|
|
1727
843
|
/**
|
|
1728
844
|
* DocumentTemplate defines the structure and processing rules for a document type.
|
|
@@ -2234,19 +1350,6 @@ interface AdvancedFilterState {
|
|
|
2234
1350
|
/** List of filter groups */
|
|
2235
1351
|
groups: FilterGroup[];
|
|
2236
1352
|
}
|
|
2237
|
-
/**
|
|
2238
|
-
* Type guard to check if a filter state is advanced
|
|
2239
|
-
*/
|
|
2240
|
-
declare function isAdvancedFilterState(state: FilterState | AdvancedFilterState): state is AdvancedFilterState;
|
|
2241
|
-
/**
|
|
2242
|
-
* Convert simple filter state to advanced filter state
|
|
2243
|
-
*/
|
|
2244
|
-
declare function toAdvancedFilterState(state: FilterState): AdvancedFilterState;
|
|
2245
|
-
/**
|
|
2246
|
-
* Convert advanced filter state to simple filter state (flattens groups)
|
|
2247
|
-
* Note: This loses group structure - use with caution
|
|
2248
|
-
*/
|
|
2249
|
-
declare function toSimpleFilterState(state: AdvancedFilterState): FilterState;
|
|
2250
1353
|
/** Sort direction */
|
|
2251
1354
|
type SortDirection = "asc" | "desc";
|
|
2252
1355
|
/** A single sort rule */
|
|
@@ -3205,10 +2308,6 @@ declare function getContextValue(context: WorkflowExecutionContext, path: string
|
|
|
3205
2308
|
* ```
|
|
3206
2309
|
*/
|
|
3207
2310
|
declare function setContextValue(context: WorkflowExecutionContext, path: string, value: unknown): void;
|
|
3208
|
-
/**
|
|
3209
|
-
* Merge form data into slot record
|
|
3210
|
-
*/
|
|
3211
|
-
declare function mergeFormToSlot(context: WorkflowExecutionContext, nodeId: string, slotId: string): void;
|
|
3212
2311
|
|
|
3213
2312
|
/**
|
|
3214
2313
|
* All supported comparison operators for condition rules
|
|
@@ -3305,14 +2404,6 @@ declare function or(...rules: Array<ConditionRule | ConditionGroup>): ConditionG
|
|
|
3305
2404
|
* Create an "in" condition (value in array)
|
|
3306
2405
|
*/
|
|
3307
2406
|
declare function inValues(field: string, values: unknown[]): ConditionRule;
|
|
3308
|
-
/**
|
|
3309
|
-
* Create an isEmpty condition
|
|
3310
|
-
*/
|
|
3311
|
-
declare function isEmpty(field: string): ConditionRule;
|
|
3312
|
-
/**
|
|
3313
|
-
* Create an isNotEmpty condition
|
|
3314
|
-
*/
|
|
3315
|
-
declare function isNotEmpty(field: string): ConditionRule;
|
|
3316
2407
|
|
|
3317
2408
|
/**
|
|
3318
2409
|
* Base properties shared by all workflow nodes
|
|
@@ -5563,737 +4654,6 @@ declare class ViewRegistry {
|
|
|
5563
4654
|
*/
|
|
5564
4655
|
declare const viewRegistry: ViewRegistry;
|
|
5565
4656
|
|
|
5566
|
-
/**
|
|
5567
|
-
* Validation messages for Zod validators.
|
|
5568
|
-
* All functions receive the full Attribute to access label, type, etc.
|
|
5569
|
-
* Can be customized for i18n support.
|
|
5570
|
-
*/
|
|
5571
|
-
interface ValidationMessages {
|
|
5572
|
-
required: (attr: Attribute) => string;
|
|
5573
|
-
invalidType: (attr: Attribute, expected: string) => string;
|
|
5574
|
-
minLength: (attr: Attribute, min: number) => string;
|
|
5575
|
-
maxLength: (attr: Attribute, max: number) => string;
|
|
5576
|
-
invalidPattern: (attr: Attribute) => string;
|
|
5577
|
-
minValue: (attr: Attribute, min: number) => string;
|
|
5578
|
-
maxValue: (attr: Attribute, max: number) => string;
|
|
5579
|
-
mustBeInteger: (attr: Attribute) => string;
|
|
5580
|
-
invalidDate: (attr: Attribute) => string;
|
|
5581
|
-
invalidOption: (attr: Attribute, options: string[]) => string;
|
|
5582
|
-
invalidId: (attr: Attribute) => string;
|
|
5583
|
-
minItems: (attr: Attribute, min: number) => string;
|
|
5584
|
-
maxItems: (attr: Attribute, max: number) => string;
|
|
5585
|
-
invalidRichtext: (attr: Attribute) => string;
|
|
5586
|
-
invalidPhone: (attr: Attribute) => string;
|
|
5587
|
-
invalidCurrency: (attr: Attribute) => string;
|
|
5588
|
-
invalidLocation: (attr: Attribute) => string;
|
|
5589
|
-
}
|
|
5590
|
-
declare const DEFAULT_VALIDATION_MESSAGES: ValidationMessages;
|
|
5591
|
-
/**
|
|
5592
|
-
* Text attribute config schema
|
|
5593
|
-
*/
|
|
5594
|
-
declare const textConfigSchema: z.ZodObject<{
|
|
5595
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5596
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5597
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5598
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5599
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5600
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5601
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5602
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5603
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5604
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5605
|
-
minLength: z.ZodOptional<z.ZodNumber>;
|
|
5606
|
-
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
5607
|
-
pattern: z.ZodOptional<z.ZodString>;
|
|
5608
|
-
}, z.core.$strip>;
|
|
5609
|
-
/**
|
|
5610
|
-
* Textarea attribute config schema
|
|
5611
|
-
*/
|
|
5612
|
-
declare const textareaConfigSchema: z.ZodObject<{
|
|
5613
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5614
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5615
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5616
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5617
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5618
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5619
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5620
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5621
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5622
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5623
|
-
}, z.core.$strip>;
|
|
5624
|
-
/**
|
|
5625
|
-
* Richtext attribute config schema
|
|
5626
|
-
*/
|
|
5627
|
-
declare const richtextConfigSchema: z.ZodObject<{
|
|
5628
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5629
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5630
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5631
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5632
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5633
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5634
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5635
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5636
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5637
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5638
|
-
features: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
5639
|
-
headings: "headings";
|
|
5640
|
-
bold: "bold";
|
|
5641
|
-
italic: "italic";
|
|
5642
|
-
lists: "lists";
|
|
5643
|
-
links: "links";
|
|
5644
|
-
images: "images";
|
|
5645
|
-
codeBlocks: "codeBlocks";
|
|
5646
|
-
tables: "tables";
|
|
5647
|
-
}>>>;
|
|
5648
|
-
}, z.core.$strip>;
|
|
5649
|
-
/**
|
|
5650
|
-
* Number attribute config schema
|
|
5651
|
-
*/
|
|
5652
|
-
declare const numberConfigSchema: z.ZodObject<{
|
|
5653
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5654
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5655
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5656
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5657
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5658
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5659
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5660
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5661
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5662
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5663
|
-
min: z.ZodOptional<z.ZodNumber>;
|
|
5664
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
5665
|
-
unit: z.ZodOptional<z.ZodEnum<{
|
|
5666
|
-
percentage: "percentage";
|
|
5667
|
-
integer: "integer";
|
|
5668
|
-
decimal: "decimal";
|
|
5669
|
-
}>>;
|
|
5670
|
-
decimals: z.ZodOptional<z.ZodNumber>;
|
|
5671
|
-
}, z.core.$strip>;
|
|
5672
|
-
/**
|
|
5673
|
-
* Checkbox attribute config schema
|
|
5674
|
-
*/
|
|
5675
|
-
declare const checkboxConfigSchema: z.ZodObject<{
|
|
5676
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5677
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5678
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5679
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5680
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5681
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5682
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5683
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5684
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5685
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5686
|
-
}, z.core.$strip>;
|
|
5687
|
-
/**
|
|
5688
|
-
* Date attribute config schema
|
|
5689
|
-
*/
|
|
5690
|
-
declare const dateConfigSchema: z.ZodObject<{
|
|
5691
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5692
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5693
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5694
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5695
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5696
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5697
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5698
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5699
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5700
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5701
|
-
dateFormat: z.ZodOptional<z.ZodEnum<{
|
|
5702
|
-
short: "short";
|
|
5703
|
-
long: "long";
|
|
5704
|
-
full: "full";
|
|
5705
|
-
relative: "relative";
|
|
5706
|
-
}>>;
|
|
5707
|
-
minDate: z.ZodOptional<z.ZodString>;
|
|
5708
|
-
maxDate: z.ZodOptional<z.ZodString>;
|
|
5709
|
-
}, z.core.$strip>;
|
|
5710
|
-
/**
|
|
5711
|
-
* Phone attribute config schema
|
|
5712
|
-
*/
|
|
5713
|
-
declare const phoneConfigSchema: z.ZodObject<{
|
|
5714
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5715
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5716
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5717
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5718
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5719
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5720
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5721
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5722
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5723
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5724
|
-
defaultCountryCode: z.ZodOptional<z.ZodString>;
|
|
5725
|
-
}, z.core.$strip>;
|
|
5726
|
-
/**
|
|
5727
|
-
* Currency attribute config schema
|
|
5728
|
-
*/
|
|
5729
|
-
declare const currencyConfigSchema: z.ZodObject<{
|
|
5730
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5731
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5732
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5733
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5734
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5735
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5736
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5737
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5738
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5739
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5740
|
-
defaultCurrency: z.ZodOptional<z.ZodString>;
|
|
5741
|
-
allowedCurrencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5742
|
-
}, z.core.$strip>;
|
|
5743
|
-
/**
|
|
5744
|
-
* Status attribute config schema
|
|
5745
|
-
*/
|
|
5746
|
-
declare const statusConfigSchema: z.ZodObject<{
|
|
5747
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5748
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5749
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5750
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5751
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5752
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5753
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5754
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5755
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5756
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5757
|
-
options: z.ZodArray<z.ZodObject<{
|
|
5758
|
-
id: z.ZodString;
|
|
5759
|
-
label: z.ZodString;
|
|
5760
|
-
value: z.ZodString;
|
|
5761
|
-
color: z.ZodOptional<z.ZodString>;
|
|
5762
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5763
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5764
|
-
group: z.ZodOptional<z.ZodEnum<{
|
|
5765
|
-
in_progress: "in_progress";
|
|
5766
|
-
idle: "idle";
|
|
5767
|
-
finished: "finished";
|
|
5768
|
-
}>>;
|
|
5769
|
-
}, z.core.$strip>>;
|
|
5770
|
-
}, z.core.$strip>;
|
|
5771
|
-
/**
|
|
5772
|
-
* Location attribute config schema
|
|
5773
|
-
*/
|
|
5774
|
-
declare const locationConfigSchema: z.ZodObject<{
|
|
5775
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5776
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5777
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5778
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5779
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5780
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5781
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5782
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5783
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5784
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5785
|
-
granularity: z.ZodEnum<{
|
|
5786
|
-
full: "full";
|
|
5787
|
-
address: "address";
|
|
5788
|
-
city: "city";
|
|
5789
|
-
state: "state";
|
|
5790
|
-
country: "country";
|
|
5791
|
-
coordinates: "coordinates";
|
|
5792
|
-
}>;
|
|
5793
|
-
enableAutocomplete: z.ZodOptional<z.ZodBoolean>;
|
|
5794
|
-
enableMap: z.ZodOptional<z.ZodBoolean>;
|
|
5795
|
-
defaultCountry: z.ZodOptional<z.ZodString>;
|
|
5796
|
-
allowedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5797
|
-
displayFormat: z.ZodOptional<z.ZodEnum<{
|
|
5798
|
-
single_line: "single_line";
|
|
5799
|
-
multi_line: "multi_line";
|
|
5800
|
-
compact: "compact";
|
|
5801
|
-
}>>;
|
|
5802
|
-
}, z.core.$strip>;
|
|
5803
|
-
/**
|
|
5804
|
-
* Select attribute config schema
|
|
5805
|
-
*/
|
|
5806
|
-
declare const selectConfigSchema: z.ZodObject<{
|
|
5807
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5808
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5809
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5810
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5811
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5812
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5813
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5814
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5815
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5816
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5817
|
-
options: z.ZodArray<z.ZodObject<{
|
|
5818
|
-
id: z.ZodString;
|
|
5819
|
-
label: z.ZodString;
|
|
5820
|
-
value: z.ZodString;
|
|
5821
|
-
color: z.ZodOptional<z.ZodString>;
|
|
5822
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5823
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5824
|
-
group: z.ZodOptional<z.ZodEnum<{
|
|
5825
|
-
in_progress: "in_progress";
|
|
5826
|
-
idle: "idle";
|
|
5827
|
-
finished: "finished";
|
|
5828
|
-
}>>;
|
|
5829
|
-
}, z.core.$strip>>;
|
|
5830
|
-
}, z.core.$strip>;
|
|
5831
|
-
/**
|
|
5832
|
-
* Multiselect attribute config schema
|
|
5833
|
-
*/
|
|
5834
|
-
declare const multiselectConfigSchema: z.ZodObject<{
|
|
5835
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5836
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5837
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5838
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5839
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5840
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5841
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5842
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5843
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5844
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5845
|
-
options: z.ZodArray<z.ZodObject<{
|
|
5846
|
-
id: z.ZodString;
|
|
5847
|
-
label: z.ZodString;
|
|
5848
|
-
value: z.ZodString;
|
|
5849
|
-
color: z.ZodOptional<z.ZodString>;
|
|
5850
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5851
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5852
|
-
group: z.ZodOptional<z.ZodEnum<{
|
|
5853
|
-
in_progress: "in_progress";
|
|
5854
|
-
idle: "idle";
|
|
5855
|
-
finished: "finished";
|
|
5856
|
-
}>>;
|
|
5857
|
-
}, z.core.$strip>>;
|
|
5858
|
-
}, z.core.$strip>;
|
|
5859
|
-
/**
|
|
5860
|
-
* File attribute config schema
|
|
5861
|
-
*/
|
|
5862
|
-
declare const fileConfigSchema: z.ZodObject<{
|
|
5863
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5864
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5865
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5866
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5867
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5868
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5869
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5870
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5871
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5872
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5873
|
-
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
5874
|
-
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
5875
|
-
allowedTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5876
|
-
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
5877
|
-
}, z.core.$strip>;
|
|
5878
|
-
/**
|
|
5879
|
-
* User attribute config schema
|
|
5880
|
-
*/
|
|
5881
|
-
declare const userConfigSchema: z.ZodObject<{
|
|
5882
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5883
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5884
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5885
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5886
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5887
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5888
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5889
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5890
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5891
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5892
|
-
allowedRoles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5893
|
-
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
5894
|
-
}, z.core.$strip>;
|
|
5895
|
-
/**
|
|
5896
|
-
* Relation attribute config schema
|
|
5897
|
-
*/
|
|
5898
|
-
declare const relationConfigSchema: z.ZodObject<{
|
|
5899
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5900
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5901
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5902
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5903
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5904
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5905
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5906
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5907
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5908
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5909
|
-
targets: z.ZodArray<z.ZodObject<{
|
|
5910
|
-
object: z.ZodString;
|
|
5911
|
-
displayTemplate: z.ZodOptional<z.ZodString>;
|
|
5912
|
-
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5913
|
-
}, z.core.$strip>>;
|
|
5914
|
-
cardinality: z.ZodEnum<{
|
|
5915
|
-
one: "one";
|
|
5916
|
-
many: "many";
|
|
5917
|
-
}>;
|
|
5918
|
-
minItems: z.ZodOptional<z.ZodNumber>;
|
|
5919
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
5920
|
-
}, z.core.$strip>;
|
|
5921
|
-
/**
|
|
5922
|
-
* Rating attribute config schema
|
|
5923
|
-
*/
|
|
5924
|
-
declare const ratingConfigSchema: z.ZodObject<{
|
|
5925
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5926
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5927
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5928
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5929
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5930
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5931
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5932
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5933
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5934
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5935
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
5936
|
-
iconType: z.ZodOptional<z.ZodEnum<{
|
|
5937
|
-
number: "number";
|
|
5938
|
-
heart: "heart";
|
|
5939
|
-
star: "star";
|
|
5940
|
-
thumbs: "thumbs";
|
|
5941
|
-
}>>;
|
|
5942
|
-
}, z.core.$strip>;
|
|
5943
|
-
/**
|
|
5944
|
-
* Formula attribute config schema
|
|
5945
|
-
*/
|
|
5946
|
-
declare const formulaConfigSchema: z.ZodObject<{
|
|
5947
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5948
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5949
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5950
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5951
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5952
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5953
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5954
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5955
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5956
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5957
|
-
expression: z.ZodString;
|
|
5958
|
-
returnType: z.ZodEnum<{
|
|
5959
|
-
number: "number";
|
|
5960
|
-
boolean: "boolean";
|
|
5961
|
-
text: "text";
|
|
5962
|
-
date: "date";
|
|
5963
|
-
}>;
|
|
5964
|
-
decimals: z.ZodOptional<z.ZodNumber>;
|
|
5965
|
-
allowRelations: z.ZodOptional<z.ZodBoolean>;
|
|
5966
|
-
}, z.core.$strip>;
|
|
5967
|
-
/**
|
|
5968
|
-
* Rollup attribute config schema
|
|
5969
|
-
*/
|
|
5970
|
-
declare const rollupConfigSchema: z.ZodObject<{
|
|
5971
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
5972
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
5973
|
-
description: z.ZodOptional<z.ZodString>;
|
|
5974
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
5975
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
5976
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
5977
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5978
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5979
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
5980
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5981
|
-
relationAttribute: z.ZodOptional<z.ZodString>;
|
|
5982
|
-
relationPath: z.ZodOptional<z.ZodString>;
|
|
5983
|
-
targetAttribute: z.ZodString;
|
|
5984
|
-
function: z.ZodEnum<{
|
|
5985
|
-
sum: "sum";
|
|
5986
|
-
avg: "avg";
|
|
5987
|
-
earliest: "earliest";
|
|
5988
|
-
latest: "latest";
|
|
5989
|
-
count: "count";
|
|
5990
|
-
countValues: "countValues";
|
|
5991
|
-
countUniqueValues: "countUniqueValues";
|
|
5992
|
-
countEmpty: "countEmpty";
|
|
5993
|
-
percentEmpty: "percentEmpty";
|
|
5994
|
-
percentNotEmpty: "percentNotEmpty";
|
|
5995
|
-
original: "original";
|
|
5996
|
-
}>;
|
|
5997
|
-
decimals: z.ZodOptional<z.ZodNumber>;
|
|
5998
|
-
targetAttributeType: z.ZodOptional<z.ZodString>;
|
|
5999
|
-
targetAttributeOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6000
|
-
id: z.ZodString;
|
|
6001
|
-
label: z.ZodString;
|
|
6002
|
-
value: z.ZodString;
|
|
6003
|
-
color: z.ZodOptional<z.ZodString>;
|
|
6004
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
6005
|
-
description: z.ZodOptional<z.ZodString>;
|
|
6006
|
-
group: z.ZodOptional<z.ZodEnum<{
|
|
6007
|
-
in_progress: "in_progress";
|
|
6008
|
-
idle: "idle";
|
|
6009
|
-
finished: "finished";
|
|
6010
|
-
}>>;
|
|
6011
|
-
}, z.core.$strip>>>;
|
|
6012
|
-
}, z.core.$strip>;
|
|
6013
|
-
/**
|
|
6014
|
-
* Document attribute config schema
|
|
6015
|
-
*/
|
|
6016
|
-
declare const documentConfigSchema: z.ZodObject<{
|
|
6017
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
6018
|
-
placeholder: z.ZodOptional<z.ZodString>;
|
|
6019
|
-
description: z.ZodOptional<z.ZodString>;
|
|
6020
|
-
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
6021
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
6022
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
6023
|
-
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
6024
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
6025
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
6026
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6027
|
-
templateId: z.ZodOptional<z.ZodString>;
|
|
6028
|
-
allowedTemplates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6029
|
-
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
6030
|
-
maxDocuments: z.ZodOptional<z.ZodNumber>;
|
|
6031
|
-
autoProcess: z.ZodOptional<z.ZodBoolean>;
|
|
6032
|
-
}, z.core.$strip>;
|
|
6033
|
-
/**
|
|
6034
|
-
* Map of attribute type to config schema
|
|
6035
|
-
*/
|
|
6036
|
-
declare const attributeConfigSchemas: Record<AttributeType, z.ZodObject<z.ZodRawShape>>;
|
|
6037
|
-
/**
|
|
6038
|
-
* Get the config schema for a specific attribute type
|
|
6039
|
-
*/
|
|
6040
|
-
declare function getAttributeConfigSchema(type: AttributeType): z.ZodObject<z.ZodRawShape>;
|
|
6041
|
-
/**
|
|
6042
|
-
* Validate attribute config for a specific type
|
|
6043
|
-
* Returns the validated config with only allowed properties
|
|
6044
|
-
*/
|
|
6045
|
-
declare function validateAttributeConfig(type: AttributeType, config: Record<string, unknown>): {
|
|
6046
|
-
success: true;
|
|
6047
|
-
data: Record<string, unknown>;
|
|
6048
|
-
} | {
|
|
6049
|
-
success: false;
|
|
6050
|
-
errors: string[];
|
|
6051
|
-
};
|
|
6052
|
-
/**
|
|
6053
|
-
* Validate and strip unknown properties from attribute config
|
|
6054
|
-
* This ensures only allowed properties are stored in the database
|
|
6055
|
-
*/
|
|
6056
|
-
declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
6057
|
-
/**
|
|
6058
|
-
* Safely parse attribute config, returning undefined for invalid configs
|
|
6059
|
-
*/
|
|
6060
|
-
declare function safeParseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
6061
|
-
/**
|
|
6062
|
-
* Create a Zod schema for a text attribute
|
|
6063
|
-
*/
|
|
6064
|
-
declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z.ZodString;
|
|
6065
|
-
/**
|
|
6066
|
-
* Create a Zod schema for a number attribute
|
|
6067
|
-
*/
|
|
6068
|
-
declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
6069
|
-
/**
|
|
6070
|
-
* Create a Zod schema for a checkbox attribute
|
|
6071
|
-
*/
|
|
6072
|
-
declare function createCheckboxValidator(_attr: CheckboxAttribute, _messages?: ValidationMessages): z.ZodBoolean;
|
|
6073
|
-
/**
|
|
6074
|
-
* Create a Zod schema for a date attribute
|
|
6075
|
-
*/
|
|
6076
|
-
declare function createDateValidator(attr: DateAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6077
|
-
/**
|
|
6078
|
-
* Create a Zod schema for a phone attribute
|
|
6079
|
-
*/
|
|
6080
|
-
declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
6081
|
-
countryCode: string;
|
|
6082
|
-
phoneNumber: string;
|
|
6083
|
-
}>;
|
|
6084
|
-
/**
|
|
6085
|
-
* Create a Zod schema for a currency attribute
|
|
6086
|
-
*/
|
|
6087
|
-
declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
6088
|
-
code: string;
|
|
6089
|
-
value: number;
|
|
6090
|
-
}>;
|
|
6091
|
-
/**
|
|
6092
|
-
* Create a Zod schema for a status attribute
|
|
6093
|
-
*/
|
|
6094
|
-
declare function createStatusValidator(attr: StatusAttribute, messages?: ValidationMessages): z.ZodEnum<Readonly<Record<string, string>>>;
|
|
6095
|
-
/**
|
|
6096
|
-
* Create a Zod schema for a select attribute
|
|
6097
|
-
*/
|
|
6098
|
-
declare function createSelectValidator(attr: SelectAttribute, messages?: ValidationMessages): z.ZodEnum<Readonly<Record<string, string>>>;
|
|
6099
|
-
/**
|
|
6100
|
-
* Create a Zod schema for a multiselect attribute
|
|
6101
|
-
*/
|
|
6102
|
-
declare function createMultiselectValidator(attr: MultiselectAttribute, messages?: ValidationMessages): z.ZodArray<z.ZodEnum<Readonly<Record<string, string>>>>;
|
|
6103
|
-
/**
|
|
6104
|
-
* Create a Zod schema for a location attribute
|
|
6105
|
-
*/
|
|
6106
|
-
type LocationShape = {
|
|
6107
|
-
address?: string;
|
|
6108
|
-
address2?: string;
|
|
6109
|
-
city?: string;
|
|
6110
|
-
state?: string;
|
|
6111
|
-
postalCode?: string;
|
|
6112
|
-
country?: string;
|
|
6113
|
-
latitude?: number;
|
|
6114
|
-
longitude?: number;
|
|
6115
|
-
};
|
|
6116
|
-
declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z.ZodType<LocationShape>;
|
|
6117
|
-
/**
|
|
6118
|
-
* Create a Zod schema for a file attribute
|
|
6119
|
-
* Supports both single file (UUID) and multiple files (array of UUIDs)
|
|
6120
|
-
*/
|
|
6121
|
-
declare function createFileValidator(attr: FileAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6122
|
-
/**
|
|
6123
|
-
* Create a Zod schema for a user attribute
|
|
6124
|
-
* Supports both single user (UUID) and multiple users (array of UUIDs)
|
|
6125
|
-
*/
|
|
6126
|
-
declare function createUserValidator(attr: UserAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6127
|
-
/**
|
|
6128
|
-
* Create a Zod schema for a single relation attribute (cardinality: "one")
|
|
6129
|
-
*/
|
|
6130
|
-
declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z.ZodUnion<[z.ZodUUID, z.ZodNull]>;
|
|
6131
|
-
/**
|
|
6132
|
-
* Create a Zod schema for a multi relation attribute (cardinality: "many")
|
|
6133
|
-
*/
|
|
6134
|
-
declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z.ZodArray<z.ZodUUID>;
|
|
6135
|
-
/**
|
|
6136
|
-
* Create a Zod schema for a relation attribute
|
|
6137
|
-
* Dispatches to single or multi validator based on cardinality
|
|
6138
|
-
*/
|
|
6139
|
-
declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z.ZodUnion<[z.ZodUUID, z.ZodNull]> | z.ZodArray<z.ZodUUID>;
|
|
6140
|
-
/**
|
|
6141
|
-
* Create a Zod schema for a rating attribute
|
|
6142
|
-
*/
|
|
6143
|
-
declare function createRatingValidator(attr: RatingAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
6144
|
-
/**
|
|
6145
|
-
* Create a Zod schema for a formula attribute.
|
|
6146
|
-
* Formula attributes are read-only (computed at runtime).
|
|
6147
|
-
* They accept any value during validation but are ignored during record creation/update.
|
|
6148
|
-
*/
|
|
6149
|
-
declare function createFormulaValidator(_attr: FormulaAttribute, _messages?: ValidationMessages): z.ZodUnknown;
|
|
6150
|
-
/**
|
|
6151
|
-
* Create a Zod schema for a rollup attribute.
|
|
6152
|
-
* Rollup attributes are read-only (computed from related records).
|
|
6153
|
-
* They accept any value during validation but are ignored during record creation/update.
|
|
6154
|
-
*/
|
|
6155
|
-
declare function createRollupValidator(_attr: RollupAttribute, _messages?: ValidationMessages): z.ZodUnknown;
|
|
6156
|
-
/**
|
|
6157
|
-
* Create a Zod schema for a textarea attribute.
|
|
6158
|
-
* Validates that the value is a string.
|
|
6159
|
-
*/
|
|
6160
|
-
declare function createTextAreaValidator(_attr: TextAreaAttribute, _messages?: ValidationMessages): z.ZodString;
|
|
6161
|
-
/**
|
|
6162
|
-
* Create a Zod schema for a richtext attribute.
|
|
6163
|
-
* Validates semantic markdown content as a string.
|
|
6164
|
-
*
|
|
6165
|
-
* @example Valid richtext content (semantic markdown)
|
|
6166
|
-
* ```typescript
|
|
6167
|
-
* `# Heading
|
|
6168
|
-
*
|
|
6169
|
-
* Some paragraph text.
|
|
6170
|
-
*
|
|
6171
|
-
* :::callout{variant="info"}
|
|
6172
|
-
* This is a callout block
|
|
6173
|
-
* :::
|
|
6174
|
-
* `
|
|
6175
|
-
* ```
|
|
6176
|
-
*/
|
|
6177
|
-
declare function createRichtextValidator(attr: RichtextAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6178
|
-
/**
|
|
6179
|
-
* Create a Zod schema for any attribute type.
|
|
6180
|
-
* Returns a strict validator that does NOT handle optional fields.
|
|
6181
|
-
* Use createFormAttributeValidator for form validation with optional support.
|
|
6182
|
-
*
|
|
6183
|
-
* @param attr - The attribute to create a validator for
|
|
6184
|
-
* @param messages - Custom validation messages for i18n support
|
|
6185
|
-
*/
|
|
6186
|
-
declare function createAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6187
|
-
/**
|
|
6188
|
-
* Create a Zod schema for form validation.
|
|
6189
|
-
* - Normalizes empty values (empty strings, empty objects) to null for optional fields
|
|
6190
|
-
* - Accepts custom messages for i18n support
|
|
6191
|
-
*
|
|
6192
|
-
* Use this in UI forms where optional fields may have null/undefined values.
|
|
6193
|
-
*
|
|
6194
|
-
* @param attr - The attribute to create a validator for
|
|
6195
|
-
* @param messages - Custom validation messages for i18n support
|
|
6196
|
-
*/
|
|
6197
|
-
declare function createFormAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
6198
|
-
/**
|
|
6199
|
-
* Create a Zod schema for an entire object
|
|
6200
|
-
*
|
|
6201
|
-
* Uses passthrough mode to allow computed fields (formula, rollup) that may be
|
|
6202
|
-
* present in record data but are not part of the mutable schema.
|
|
6203
|
-
*/
|
|
6204
|
-
declare function createObjectValidator(objectDef: ObjectDefinition): z.ZodType<Record<string, unknown>>;
|
|
6205
|
-
/**
|
|
6206
|
-
* Validation result
|
|
6207
|
-
*/
|
|
6208
|
-
interface ValidationResult {
|
|
6209
|
-
success: boolean;
|
|
6210
|
-
data?: Record<string, unknown>;
|
|
6211
|
-
errors?: Array<{
|
|
6212
|
-
path: string[];
|
|
6213
|
-
message: string;
|
|
6214
|
-
}>;
|
|
6215
|
-
}
|
|
6216
|
-
/**
|
|
6217
|
-
* Validate data against an attribute schema
|
|
6218
|
-
*/
|
|
6219
|
-
declare function validateAttribute(attr: Attribute, value: unknown): ValidationResult;
|
|
6220
|
-
/**
|
|
6221
|
-
* Validate data against an object schema
|
|
6222
|
-
*/
|
|
6223
|
-
declare function validateObject(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
|
|
6224
|
-
/**
|
|
6225
|
-
* Validate and throw if invalid
|
|
6226
|
-
*/
|
|
6227
|
-
declare function validateObjectOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
|
|
6228
|
-
/**
|
|
6229
|
-
* Create a Zod schema for draft validation.
|
|
6230
|
-
* All attributes become optional, but provided values are still validated.
|
|
6231
|
-
*
|
|
6232
|
-
* Uses passthrough mode to allow computed fields (formula, rollup) that may be
|
|
6233
|
-
* present in record data but are not part of the mutable schema.
|
|
6234
|
-
*/
|
|
6235
|
-
declare function createDraftValidator(objectDef: ObjectDefinition): z.ZodType<Record<string, unknown>>;
|
|
6236
|
-
/**
|
|
6237
|
-
* Validate data in draft mode.
|
|
6238
|
-
* - All attributes are treated as optional (no required validation)
|
|
6239
|
-
* - Provided values are still validated for format/type correctness
|
|
6240
|
-
*
|
|
6241
|
-
* Use this when creating records that may be incomplete (drafts).
|
|
6242
|
-
*
|
|
6243
|
-
* @example
|
|
6244
|
-
* ```typescript
|
|
6245
|
-
* const result = validateDraft(PRODUCT, { name: "Draft" });
|
|
6246
|
-
* // → success even if "price" is required but missing
|
|
6247
|
-
*
|
|
6248
|
-
* const result2 = validateDraft(PRODUCT, { price: -10 });
|
|
6249
|
-
* // → fails because price must be >= 0 (format validation still applies)
|
|
6250
|
-
* ```
|
|
6251
|
-
*/
|
|
6252
|
-
declare function validateDraft(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
|
|
6253
|
-
/**
|
|
6254
|
-
* Validate draft data and throw if format validation fails.
|
|
6255
|
-
*/
|
|
6256
|
-
declare function validateDraftOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
|
|
6257
|
-
/**
|
|
6258
|
-
* Get the list of required attributes that are missing values.
|
|
6259
|
-
*
|
|
6260
|
-
* @example
|
|
6261
|
-
* ```typescript
|
|
6262
|
-
* const missing = getMissingRequiredAttributes(PRODUCT, { name: "Test" });
|
|
6263
|
-
* // → [priceAttribute, statusAttribute] if price and status are required but missing
|
|
6264
|
-
* ```
|
|
6265
|
-
*/
|
|
6266
|
-
declare function getMissingRequiredAttributes(objectDef: ObjectDefinition, data: Record<string, unknown>): Attribute[];
|
|
6267
|
-
/**
|
|
6268
|
-
* Check if a record is complete (all required attributes have valid values).
|
|
6269
|
-
*
|
|
6270
|
-
* @returns `true` if all required values are present and valid, `false` otherwise
|
|
6271
|
-
*/
|
|
6272
|
-
declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<string, unknown>): boolean;
|
|
6273
|
-
/**
|
|
6274
|
-
* Compute the completion status of a record based on its data.
|
|
6275
|
-
*
|
|
6276
|
-
* - `"complete"`: All required values are present and valid
|
|
6277
|
-
* - `"draft"`: One or more required values are missing or invalid
|
|
6278
|
-
*
|
|
6279
|
-
* This function is used to dynamically determine the status when
|
|
6280
|
-
* creating or updating records.
|
|
6281
|
-
*
|
|
6282
|
-
* @example
|
|
6283
|
-
* ```typescript
|
|
6284
|
-
* const status = computeRecordStatus(PRODUCT, {
|
|
6285
|
-
* name: "Nike Air Max",
|
|
6286
|
-
* price: 129.99,
|
|
6287
|
-
* status: "active"
|
|
6288
|
-
* });
|
|
6289
|
-
* // → "complete"
|
|
6290
|
-
*
|
|
6291
|
-
* const status2 = computeRecordStatus(PRODUCT, { name: "Draft Product" });
|
|
6292
|
-
* // → "draft" (missing required fields)
|
|
6293
|
-
* ```
|
|
6294
|
-
*/
|
|
6295
|
-
declare function computeRecordStatus(objectDef: ObjectDefinition, data: Record<string, unknown>): CompletionStatus;
|
|
6296
|
-
|
|
6297
4657
|
/**
|
|
6298
4658
|
* Cache Adapter - Agnostic caching interface for @stndrds/schema
|
|
6299
4659
|
*
|
|
@@ -12759,7 +11119,7 @@ declare class WorkflowInvitationService extends BaseService {
|
|
|
12759
11119
|
}
|
|
12760
11120
|
|
|
12761
11121
|
/**
|
|
12762
|
-
* Result of checking if a field is read-only
|
|
11122
|
+
* Result of checking if a field is read-only (internal use only)
|
|
12763
11123
|
*/
|
|
12764
11124
|
interface FieldReadOnlyResult {
|
|
12765
11125
|
/** Whether the field is read-only */
|
|
@@ -13964,4 +12324,4 @@ interface FullSyncOptions extends SyncOptions, ViewSyncOptions {
|
|
|
13964
12324
|
*/
|
|
13965
12325
|
declare function syncAll(adapter: DatabaseAdapter, objectRegistry: typeof registry, nativeViewRegistry: typeof viewRegistry, options?: FullSyncOptions): Promise<FullSyncResult>;
|
|
13966
12326
|
|
|
13967
|
-
export { type FlowRow as $, type Attribute as A, type Tab as B, type CheckboxAttribute as C, type DateAttribute as D, type FilterState as E, type FeatureGate as F, type Group as G, type SortRule as H, type InferAttributeValue as I, type DirectTableTab as J, type ListViewDefinition as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type ObjectAction as O, type PhoneAttribute as P, type WorkflowConfig as Q, type RichtextAttribute as R, type SystemResource as S, type TextAttribute as T, type UserAttribute as U, type SlotMode as V, type WorkflowTheme as W, type ConditionGroup as X, type ConditionRule as Y, type WorkflowNode as Z, type WorkflowDefinition as _, type DocumentAttribute as a, type DateValue as a$, type FlagValueType as a0, type FeatureFlagDefinition as a1, type FlagLevel as a2, type FeatureFlagsRepository as a3, type StaticFlagDefault as a4, type ResolvedFlag as a5, type ViewType as a6, type ViewDefinition as a7, type DocumentTemplate as a8, type OcrAdapter as a9, type ThinkingPartData as aA, type ReasoningPartData as aB, type AIChatMessagePart as aC, type AIChatMessage as aD, type AIQuestionType as aE, type AIQuestionOption as aF, type AIQuestion as aG, type AIQuestionAnswer as aH, type AIBatchQuestionOption as aI, type AIBatchQuestion as aJ, type AIBatchQuestionAnswer as aK, type AITodoStatus as aL, type AITodoItem as aM, type AITodoList as aN, type AIMessageAttachment as aO, type AIConversation as aP, type AIMessage as aQ, type AIToolCallRecord as aR, type AIUserMemory as aS, type AIUsageMetrics as aT, type AIProviderMetrics as aU, type CreateAIMessageInput as aV, type StatusGroup as aW, type AttributeGroup as aX, type BaseAttribute as aY, type NumberUnit as aZ, type DateFormat as a_, type OcrInput as aa, type OcrOptions as ab, type OcrResult as ac, type OcrPage as ad, type OcrTextBlock as ae, type BoundingBox as af, type SignatureAdapter as ag, type CreateSignatureInput as ah, type SignerRequest as ai, type SignaturePosition as aj, type SignatureRequestResult as ak, type SignatureStatusResult as al, type SignerStatus as am, type SignatureStatus as an, type IdentityVerificationAdapter as ao, type VerifyInput as ap, type VerificationResult as aq, type DocumentData as ar, type VerificationCheck as as, type AIMessageRole as at, type AIThinkingLevel as au, type AIToolCallStatus as av, type AIToolCall as aw, type AIChatMessagePartType as ax, type TextPartData as ay, type ToolPartData as az, type SystemAction as b, type FilterValue as b$, type Phone as b0, type Currency as b1, type Location as b2, type LocationGranularity as b3, RELATION_TARGET_ANY as b4, type RelationAttribute as b5, isUniversalRelation as b6, type AuditResourceType as b7, type AuditAction as b8, type AuditActorType as b9, type UpdateDocument as bA, type CreateDocumentTemplate as bB, type UpdateDocumentTemplate as bC, type CreateDocumentSlot as bD, type UpdateDocumentSlot as bE, type CreateProcessingJob as bF, type UpdateProcessingJob as bG, type DocumentListOptions as bH, type DocumentTemplateListOptions as bI, type FlagOverride as bJ, type FeatureFlagsConfig as bK, type StorageProvider as bL, type FileVisibility as bM, type File as bN, type CreateFile as bO, type UpdateFile as bP, type TextFilterOperator as bQ, type NumberFilterOperator as bR, type CheckboxFilterOperator as bS, type DateFilterOperator as bT, type SelectFilterOperator as bU, type MultiselectFilterOperator as bV, type RelationFilterOperator as bW, type FilterOperator as bX, type RelativeDateValue as bY, type CurrencyFilterValue as bZ, type PhoneFilterValue as b_, type AuditChange as ba, type AuditLogEntry as bb, type CreateAuditLogInput as bc, type AuditListOptions as bd, type AuditServiceOptions as be, type VariableMapping as bf, type PdfTemplateField as bg, type TemplateSource as bh, type DocumentGenerationTemplate as bi, type CreateDocumentGenerationTemplate as bj, type UpdateDocumentGenerationTemplate as bk, type PendingDocumentRequest as bl, isPdfTemplateSource as bm, isDocxTemplateSource as bn, type DocumentSlotDefinition as bo, type DocumentAutoProcessing as bp, type ExtractionMapping as bq, type ExtractionField as br, type Document as bs, type DocumentStatus as bt, type DocumentSlot as bu, type SlotStatus as bv, type ProcessingJob as bw, type ProcessingJobType as bx, type ProcessingJobStatus as by, type CreateDocument as bz, type TextAreaAttribute as c, type Permission as c$, type FilterRule as c0, type ExtendedFilterRule as c1, type FilterCombinator as c2, type FilterGroup as c3, type AdvancedFilterState as c4, isAdvancedFilterState as c5, toAdvancedFilterState as c6, toSimpleFilterState as c7, type SortDirection as c8, type QueryState as c9, type InferRecordInput as cA, type InferRecordUpdate as cB, type CustomAttributeValue as cC, type WithCustomAttributes as cD, type RecordMetadata as cE, type SystemFields as cF, type ExtractRecord as cG, type ExtractRecordStrict as cH, type ExtractRecordInput as cI, type ExtractRecordInputStrict as cJ, type ExtractRecordUpdate as cK, type ExtractRecordUpdateStrict as cL, type ExtractAttributes as cM, type TypedObjectRecord as cN, type ExtractObjectRecord as cO, type ExtractObjectRecordWithCustom as cP, RESERVED_ATTRIBUTE_NAMES as cQ, SYSTEM_FIELD_NAMES as cR, type ReservedAttributeName as cS, type SystemFieldName as cT, type Timestamps as cU, type SharingMode as cV, type ObjectAttribute as cW, type CompletionStatus as cX, type ObjectRecord as cY, type PermissionScope as cZ, type Role as c_, OPERATORS_BY_TYPE as ca, type NoValueOperator as cb, NO_VALUE_OPERATORS as cc, isNoValueOperator as cd, type FlowSlot as ce, type FlowRowField as cf, type FlowPage as cg, type FlowRelation as ch, type FlowStatus as ci, type FlowDefinition as cj, isFlowDefinition as ck, isFlowPublished as cl, isSystemFlow as cm, type GeocodingSuggestion as cn, type GeocodingAutocompleteParams as co, type ReverseGeocodingParams as cp, type GeocodingParams as cq, type GeocodingAdapter as cr, NoopGeocodingAdapter as cs, type AttributeSchema as ct, type InferRecordFromSchema as cu, type InferRecordWithRequirements as cv, type TypedAttribute as cw, type AttributeMap as cx, type AddAttribute as cy, type InferRecord as cz, type RichtextFeature as d, isDocumentNode as d$, type UserRoleAssignment as d0, type EffectivePermissions as d1, type ObjectPermissions as d2, type SystemPermissions as d3, type CreateRoleInput as d4, type UpdateRoleInput as d5, type CreatePermissionInput as d6, type AssignRoleInput as d7, type PolicyContext as d8, type RecordPolicy as d9, type GalleryViewDefinition as dA, type ConfigOverrides as dB, type ViewOverlay as dC, isDetailView as dD, isListView as dE, isCalendarView as dF, isTimelineView as dG, isGalleryView as dH, isFormTab as dI, isTableTab as dJ, isDirectTableTab as dK, isInverseTableTab as dL, isCustomTab as dM, isActivityTab as dN, isNotesTab as dO, isFlowsTab as dP, isDocumentsTab as dQ, type ConditionNode as dR, type DocumentNode as dS, type EndNode as dT, type FormFieldRef as dU, type FormNode as dV, type StartNode as dW, type WorkflowNodeType as dX, getNodeOutputs as dY, isAdvancedFormNode as dZ, isConditionNode as d_, PolicyViolationError as da, type UserRole as db, type UserStatus as dc, type UserProfile as dd, type CreateUserProfile as de, type UpdateUserProfile as df, type InviteUserInput as dg, type TabType as dh, type FormTab as di, type CustomTab as dj, type ActivityTab as dk, type NotesTab as dl, type FlowsTab as dm, type DocumentsTab as dn, type ListViewLayout as dp, type ViewLayout as dq, type ViewTab as dr, type DetailViewConfig as ds, type ListViewConfig as dt, type CalendarViewConfig as du, type TimelineViewConfig as dv, type GalleryViewConfig as dw, type ViewConfig as dx, type CalendarViewDefinition as dy, type TimelineViewDefinition as dz, type CurrencyAttribute as e, type TenantId as e$, isEndNode as e0, isFormNode as e1, isSimpleFormNode as e2, isStartNode as e3, type ConditionOperator as e4, and as e5, eq as e6, inValues as e7, isConditionGroup as e8, isConditionRule as e9, isInvitationValid as eA, type CreateGrantInput as eB, type WorkflowAccessGrant as eC, canAccessNode as eD, isGrantExpired as eE, isGrantRevoked as eF, isGrantValid as eG, isTokenRevoked as eH, type GeneratedDocument as eI, type WorkflowExecutionContext as eJ, createEmptyContext as eK, getContextValue as eL, mergeFormToSlot as eM, setContextValue as eN, type FormContextResponse as eO, type FormFieldContext as eP, type FormFieldRow as eQ, type FormNodeInfo as eR, type ReadOnlyReason as eS, type WorkflowAccessMode as eT, type ThemeColors as eU, type ThemeLogo as eV, type ThemeTypography as eW, DEFAULT_THEME as eX, generateCssVariables as eY, mergeWithDefaults as eZ, type Uuid as e_, isEmpty as ea, isNotEmpty as eb, neq as ec, or as ed, type CanvasViewport as ee, type NodePosition as ef, type WorkflowLayout as eg, type WorkflowSlot as eh, type WorkflowStatus as ei, isSystemWorkflow as ej, isWorkflowDefinition as ek, isWorkflowPublished as el, type PendingAction as em, type WorkflowError as en, type WorkflowInstance as eo, type WorkflowTransition as ep, canResumeInstance as eq, createStartTransition as er, isInstanceTerminal as es, isInstanceWaiting as et, type CreateInvitationInput as eu, type CreateInvitationResult as ev, type InvitationStatus as ew, type WorkflowInvitation as ex, isInvitationAccepted as ey, isInvitationExpired as ez, type Option as f, validateDraft as f$, type UserId as f0, asTenantId as f1, asUserId as f2, generateId as f3, generatePrefixedId as f4, slugify as f5, generateTemplateName as f6, registry as f7, viewRegistry as f8, type ValidationMessages as f9, createNumberValidator as fA, createCheckboxValidator as fB, createDateValidator as fC, createPhoneValidator as fD, createCurrencyValidator as fE, createStatusValidator as fF, createSelectValidator as fG, createMultiselectValidator as fH, createLocationValidator as fI, createFileValidator as fJ, createUserValidator as fK, createSingleRelationValidator as fL, createMultiRelationValidator as fM, createRelationValidator as fN, createRatingValidator as fO, createFormulaValidator as fP, createRollupValidator as fQ, createTextAreaValidator as fR, createRichtextValidator as fS, createAttributeValidator as fT, createFormAttributeValidator as fU, createObjectValidator as fV, type ValidationResult as fW, validateAttribute as fX, validateObject as fY, validateObjectOrThrow as fZ, createDraftValidator as f_, DEFAULT_VALIDATION_MESSAGES as fa, textConfigSchema as fb, textareaConfigSchema as fc, richtextConfigSchema as fd, numberConfigSchema as fe, checkboxConfigSchema as ff, dateConfigSchema as fg, phoneConfigSchema as fh, currencyConfigSchema as fi, statusConfigSchema as fj, locationConfigSchema as fk, selectConfigSchema as fl, multiselectConfigSchema as fm, fileConfigSchema as fn, userConfigSchema as fo, relationConfigSchema as fp, ratingConfigSchema as fq, formulaConfigSchema as fr, rollupConfigSchema as fs, documentConfigSchema as ft, attributeConfigSchemas as fu, getAttributeConfigSchema as fv, validateAttributeConfig as fw, parseAttributeConfig as fx, safeParseAttributeConfig as fy, createTextValidator as fz, type StatusAttribute as g, hasContext as g$, validateDraftOrThrow as g0, getMissingRequiredAttributes as g1, isRecordComplete as g2, computeRecordStatus as g3, type ViewOverlaysRepository as g4, type DatabaseAdapter as g5, WorkflowJwtService as g6, type JwtVerificationResult as g7, type MagicLinkPayload as g8, type WorkflowAccessPayload as g9, type QueryBuilderOptions as gA, type EvaluationResult as gB, type EvaluationTrace as gC, evaluateCondition as gD, evaluate as gE, evaluateWithTrace as gF, TenantContextError as gG, FeatureFlagsContextError as gH, getFeatureFlags as gI, getFeatureValue as gJ, hasFeatureFlagsContext as gK, isFeatureEnabled as gL, runWithFeatureFlags as gM, tryGetFeatureValue as gN, withFeatureFlags as gO, type FeatureFlagsContext as gP, addSchemaToContext as gQ, getSchemaByNameFromContext as gR, getSchemaContext as gS, getSchemaFromContext as gT, hasSchemaContext as gU, runWithMergedSchemaContext as gV, runWithSchemaContext as gW, type SchemaContext as gX, getContext as gY, getTenantId as gZ, getUserId as g_, type WorkflowJwtConfig as ga, type WorkflowJwtPayload as gb, type CacheKeyType as gc, hashOptions as gd, type CacheAdapter as ge, type CacheOptions as gf, cacheKeys as gg, cacheTtl as gh, defaultTtl as gi, NoopCacheAdapter as gj, type FetchResult as gk, type FormattedRecord as gl, type GroupedFetchResult as gm, type InsertOptions as gn, type QueryBuilderState as go, type RegistryMap as gp, type RegistryObjectNames as gq, type ShortcutOperator as gr, createDefaultState as gs, formatRecord as gt, formatRecords as gu, QueryMultipleResultsError as gv, QueryNoResultError as gw, SHORTCUT_TO_FILTER_OPERATOR as gx, createQueryBuilder as gy, QueryBuilder as gz, type SelectAttribute as h, notesPolicy as h$, runWithContext as h0, withTenantContext as h1, type TenantContext as h2, createDefaultExecutorRegistry as h3, getDefaultExecutorRegistry as h4, type ExecutorCompleteResult as h5, type ExecutorContext as h6, type ExecutorErrorResult as h7, type ExecutorResult as h8, type ExecutorSuccessResult as h9, getRelationPath as hA, getTargetAttributeName as hB, InvalidPathError as hC, MaxDepthExceededError as hD, parsePath as hE, pathHasManyCardinality as hF, validatePath as hG, type PathCardinality as hH, type PathSegment as hI, type PathSegmentType as hJ, type SchemaResolver as hK, resolveMultiplePaths as hL, resolveSingleValue as hM, traversePath as hN, type TraversalOptions as hO, type TraversalResult as hP, type AttributeChange as hQ, type HookContext as hR, type HookDefinition as hS, type HookHandler as hT, type HookType as hU, NoopHookRegistry as hV, type HookRegistry as hW, createMockAdapter as hX, type MockStores as hY, defaultPolicyRegistry as hZ, PolicyRegistry as h_, type ExecutorWaitResult as ha, type NodeExecutor as hb, complete as hc, error as hd, ExecutorRegistry as he, success as hf, wait as hg, ConditionExecutor as hh, DocumentExecutor as hi, EndExecutor as hj, FormExecutor as hk, StartExecutor as hl, evaluateFormula as hm, evaluateFormulaAttribute as hn, evaluateFormulaAttributeWithRelations as ho, evaluateFormulaWithRelations as hp, evaluateFormulaWithResult as hq, extractFormulaVariables as hr, extractRelationNames as hs, extractRelationReferences as ht, flattenRelationsForEval as hu, formatFormulaResult as hv, hasRelationReferences as hw, validateFormulaExpression as hx, type FormulaResult as hy, getPathDepth as hz, type FileAttribute as i, checkRecordDeleteOrThrow as i$, type AIConversationsRepository as i0, type AIUsageMetricsRepository as i1, type AIUserMemoryRepository as i2, type AttributesRepository as i3, type AuditRepository as i4, type DocumentGenerationTemplateListOptions as i5, type DocumentGenerationTemplatesRepository as i6, type DocumentJobsRepository as i7, type DocumentSlotsRepository as i8, type DocumentsRepository as i9, type SearchQueryOptions as iA, type QueryResult as iB, RecordQueryService as iC, type RelationValidationResult as iD, type RelationValidationError as iE, type RelationOption as iF, type RelationOptionsResponse as iG, type GetRelationOptionsParams as iH, type RelationServiceOptions as iI, type ResolveIdsBatchRequest as iJ, type ResolveIdsBatchResponse as iK, RelationService as iL, RecordResolverService as iM, type ResolvedRelations as iN, type FormulaResolverServiceOptions as iO, FormulaResolverService as iP, type RollupResult as iQ, type RollupServiceOptions as iR, RollupService as iS, type RollupSchedulerOptions as iT, RollupScheduler as iU, applyDefaultValues as iV, checkPermission as iW, getPolicy as iX, buildPolicyContext as iY, checkRecordAccess as iZ, checkRecordModifyOrThrow as i_, type DocumentTemplatesRepository as ia, type FilesRepository as ib, type ObjectRecordsRepository as ic, type ObjectsRepository as id, type PermissionsRepository as ie, type UserProfilesRepository as ig, type ViewsRepository as ih, type WorkflowAccessGrantsRepository as ii, type WorkflowInstancesRepository as ij, type WorkflowInvitationsRepository as ik, type WorkflowsRepository as il, BaseService as im, BaseRepository as io, type SchemaContextAware as ip, SchemaContextAwareRepository as iq, type CreateCustomObjectInput as ir, type AddAttributeInput as is, type UpdateObjectInput as it, type ObjectSchemaServiceOptions as iu, ObjectSchemaService as iv, type RecordServiceOptions as iw, RecordService as ix, type RecordQueryServiceOptions as iy, type QueryOptions as iz, type SingleRelationAttribute as j, GlobalSearchService as j$, checkSharedObjectWriteAccess as j0, computeLabel as j1, type LabelResolver as j2, enrichWithFormulas as j3, enrichRecordsWithFormulas as j4, createContextForCreate as j5, createContextForUpdate as j6, createContextForDelete as j7, createContextForRestore as j8, recalculateParentRollups as j9, type UserValidationResult as jA, type UserValidationError as jB, UserService as jC, type UserProfileServiceOptions as jD, UserProfileService as jE, AuditService as jF, buildAuditChanges as jG, DocumentGenerationTemplateNotFoundError as jH, DocumentGenerationNotConfiguredError as jI, DocumentGenerationService as jJ, type DocumentProcessingConfig as jK, DocumentProcessingService as jL, type RenderDocumentInput as jM, type DocumentRendererOptions as jN, type RenderDocumentResult as jO, DocumentRenderError as jP, StorageDownloadNotSupportedError as jQ, DocumentRendererService as jR, DocumentTemplateService as jS, type RecordDocumentsResult as jT, type CreateRecordDocumentInput as jU, type CreateRecordDocumentResult as jV, type DocumentServiceOptions as jW, DocumentService as jX, type FileServiceOptions as jY, FileService as jZ, GeocodingService as j_, type RollupCascadeContext as ja, type DocumentProcessingHookOptions as jb, DocumentProcessingHook as jc, GrantNotFoundError as jd, GrantExpiredError as je, GrantRevokedError as jf, TokenRevokedError as jg, type GrantServiceConfig as jh, type CreateGrantResult as ji, WorkflowAccessGrantService as jj, type StartWorkflowInput as jk, type ResumeWorkflowInput as jl, type WorkflowInstanceServiceOptions as jm, WorkflowInstanceService as jn, type InvitationServiceConfig as jo, InvitationNotFoundError as jp, InvitationExpiredError as jq, InvitationAlreadyAcceptedError as jr, InvitationRevokedError as js, WorkflowInvitationService as jt, type FieldReadOnlyResult as ju, WorkflowRelationService as jv, type CreateWorkflowInput as jw, type UpdateWorkflowInput as jx, type WorkflowServiceOptions as jy, WorkflowService as jz, type MultiRelationAttribute as k, type OperationResult as k$, type PermissionServiceOptions as k0, PermissionService as k1, type CreateViewInput as k2, type UpdateViewInput as k3, type GetViewsOptions as k4, type GetViewOptions as k5, ViewService as k6, type FileContent as k7, type StorageUploadInput as k8, type StorageUploadResult as k9, type UpdateDBAttribute as kA, type UpsertDBAttribute as kB, type CreateObjectRecord as kC, type ListOptions as kD, type SearchOptions as kE, type GlobalSearchOptions as kF, type GlobalSearchResultItem as kG, type FileListOptions as kH, type DBView as kI, type CreateDBView as kJ, type UpdateDBView as kK, type UpsertDBView as kL, type DBViewOverlay as kM, type CreateDBViewOverlay as kN, type UpdateDBViewOverlay as kO, type DBWorkflow as kP, type CreateDBWorkflow as kQ, type UpdateDBWorkflow as kR, type DBWorkflowInstance as kS, type CreateDBWorkflowInstance as kT, type UpdateDBWorkflowInstance as kU, type DBWorkflowInvitation as kV, type CreateDBWorkflowInvitation as kW, type UpdateDBWorkflowInvitation as kX, type DBWorkflowAccessGrant as kY, type CreateDBWorkflowAccessGrant as kZ, type UpdateDBWorkflowAccessGrant as k_, type SignedUrlOptions as ka, type StorageAdapter as kb, type UploadFileInput as kc, type SyncResult as kd, type SyncOptions as ke, syncNativeObjects as kf, verifyNativeObjectsSync as kg, getSyncPreview as kh, type FullSyncResult as ki, type FullSyncOptions as kj, syncAll as kk, DEFAULT_LABEL_FALLBACK as kl, renderLabelExpression as km, isLabelExpression as kn, extractAttributeNames as ko, enrichValuesForDisplay as kp, enrichValuesWithSelectLabels as kq, extractRelationIds as kr, type RelationLabelResolver as ks, computeLabelWithRelations as kt, type DBObject as ku, type CreateDBObject as kv, type UpdateDBObject as kw, type UpsertDBObject as kx, type DBAttribute as ky, type CreateDBAttribute as kz, type RelationTarget as l, type ViewSyncResult as l0, type ViewSyncLogger as l1, type ViewSyncOptions as l2, seedRegistryViews as l3, syncNativeViews as l4, verifyRegistryViewsSeeded as l5, verifyNativeViewsSync as l6, getViewSeedPreview as l7, getViewSyncPreview as l8, type RatingAttribute as m, type FormulaAttribute as n, type FormulaReturnType as o, type RollupAttribute as p, type RollupFunction as q, type AttributeType as r, type ObjectDefinition as s, type Field as t, type AttributeGroupField as u, type TableTab as v, type DetailViewLayout as w, type InverseTableTab as x, type DetailViewDefinition as y, type InstanceStatus as z };
|
|
12327
|
+
export { type TextPartData as $, type AttributeGroupField as A, type BoundingBox as B, type ConditionGroup as C, type DetailViewLayout as D, type SignatureRequestResult as E, type Field as F, type Group as G, type SignatureStatusResult as H, type InferAttributeValue as I, type SignerStatus as J, type SignatureStatus as K, type ListViewDefinition as L, type IdentityVerificationAdapter as M, type VerifyInput as N, type ObjectAction as O, type VerificationResult as P, type DocumentData as Q, type VerificationCheck as R, type SystemResource as S, type TableTab as T, type AIMessageRole as U, type ViewType as V, type WorkflowTheme as W, type AIThinkingLevel as X, type AIToolCallStatus as Y, type AIToolCall as Z, type AIChatMessagePartType as _, type SystemAction as a, type UpdateFile as a$, type ToolPartData as a0, type ThinkingPartData as a1, type ReasoningPartData as a2, type AIChatMessagePart as a3, type AIChatMessage as a4, type AIQuestionType as a5, type AIQuestionOption as a6, type AIQuestion as a7, type AIQuestionAnswer as a8, type AIBatchQuestionOption as a9, type UpdateDocumentGenerationTemplate as aA, type PendingDocumentRequest as aB, type DocumentSlotDefinition as aC, type DocumentAutoProcessing as aD, type ExtractionMapping as aE, type ExtractionField as aF, type Document as aG, type DocumentStatus as aH, type DocumentSlot as aI, type SlotStatus as aJ, type ProcessingJob as aK, type ProcessingJobType as aL, type ProcessingJobStatus as aM, type CreateDocument as aN, type UpdateDocument as aO, type CreateDocumentTemplate as aP, type UpdateDocumentTemplate as aQ, type CreateDocumentSlot as aR, type UpdateDocumentSlot as aS, type CreateProcessingJob as aT, type UpdateProcessingJob as aU, type DocumentListOptions as aV, type DocumentTemplateListOptions as aW, type StorageProvider as aX, type FileVisibility as aY, type File as aZ, type CreateFile as a_, type AIBatchQuestion as aa, type AIBatchQuestionAnswer as ab, type AITodoStatus as ac, type AITodoItem as ad, type AITodoList as ae, type AIMessageAttachment as af, type AIConversation as ag, type AIMessage as ah, type AIToolCallRecord as ai, type AIUserMemory as aj, type AIUsageMetrics as ak, type AIProviderMetrics as al, type CreateAIMessageInput as am, type AuditResourceType as an, type AuditAction as ao, type AuditActorType as ap, type AuditChange as aq, type AuditLogEntry as ar, type CreateAuditLogInput as as, type AuditListOptions as at, type AuditServiceOptions as au, type VariableMapping as av, type PdfTemplateField as aw, type TemplateSource as ax, type DocumentGenerationTemplate as ay, type CreateDocumentGenerationTemplate as az, type InverseTableTab as b, type Permission as b$, type TextFilterOperator as b0, type NumberFilterOperator as b1, type CheckboxFilterOperator as b2, type DateFilterOperator as b3, type SelectFilterOperator as b4, type MultiselectFilterOperator as b5, type RelationFilterOperator as b6, type FilterOperator as b7, type RelativeDateValue as b8, type CurrencyFilterValue as b9, type GeocodingAdapter as bA, NoopGeocodingAdapter as bB, type AttributeSchema as bC, type InferRecordFromSchema as bD, type InferRecordWithRequirements as bE, type TypedAttribute as bF, type AttributeMap as bG, type AddAttribute as bH, type InferRecord as bI, type InferRecordInput as bJ, type InferRecordUpdate as bK, type CustomAttributeValue as bL, type WithCustomAttributes as bM, type RecordMetadata as bN, type SystemFields as bO, type ExtractRecord as bP, type ExtractRecordStrict as bQ, type ExtractRecordInput as bR, type ExtractRecordInputStrict as bS, type ExtractRecordUpdate as bT, type ExtractRecordUpdateStrict as bU, type ExtractAttributes as bV, type TypedObjectRecord as bW, type ExtractObjectRecord as bX, type ExtractObjectRecordWithCustom as bY, type PermissionScope as bZ, type Role as b_, type PhoneFilterValue as ba, type FilterValue as bb, type FilterRule as bc, type ExtendedFilterRule as bd, type FilterCombinator as be, type FilterGroup as bf, type AdvancedFilterState as bg, type SortDirection as bh, type QueryState as bi, OPERATORS_BY_TYPE as bj, type NoValueOperator as bk, NO_VALUE_OPERATORS as bl, isNoValueOperator as bm, type FlowSlot as bn, type FlowRowField as bo, type FlowPage as bp, type FlowRelation as bq, type FlowStatus as br, type FlowDefinition as bs, isFlowDefinition as bt, isFlowPublished as bu, isSystemFlow as bv, type GeocodingSuggestion as bw, type GeocodingAutocompleteParams as bx, type ReverseGeocodingParams as by, type GeocodingParams as bz, type DetailViewDefinition as c, isEndNode as c$, type UserRoleAssignment as c0, type EffectivePermissions as c1, type ObjectPermissions as c2, type SystemPermissions as c3, type CreateRoleInput as c4, type UpdateRoleInput as c5, type CreatePermissionInput as c6, type AssignRoleInput as c7, type PolicyContext as c8, type RecordPolicy as c9, type ConfigOverrides as cA, type ViewOverlay as cB, isDetailView as cC, isListView as cD, isCalendarView as cE, isTimelineView as cF, isGalleryView as cG, isFormTab as cH, isTableTab as cI, isDirectTableTab as cJ, isInverseTableTab as cK, isCustomTab as cL, isActivityTab as cM, isNotesTab as cN, isFlowsTab as cO, isDocumentsTab as cP, type ConditionNode as cQ, type DocumentNode as cR, type EndNode as cS, type FormFieldRef as cT, type FormNode as cU, type StartNode as cV, type WorkflowNodeType as cW, getNodeOutputs as cX, isAdvancedFormNode as cY, isConditionNode as cZ, isDocumentNode as c_, PolicyViolationError as ca, type UserRole as cb, type UserStatus as cc, type UserProfile as cd, type CreateUserProfile as ce, type UpdateUserProfile as cf, type InviteUserInput as cg, type TabType as ch, type FormTab as ci, type CustomTab as cj, type ActivityTab as ck, type NotesTab as cl, type FlowsTab as cm, type DocumentsTab as cn, type ListViewLayout as co, type ViewLayout as cp, type ViewTab as cq, type DetailViewConfig as cr, type ListViewConfig as cs, type CalendarViewConfig as ct, type TimelineViewConfig as cu, type GalleryViewConfig as cv, type ViewConfig as cw, type CalendarViewDefinition as cx, type TimelineViewDefinition as cy, type GalleryViewDefinition as cz, type InstanceStatus as d, WorkflowJwtService as d$, isFormNode as d0, isSimpleFormNode as d1, isStartNode as d2, type ConditionOperator as d3, and as d4, eq as d5, inValues as d6, isConditionGroup as d7, isConditionRule as d8, neq as d9, type WorkflowAccessGrant as dA, canAccessNode as dB, isGrantExpired as dC, isGrantRevoked as dD, isGrantValid as dE, isTokenRevoked as dF, type GeneratedDocument as dG, type WorkflowExecutionContext as dH, createEmptyContext as dI, getContextValue as dJ, setContextValue as dK, type FormContextResponse as dL, type FormFieldContext as dM, type FormFieldRow as dN, type FormNodeInfo as dO, type ReadOnlyReason as dP, type WorkflowAccessMode as dQ, type ThemeColors as dR, type ThemeLogo as dS, type ThemeTypography as dT, DEFAULT_THEME as dU, generateCssVariables as dV, mergeWithDefaults as dW, registry as dX, viewRegistry as dY, type ViewOverlaysRepository as dZ, type DatabaseAdapter as d_, or as da, type CanvasViewport as db, type NodePosition as dc, type WorkflowLayout as dd, type WorkflowSlot as de, type WorkflowStatus as df, isSystemWorkflow as dg, isWorkflowDefinition as dh, isWorkflowPublished as di, type PendingAction as dj, type WorkflowError as dk, type WorkflowInstance as dl, type WorkflowTransition as dm, canResumeInstance as dn, createStartTransition as dp, isInstanceTerminal as dq, isInstanceWaiting as dr, type CreateInvitationInput as ds, type CreateInvitationResult as dt, type InvitationStatus as du, type WorkflowInvitation as dv, isInvitationAccepted as dw, isInvitationExpired as dx, isInvitationValid as dy, type CreateGrantInput as dz, type Tab as e, type ExecutorContext as e$, type JwtVerificationResult as e0, type MagicLinkPayload as e1, type WorkflowAccessPayload as e2, type WorkflowJwtConfig as e3, type WorkflowJwtPayload as e4, type CacheKeyType as e5, hashOptions as e6, type CacheAdapter as e7, type CacheOptions as e8, cacheKeys as e9, FeatureFlagsContextError as eA, getFeatureFlags as eB, getFeatureValue as eC, hasFeatureFlagsContext as eD, isFeatureEnabled as eE, runWithFeatureFlags as eF, tryGetFeatureValue as eG, withFeatureFlags as eH, type FeatureFlagsContext as eI, addSchemaToContext as eJ, getSchemaByNameFromContext as eK, getSchemaContext as eL, getSchemaFromContext as eM, hasSchemaContext as eN, runWithMergedSchemaContext as eO, runWithSchemaContext as eP, type SchemaContext as eQ, getContext as eR, getTenantId as eS, getUserId as eT, hasContext as eU, runWithContext as eV, withTenantContext as eW, type TenantContext as eX, createDefaultExecutorRegistry as eY, getDefaultExecutorRegistry as eZ, type ExecutorCompleteResult as e_, cacheTtl as ea, defaultTtl as eb, NoopCacheAdapter as ec, type FetchResult as ed, type FormattedRecord as ee, type GroupedFetchResult as ef, type InsertOptions as eg, type QueryBuilderState as eh, type RegistryMap as ei, type RegistryObjectNames as ej, type ShortcutOperator as ek, createDefaultState as el, formatRecord as em, formatRecords as en, QueryMultipleResultsError as eo, QueryNoResultError as ep, SHORTCUT_TO_FILTER_OPERATOR as eq, createQueryBuilder as er, QueryBuilder as es, type QueryBuilderOptions as et, type EvaluationResult as eu, type EvaluationTrace as ev, evaluateCondition as ew, evaluate as ex, evaluateWithTrace as ey, TenantContextError as ez, type FilterState as f, type DocumentGenerationTemplatesRepository as f$, type ExecutorErrorResult as f0, type ExecutorResult as f1, type ExecutorSuccessResult as f2, type ExecutorWaitResult as f3, type NodeExecutor as f4, complete as f5, error as f6, ExecutorRegistry as f7, success as f8, wait as f9, type PathCardinality as fA, type PathSegment as fB, type PathSegmentType as fC, type SchemaResolver as fD, resolveMultiplePaths as fE, resolveSingleValue as fF, traversePath as fG, type TraversalOptions as fH, type TraversalResult as fI, type AttributeChange as fJ, type HookContext as fK, type HookDefinition as fL, type HookHandler as fM, type HookType as fN, NoopHookRegistry as fO, type HookRegistry as fP, createMockAdapter as fQ, type MockStores as fR, defaultPolicyRegistry as fS, PolicyRegistry as fT, notesPolicy as fU, type AIConversationsRepository as fV, type AIUsageMetricsRepository as fW, type AIUserMemoryRepository as fX, type AttributesRepository as fY, type AuditRepository as fZ, type DocumentGenerationTemplateListOptions as f_, ConditionExecutor as fa, DocumentExecutor as fb, EndExecutor as fc, FormExecutor as fd, StartExecutor as fe, evaluateFormula as ff, evaluateFormulaAttribute as fg, evaluateFormulaAttributeWithRelations as fh, evaluateFormulaWithRelations as fi, evaluateFormulaWithResult as fj, extractFormulaVariables as fk, extractRelationNames as fl, extractRelationReferences as fm, flattenRelationsForEval as fn, formatFormulaResult as fo, hasRelationReferences as fp, validateFormulaExpression as fq, type FormulaResult as fr, getPathDepth as fs, getRelationPath as ft, getTargetAttributeName as fu, InvalidPathError as fv, MaxDepthExceededError as fw, parsePath as fx, pathHasManyCardinality as fy, validatePath as fz, type SortRule as g, createContextForRestore as g$, type DocumentJobsRepository as g0, type DocumentSlotsRepository as g1, type DocumentsRepository as g2, type DocumentTemplatesRepository as g3, type FilesRepository as g4, type ObjectRecordsRepository as g5, type ObjectsRepository as g6, type PermissionsRepository as g7, type UserProfilesRepository as g8, type ViewsRepository as g9, type ResolveIdsBatchRequest as gA, type ResolveIdsBatchResponse as gB, RelationService as gC, RecordResolverService as gD, type ResolvedRelations as gE, type FormulaResolverServiceOptions as gF, FormulaResolverService as gG, type RollupResult as gH, type RollupServiceOptions as gI, RollupService as gJ, type RollupSchedulerOptions as gK, RollupScheduler as gL, applyDefaultValues as gM, checkPermission as gN, getPolicy as gO, buildPolicyContext as gP, checkRecordAccess as gQ, checkRecordModifyOrThrow as gR, checkRecordDeleteOrThrow as gS, checkSharedObjectWriteAccess as gT, computeLabel as gU, type LabelResolver as gV, enrichWithFormulas as gW, enrichRecordsWithFormulas as gX, createContextForCreate as gY, createContextForUpdate as gZ, createContextForDelete as g_, type WorkflowAccessGrantsRepository as ga, type WorkflowInstancesRepository as gb, type WorkflowInvitationsRepository as gc, type WorkflowsRepository as gd, BaseService as ge, BaseRepository as gf, type SchemaContextAware as gg, SchemaContextAwareRepository as gh, type CreateCustomObjectInput as gi, type AddAttributeInput as gj, type UpdateObjectInput as gk, type ObjectSchemaServiceOptions as gl, ObjectSchemaService as gm, type RecordServiceOptions as gn, RecordService as go, type RecordQueryServiceOptions as gp, type QueryOptions as gq, type SearchQueryOptions as gr, type QueryResult as gs, RecordQueryService as gt, type RelationValidationResult as gu, type RelationValidationError as gv, type RelationOption as gw, type RelationOptionsResponse as gx, type GetRelationOptionsParams as gy, type RelationServiceOptions as gz, type DirectTableTab as h, type StorageUploadResult as h$, recalculateParentRollups as h0, type RollupCascadeContext as h1, type DocumentProcessingHookOptions as h2, DocumentProcessingHook as h3, GrantNotFoundError as h4, GrantExpiredError as h5, GrantRevokedError as h6, TokenRevokedError as h7, type GrantServiceConfig as h8, type CreateGrantResult as h9, type DocumentProcessingConfig as hA, DocumentProcessingService as hB, type RenderDocumentInput as hC, type DocumentRendererOptions as hD, type RenderDocumentResult as hE, DocumentRenderError as hF, StorageDownloadNotSupportedError as hG, DocumentRendererService as hH, DocumentTemplateService as hI, type RecordDocumentsResult as hJ, type CreateRecordDocumentInput as hK, type CreateRecordDocumentResult as hL, type DocumentServiceOptions as hM, DocumentService as hN, type FileServiceOptions as hO, FileService as hP, GeocodingService as hQ, GlobalSearchService as hR, type PermissionServiceOptions as hS, PermissionService as hT, type CreateViewInput as hU, type UpdateViewInput as hV, type GetViewsOptions as hW, type GetViewOptions as hX, ViewService as hY, type FileContent as hZ, type StorageUploadInput as h_, WorkflowAccessGrantService as ha, type StartWorkflowInput as hb, type ResumeWorkflowInput as hc, type WorkflowInstanceServiceOptions as hd, WorkflowInstanceService as he, type InvitationServiceConfig as hf, InvitationNotFoundError as hg, InvitationExpiredError as hh, InvitationAlreadyAcceptedError as hi, InvitationRevokedError as hj, WorkflowInvitationService as hk, WorkflowRelationService as hl, type CreateWorkflowInput as hm, type UpdateWorkflowInput as hn, type WorkflowServiceOptions as ho, WorkflowService as hp, type UserValidationResult as hq, type UserValidationError as hr, UserService as hs, type UserProfileServiceOptions as ht, UserProfileService as hu, AuditService as hv, buildAuditChanges as hw, DocumentGenerationTemplateNotFoundError as hx, DocumentGenerationNotConfiguredError as hy, DocumentGenerationService as hz, type WorkflowConfig as i, getViewSeedPreview as i$, type SignedUrlOptions as i0, type StorageAdapter as i1, type UploadFileInput as i2, type SyncResult as i3, type SyncOptions as i4, syncNativeObjects as i5, verifyNativeObjectsSync as i6, getSyncPreview as i7, type FullSyncResult as i8, type FullSyncOptions as i9, type DBView as iA, type CreateDBView as iB, type UpdateDBView as iC, type UpsertDBView as iD, type DBViewOverlay as iE, type CreateDBViewOverlay as iF, type UpdateDBViewOverlay as iG, type DBWorkflow as iH, type CreateDBWorkflow as iI, type UpdateDBWorkflow as iJ, type DBWorkflowInstance as iK, type CreateDBWorkflowInstance as iL, type UpdateDBWorkflowInstance as iM, type DBWorkflowInvitation as iN, type CreateDBWorkflowInvitation as iO, type UpdateDBWorkflowInvitation as iP, type DBWorkflowAccessGrant as iQ, type CreateDBWorkflowAccessGrant as iR, type UpdateDBWorkflowAccessGrant as iS, type OperationResult as iT, type ViewSyncResult as iU, type ViewSyncLogger as iV, type ViewSyncOptions as iW, seedRegistryViews as iX, syncNativeViews as iY, verifyRegistryViewsSeeded as iZ, verifyNativeViewsSync as i_, syncAll as ia, DEFAULT_LABEL_FALLBACK as ib, renderLabelExpression as ic, isLabelExpression as id, extractAttributeNames as ie, enrichValuesForDisplay as ig, enrichValuesWithSelectLabels as ih, extractRelationIds as ii, type RelationLabelResolver as ij, computeLabelWithRelations as ik, type DBObject as il, type CreateDBObject as im, type UpdateDBObject as io, type UpsertDBObject as ip, type DBAttribute as iq, type CreateDBAttribute as ir, type UpdateDBAttribute as is, type UpsertDBAttribute as it, type CreateObjectRecord as iu, type ListOptions as iv, type SearchOptions as iw, type GlobalSearchOptions as ix, type GlobalSearchResultItem as iy, type FileListOptions as iz, type SlotMode as j, getViewSyncPreview as j0, type ConditionRule as k, type WorkflowNode as l, type WorkflowDefinition as m, type FlowRow as n, type ViewDefinition as o, type DocumentTemplate as p, type OcrAdapter as q, type OcrInput as r, type OcrOptions as s, type OcrResult as t, type OcrPage as u, type OcrTextBlock as v, type SignatureAdapter as w, type CreateSignatureInput as x, type SignerRequest as y, type SignaturePosition as z };
|