@stndrds/schema 1.0.0-alpha.185 → 1.0.0-alpha.187
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/{filters-qNc-JmQI.d.ts → filters-DVBn5tov.d.ts} +81 -39
- package/dist/{filters-DVbxM2W4.d.mts → filters-HDG4kLoo.d.mts} +81 -39
- package/dist/{helpers-g5uHrKfE.d.mts → helpers-BjuFhbQQ.d.mts} +2 -2
- package/dist/{helpers-D-_4FAcR.d.ts → helpers-CSuoa3kj.d.ts} +2 -2
- package/dist/index.d.mts +185 -56
- package/dist/index.d.ts +185 -56
- package/dist/index.js +229 -105
- package/dist/index.mjs +215 -99
- package/dist/{types-CQTltaH_.d.ts → types-Bdlhgrf7.d.ts} +1 -1
- package/dist/{types-BTrwWar6.d.mts → types-C5DittlR.d.mts} +1 -1
- package/dist/validation/all.d.mts +3 -3
- package/dist/validation/all.d.ts +3 -3
- package/dist/validation/all.js +8 -8
- package/dist/validation/all.mjs +2 -2
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/file.d.mts +2 -2
- package/dist/validation/complex/file.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/core/index.d.mts +3 -3
- package/dist/validation/core/index.d.ts +3 -3
- package/dist/validation/object/index.d.mts +3 -3
- package/dist/validation/object/index.d.ts +3 -3
- package/dist/validation/object/index.js +14 -14
- package/dist/validation/object/index.mjs +2 -2
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/rating.d.mts +2 -2
- package/dist/validation/primitives/rating.d.ts +2 -2
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/package.json +2 -2
- package/dist/{chunk-HG6EF4XD.js → chunk-64R5X3DF.js} +1 -1
- package/dist/{chunk-M7ZNKBOE.mjs → chunk-6JEQE4IP.mjs} +1 -1
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { IconName, CountryIso3, CurrencyCode, ColorId, MimeType } from '@stndrds/constants';
|
|
2
2
|
import { Uuid } from './utils.js';
|
|
3
3
|
|
|
4
|
+
interface DocumentLayout {
|
|
5
|
+
/** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
|
|
6
|
+
variants?: Record<string, DocumentLayoutVariant>;
|
|
7
|
+
/** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
|
|
8
|
+
presets?: FolderPreset[];
|
|
9
|
+
}
|
|
10
|
+
interface DocumentLayoutVariant {
|
|
11
|
+
/** Display title for the auto-created sub-folder. */
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface FolderPreset {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon?: IconName;
|
|
19
|
+
description?: string;
|
|
20
|
+
structure: PresetNode[];
|
|
21
|
+
}
|
|
22
|
+
interface PresetNode {
|
|
23
|
+
title: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
children?: PresetNode[];
|
|
26
|
+
}
|
|
27
|
+
/** Max depth allowed for preset.structure to keep instantiation predictable. */
|
|
28
|
+
declare const MAX_PRESET_DEPTH = 5;
|
|
29
|
+
|
|
4
30
|
/**
|
|
5
31
|
* Type of view - determines the config structure
|
|
6
32
|
*/
|
|
@@ -422,7 +448,6 @@ declare function isFieldGroup(group: Group): group is FieldGroup;
|
|
|
422
448
|
*/
|
|
423
449
|
declare function isRelationGroup(group: Group): group is RelationGroup;
|
|
424
450
|
|
|
425
|
-
type TransformSource = "system" | "runtime" | "rollback" | "seed";
|
|
426
451
|
type BuiltInTransform = "toString" | "toNumber" | "toDate" | "toBoolean" | "toISOString";
|
|
427
452
|
type SchemaOperation = {
|
|
428
453
|
type: "add_attribute";
|
|
@@ -472,19 +497,6 @@ type ViewOperation = {
|
|
|
472
497
|
interface MigrationDefinition {
|
|
473
498
|
version: number;
|
|
474
499
|
operations: SchemaOperation[];
|
|
475
|
-
reverse_operations: SchemaOperation[];
|
|
476
|
-
}
|
|
477
|
-
interface SchemaTransform {
|
|
478
|
-
id: string;
|
|
479
|
-
tenantId: string;
|
|
480
|
-
objectId: string;
|
|
481
|
-
fromVersion: number;
|
|
482
|
-
toVersion: number;
|
|
483
|
-
operations: SchemaOperation[];
|
|
484
|
-
reverseOperations: SchemaOperation[];
|
|
485
|
-
source: TransformSource;
|
|
486
|
-
appliedAt: Date;
|
|
487
|
-
fullyMigrated: boolean;
|
|
488
500
|
}
|
|
489
501
|
interface ViewTransform {
|
|
490
502
|
id: string;
|
|
@@ -493,8 +505,6 @@ interface ViewTransform {
|
|
|
493
505
|
fromVersion: number;
|
|
494
506
|
toVersion: number;
|
|
495
507
|
operations: ViewOperation[];
|
|
496
|
-
reverseOperations: ViewOperation[];
|
|
497
|
-
source: TransformSource;
|
|
498
508
|
appliedAt: Date;
|
|
499
509
|
}
|
|
500
510
|
interface MigrationError {
|
|
@@ -552,6 +562,8 @@ interface ObjectDefinition {
|
|
|
552
562
|
schema_version: number;
|
|
553
563
|
/** Ordered list of migrations applied to this object's schema */
|
|
554
564
|
migrations: MigrationDefinition[];
|
|
565
|
+
/** Smart-folder layout convention for documents attached to records of this object. */
|
|
566
|
+
documentLayout?: DocumentLayout;
|
|
555
567
|
}
|
|
556
568
|
/**
|
|
557
569
|
* Links an attribute to an object
|
|
@@ -608,6 +620,11 @@ interface ObjectRecord extends Timestamps {
|
|
|
608
620
|
* Queries exclude soft-deleted records by default.
|
|
609
621
|
*/
|
|
610
622
|
deletedAt?: Date | null;
|
|
623
|
+
/**
|
|
624
|
+
* Actor ID who soft-deleted this record.
|
|
625
|
+
* Set alongside deletedAt when a record is soft-deleted.
|
|
626
|
+
*/
|
|
627
|
+
deletedBy?: string | null;
|
|
611
628
|
/**
|
|
612
629
|
* Actor ID who created this record.
|
|
613
630
|
* Automatically set by RecordService when actorId is configured.
|
|
@@ -622,11 +639,6 @@ interface ObjectRecord extends Timestamps {
|
|
|
622
639
|
lastUpdatedBy?: string;
|
|
623
640
|
/** Schema version at the time this record was last migrated */
|
|
624
641
|
schemaVersion: number;
|
|
625
|
-
/**
|
|
626
|
-
* Values archived during attribute removal or type changes.
|
|
627
|
-
* Retained according to the retention policy before permanent deletion.
|
|
628
|
-
*/
|
|
629
|
-
archivedValues?: Record<string, unknown>;
|
|
630
642
|
}
|
|
631
643
|
/**
|
|
632
644
|
* System-managed field names on ObjectRecord.
|
|
@@ -664,20 +676,34 @@ type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
|
664
676
|
* }
|
|
665
677
|
* ```
|
|
666
678
|
*/
|
|
667
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt", "
|
|
679
|
+
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion"];
|
|
668
680
|
/**
|
|
669
681
|
* Type for reserved attribute names
|
|
670
682
|
*/
|
|
671
683
|
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
672
684
|
|
|
685
|
+
type DocumentKind = "file" | "folder";
|
|
673
686
|
interface Document extends Timestamps {
|
|
674
687
|
id: Uuid;
|
|
675
688
|
tenantId: Uuid;
|
|
676
689
|
title: string;
|
|
690
|
+
kind: DocumentKind;
|
|
691
|
+
parentId?: Uuid | null;
|
|
692
|
+
description?: string;
|
|
677
693
|
contentHash?: string;
|
|
678
694
|
createdBy?: Uuid;
|
|
679
695
|
updatedBy?: Uuid;
|
|
680
696
|
deletedAt?: Date | null;
|
|
697
|
+
/**
|
|
698
|
+
* Fractional ordering position within `(tenantId, parentId)`. Lower values
|
|
699
|
+
* sort first. New rows default to `max(siblings) + 1024` so reorderings can
|
|
700
|
+
* insert between neighbours without renumbering. The server may rebalance
|
|
701
|
+
* positions in the background to keep the spacing bounded.
|
|
702
|
+
*/
|
|
703
|
+
position: number;
|
|
704
|
+
}
|
|
705
|
+
interface DocumentWithSubCount extends Document {
|
|
706
|
+
subCount: number | null;
|
|
681
707
|
}
|
|
682
708
|
/**
|
|
683
709
|
* Configuration for a single named slot on a DocumentAttribute.
|
|
@@ -732,9 +758,34 @@ type ProcessingJobType = "ocr";
|
|
|
732
758
|
type ProcessingJobStatus = "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
733
759
|
interface CreateDocument {
|
|
734
760
|
title: string;
|
|
761
|
+
kind?: DocumentKind;
|
|
762
|
+
parentId?: Uuid | null;
|
|
763
|
+
description?: string;
|
|
764
|
+
position?: number;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Reference to a record attribute that should atomically attach a freshly
|
|
768
|
+
* created Document. Passed alongside `CreateDocument` to make creation
|
|
769
|
+
* link-aware end-to-end (client → REST → service → repo).
|
|
770
|
+
*
|
|
771
|
+
* The server requires this — orphan Documents are not creatable through the
|
|
772
|
+
* REST API.
|
|
773
|
+
*/
|
|
774
|
+
interface CreateDocumentLink {
|
|
775
|
+
objectName: string;
|
|
776
|
+
sourceRecordId: string;
|
|
777
|
+
attributeName: string;
|
|
778
|
+
/**
|
|
779
|
+
* Optional qualifyWith properties on the record→Document edge. Currently
|
|
780
|
+
* accepted by the controller DTO but silently ignored by the service (see
|
|
781
|
+
* `DocumentService.createDocument` — there's a TODO to support this).
|
|
782
|
+
*/
|
|
783
|
+
properties?: Record<string, unknown>;
|
|
735
784
|
}
|
|
736
785
|
interface UpdateDocument {
|
|
737
786
|
title?: string;
|
|
787
|
+
parentId?: Uuid | null;
|
|
788
|
+
position?: number;
|
|
738
789
|
}
|
|
739
790
|
interface CreateDocumentSlot {
|
|
740
791
|
documentId: Uuid;
|
|
@@ -1395,30 +1446,21 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
1395
1446
|
* provides structured document handling with multi-file support and
|
|
1396
1447
|
* optional agent-compatible processing (for example OCR).
|
|
1397
1448
|
*
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1401
|
-
* .autoProcess()
|
|
1402
|
-
* .required()
|
|
1403
|
-
* ```
|
|
1449
|
+
* Every document attribute is multi by construction — the underlying
|
|
1450
|
+
* storage (documents + document_slots + files) supports 1 Doc → N slot
|
|
1451
|
+
* files uniformly. Single-value file fields use `file()` instead.
|
|
1404
1452
|
*
|
|
1405
|
-
* @example
|
|
1453
|
+
* @example
|
|
1406
1454
|
* ```typescript
|
|
1407
1455
|
* document({ name: "contracts", label: "Contrats" })
|
|
1408
|
-
* .
|
|
1456
|
+
* .autoProcess()
|
|
1409
1457
|
* .maxDocuments(10)
|
|
1410
1458
|
* ```
|
|
1411
1459
|
*/
|
|
1412
|
-
interface DocumentAttribute extends BaseAttribute<string
|
|
1460
|
+
interface DocumentAttribute extends BaseAttribute<string[]> {
|
|
1413
1461
|
type: "document";
|
|
1414
1462
|
/**
|
|
1415
|
-
*
|
|
1416
|
-
* If true, value is string[] (document IDs).
|
|
1417
|
-
* If false/undefined, value is string (single document ID).
|
|
1418
|
-
*/
|
|
1419
|
-
multiple?: boolean;
|
|
1420
|
-
/**
|
|
1421
|
-
* Maximum number of documents when multiple: true.
|
|
1463
|
+
* Maximum number of documents.
|
|
1422
1464
|
*/
|
|
1423
1465
|
maxDocuments?: number;
|
|
1424
1466
|
/**
|
|
@@ -1585,4 +1627,4 @@ declare function isNoValueOperator(operator: FilterOperator): operator is NoValu
|
|
|
1585
1627
|
*/
|
|
1586
1628
|
declare function getRollupFilterOperators(attr: RollupAttribute): readonly FilterOperator[];
|
|
1587
1629
|
|
|
1588
|
-
export { type
|
|
1630
|
+
export { type FieldGroup as $, type Attribute as A, type Option as B, type CurrencyAttribute as C, type DateAttribute as D, type FormulaReturnType as E, type FileAttribute as F, type BilateralConfig as G, type RelationTarget as H, type RichtextFeature as I, type RollupFunction as J, type MigrationDefinition as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type DetailViewConfig as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAreaAttribute as T, type UserAttribute as U, type ViewType as V, type DetailViewDefinition as W, type DetailViewLayout as X, type SidePanelConfig as Y, type Field as Z, type AttributeGroupField as _, type RichtextAttribute as a, type ProcessingJobStatus as a$, type RelationGroup as a0, type Group as a1, type TableTab as a2, type CreateMode as a3, type Tab as a4, type ListViewConfig as a5, type ListViewDefinition as a6, type FlagValueType as a7, type FeatureFlagDefinition as a8, type FlagLevel as a9, type DocumentSlot as aA, type DocumentWithSlots as aB, type DocumentWithSubCount as aC, type DocumentsTab as aD, type ExtendedFilterRule as aE, type FeatureFlagsConfig as aF, type FilterCombinator as aG, type FilterGroup as aH, type FlagOverride as aI, type FolderPreset as aJ, type FormDensity as aK, type FormTab as aL, type FormsTab as aM, type InverseSource as aN, type ListViewLayout as aO, MAX_PRESET_DEPTH as aP, type MigrationError as aQ, NO_VALUE_OPERATORS as aR, type NoValueOperator as aS, type NumberUnit as aT, OPERATORS_BY_TYPE as aU, type ObjectAttribute as aV, type ObjectRecord as aW, type OptionPropertyAttribute as aX, type PhoneFilterValue as aY, type PresetNode as aZ, type ProcessingJob as a_, type FeatureFlagsRepository as aa, type StaticFlagDefault as ab, type ResolvedFlag as ac, type ViewDefinition as ad, type ListViewTab as ae, type FilterOperator as af, type FilterValue as ag, type FilterRule as ah, type ActivityTab as ai, type AdvancedFilterState as aj, type AttributeGroup as ak, type BaseAttribute as al, type BuiltInTransform as am, type CreateDocument as an, type CreateDocumentLink as ao, type CreateDocumentSlot as ap, type CreateProcessingJob as aq, type CurrencyFilterValue as ar, type CustomTab as as, DEFAULT_DOCUMENT_SLOT as at, type DateFormat as au, type DateValue as av, type Document as aw, type DocumentKind as ax, type DocumentLayoutVariant as ay, type DocumentListOptions as az, type MultiselectAttribute as b, type ProcessingJobType as b0, type PropertyAttribute as b1, type PropertyType as b2, type QueryState as b3, RELATION_TARGET_ANY as b4, RESERVED_ATTRIBUTE_NAMES as b5, type RecordDocuments as b6, type RelationSource as b7, type RelativeDateValue as b8, type ReservedAttributeName as b9, type RichtextTab as ba, SYSTEM_FIELD_NAMES as bb, type SlotStatus as bc, type SortDirection as bd, type StatusGroup as be, type SystemFieldName as bf, type TabType as bg, type TableSource as bh, type UpdateDocument as bi, type UpdateDocumentSlot as bj, type UpdateProcessingJob as bk, type ViewOperation as bl, type ViewOverlay as bm, type ViewTransform as bn, getRollupFilterOperators as bo, hasOptions as bp, inferInverseCardinality as bq, isAttributeSortable as br, isBilateralRelation as bs, isDetailView as bt, isFieldGroup as bu, isListView as bv, isNoValueOperator as bw, isRelationGroup as bx, isUniversalRelation as by, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type RatingAttribute as h, type TextAttribute as i, type CompletionStatus as j, type SortRule as k, type FilterState as l, type Timestamps as m, type AttributeType as n, type DocumentLayout as o, type ViewConfig as p, type ConfigOverrides as q, type SchemaOperation as r, type LocationGranularity as s, type Location as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type DocumentSlotConfig as x, type PropertySchema as y, type FeatureGate as z };
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { IconName, CountryIso3, CurrencyCode, ColorId, MimeType } from '@stndrds/constants';
|
|
2
2
|
import { Uuid } from './utils.mjs';
|
|
3
3
|
|
|
4
|
+
interface DocumentLayout {
|
|
5
|
+
/** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
|
|
6
|
+
variants?: Record<string, DocumentLayoutVariant>;
|
|
7
|
+
/** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
|
|
8
|
+
presets?: FolderPreset[];
|
|
9
|
+
}
|
|
10
|
+
interface DocumentLayoutVariant {
|
|
11
|
+
/** Display title for the auto-created sub-folder. */
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface FolderPreset {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon?: IconName;
|
|
19
|
+
description?: string;
|
|
20
|
+
structure: PresetNode[];
|
|
21
|
+
}
|
|
22
|
+
interface PresetNode {
|
|
23
|
+
title: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
children?: PresetNode[];
|
|
26
|
+
}
|
|
27
|
+
/** Max depth allowed for preset.structure to keep instantiation predictable. */
|
|
28
|
+
declare const MAX_PRESET_DEPTH = 5;
|
|
29
|
+
|
|
4
30
|
/**
|
|
5
31
|
* Type of view - determines the config structure
|
|
6
32
|
*/
|
|
@@ -422,7 +448,6 @@ declare function isFieldGroup(group: Group): group is FieldGroup;
|
|
|
422
448
|
*/
|
|
423
449
|
declare function isRelationGroup(group: Group): group is RelationGroup;
|
|
424
450
|
|
|
425
|
-
type TransformSource = "system" | "runtime" | "rollback" | "seed";
|
|
426
451
|
type BuiltInTransform = "toString" | "toNumber" | "toDate" | "toBoolean" | "toISOString";
|
|
427
452
|
type SchemaOperation = {
|
|
428
453
|
type: "add_attribute";
|
|
@@ -472,19 +497,6 @@ type ViewOperation = {
|
|
|
472
497
|
interface MigrationDefinition {
|
|
473
498
|
version: number;
|
|
474
499
|
operations: SchemaOperation[];
|
|
475
|
-
reverse_operations: SchemaOperation[];
|
|
476
|
-
}
|
|
477
|
-
interface SchemaTransform {
|
|
478
|
-
id: string;
|
|
479
|
-
tenantId: string;
|
|
480
|
-
objectId: string;
|
|
481
|
-
fromVersion: number;
|
|
482
|
-
toVersion: number;
|
|
483
|
-
operations: SchemaOperation[];
|
|
484
|
-
reverseOperations: SchemaOperation[];
|
|
485
|
-
source: TransformSource;
|
|
486
|
-
appliedAt: Date;
|
|
487
|
-
fullyMigrated: boolean;
|
|
488
500
|
}
|
|
489
501
|
interface ViewTransform {
|
|
490
502
|
id: string;
|
|
@@ -493,8 +505,6 @@ interface ViewTransform {
|
|
|
493
505
|
fromVersion: number;
|
|
494
506
|
toVersion: number;
|
|
495
507
|
operations: ViewOperation[];
|
|
496
|
-
reverseOperations: ViewOperation[];
|
|
497
|
-
source: TransformSource;
|
|
498
508
|
appliedAt: Date;
|
|
499
509
|
}
|
|
500
510
|
interface MigrationError {
|
|
@@ -552,6 +562,8 @@ interface ObjectDefinition {
|
|
|
552
562
|
schema_version: number;
|
|
553
563
|
/** Ordered list of migrations applied to this object's schema */
|
|
554
564
|
migrations: MigrationDefinition[];
|
|
565
|
+
/** Smart-folder layout convention for documents attached to records of this object. */
|
|
566
|
+
documentLayout?: DocumentLayout;
|
|
555
567
|
}
|
|
556
568
|
/**
|
|
557
569
|
* Links an attribute to an object
|
|
@@ -608,6 +620,11 @@ interface ObjectRecord extends Timestamps {
|
|
|
608
620
|
* Queries exclude soft-deleted records by default.
|
|
609
621
|
*/
|
|
610
622
|
deletedAt?: Date | null;
|
|
623
|
+
/**
|
|
624
|
+
* Actor ID who soft-deleted this record.
|
|
625
|
+
* Set alongside deletedAt when a record is soft-deleted.
|
|
626
|
+
*/
|
|
627
|
+
deletedBy?: string | null;
|
|
611
628
|
/**
|
|
612
629
|
* Actor ID who created this record.
|
|
613
630
|
* Automatically set by RecordService when actorId is configured.
|
|
@@ -622,11 +639,6 @@ interface ObjectRecord extends Timestamps {
|
|
|
622
639
|
lastUpdatedBy?: string;
|
|
623
640
|
/** Schema version at the time this record was last migrated */
|
|
624
641
|
schemaVersion: number;
|
|
625
|
-
/**
|
|
626
|
-
* Values archived during attribute removal or type changes.
|
|
627
|
-
* Retained according to the retention policy before permanent deletion.
|
|
628
|
-
*/
|
|
629
|
-
archivedValues?: Record<string, unknown>;
|
|
630
642
|
}
|
|
631
643
|
/**
|
|
632
644
|
* System-managed field names on ObjectRecord.
|
|
@@ -664,20 +676,34 @@ type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
|
664
676
|
* }
|
|
665
677
|
* ```
|
|
666
678
|
*/
|
|
667
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt", "
|
|
679
|
+
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion"];
|
|
668
680
|
/**
|
|
669
681
|
* Type for reserved attribute names
|
|
670
682
|
*/
|
|
671
683
|
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
672
684
|
|
|
685
|
+
type DocumentKind = "file" | "folder";
|
|
673
686
|
interface Document extends Timestamps {
|
|
674
687
|
id: Uuid;
|
|
675
688
|
tenantId: Uuid;
|
|
676
689
|
title: string;
|
|
690
|
+
kind: DocumentKind;
|
|
691
|
+
parentId?: Uuid | null;
|
|
692
|
+
description?: string;
|
|
677
693
|
contentHash?: string;
|
|
678
694
|
createdBy?: Uuid;
|
|
679
695
|
updatedBy?: Uuid;
|
|
680
696
|
deletedAt?: Date | null;
|
|
697
|
+
/**
|
|
698
|
+
* Fractional ordering position within `(tenantId, parentId)`. Lower values
|
|
699
|
+
* sort first. New rows default to `max(siblings) + 1024` so reorderings can
|
|
700
|
+
* insert between neighbours without renumbering. The server may rebalance
|
|
701
|
+
* positions in the background to keep the spacing bounded.
|
|
702
|
+
*/
|
|
703
|
+
position: number;
|
|
704
|
+
}
|
|
705
|
+
interface DocumentWithSubCount extends Document {
|
|
706
|
+
subCount: number | null;
|
|
681
707
|
}
|
|
682
708
|
/**
|
|
683
709
|
* Configuration for a single named slot on a DocumentAttribute.
|
|
@@ -732,9 +758,34 @@ type ProcessingJobType = "ocr";
|
|
|
732
758
|
type ProcessingJobStatus = "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
733
759
|
interface CreateDocument {
|
|
734
760
|
title: string;
|
|
761
|
+
kind?: DocumentKind;
|
|
762
|
+
parentId?: Uuid | null;
|
|
763
|
+
description?: string;
|
|
764
|
+
position?: number;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Reference to a record attribute that should atomically attach a freshly
|
|
768
|
+
* created Document. Passed alongside `CreateDocument` to make creation
|
|
769
|
+
* link-aware end-to-end (client → REST → service → repo).
|
|
770
|
+
*
|
|
771
|
+
* The server requires this — orphan Documents are not creatable through the
|
|
772
|
+
* REST API.
|
|
773
|
+
*/
|
|
774
|
+
interface CreateDocumentLink {
|
|
775
|
+
objectName: string;
|
|
776
|
+
sourceRecordId: string;
|
|
777
|
+
attributeName: string;
|
|
778
|
+
/**
|
|
779
|
+
* Optional qualifyWith properties on the record→Document edge. Currently
|
|
780
|
+
* accepted by the controller DTO but silently ignored by the service (see
|
|
781
|
+
* `DocumentService.createDocument` — there's a TODO to support this).
|
|
782
|
+
*/
|
|
783
|
+
properties?: Record<string, unknown>;
|
|
735
784
|
}
|
|
736
785
|
interface UpdateDocument {
|
|
737
786
|
title?: string;
|
|
787
|
+
parentId?: Uuid | null;
|
|
788
|
+
position?: number;
|
|
738
789
|
}
|
|
739
790
|
interface CreateDocumentSlot {
|
|
740
791
|
documentId: Uuid;
|
|
@@ -1395,30 +1446,21 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
1395
1446
|
* provides structured document handling with multi-file support and
|
|
1396
1447
|
* optional agent-compatible processing (for example OCR).
|
|
1397
1448
|
*
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1401
|
-
* .autoProcess()
|
|
1402
|
-
* .required()
|
|
1403
|
-
* ```
|
|
1449
|
+
* Every document attribute is multi by construction — the underlying
|
|
1450
|
+
* storage (documents + document_slots + files) supports 1 Doc → N slot
|
|
1451
|
+
* files uniformly. Single-value file fields use `file()` instead.
|
|
1404
1452
|
*
|
|
1405
|
-
* @example
|
|
1453
|
+
* @example
|
|
1406
1454
|
* ```typescript
|
|
1407
1455
|
* document({ name: "contracts", label: "Contrats" })
|
|
1408
|
-
* .
|
|
1456
|
+
* .autoProcess()
|
|
1409
1457
|
* .maxDocuments(10)
|
|
1410
1458
|
* ```
|
|
1411
1459
|
*/
|
|
1412
|
-
interface DocumentAttribute extends BaseAttribute<string
|
|
1460
|
+
interface DocumentAttribute extends BaseAttribute<string[]> {
|
|
1413
1461
|
type: "document";
|
|
1414
1462
|
/**
|
|
1415
|
-
*
|
|
1416
|
-
* If true, value is string[] (document IDs).
|
|
1417
|
-
* If false/undefined, value is string (single document ID).
|
|
1418
|
-
*/
|
|
1419
|
-
multiple?: boolean;
|
|
1420
|
-
/**
|
|
1421
|
-
* Maximum number of documents when multiple: true.
|
|
1463
|
+
* Maximum number of documents.
|
|
1422
1464
|
*/
|
|
1423
1465
|
maxDocuments?: number;
|
|
1424
1466
|
/**
|
|
@@ -1585,4 +1627,4 @@ declare function isNoValueOperator(operator: FilterOperator): operator is NoValu
|
|
|
1585
1627
|
*/
|
|
1586
1628
|
declare function getRollupFilterOperators(attr: RollupAttribute): readonly FilterOperator[];
|
|
1587
1629
|
|
|
1588
|
-
export { type
|
|
1630
|
+
export { type FieldGroup as $, type Attribute as A, type Option as B, type CurrencyAttribute as C, type DateAttribute as D, type FormulaReturnType as E, type FileAttribute as F, type BilateralConfig as G, type RelationTarget as H, type RichtextFeature as I, type RollupFunction as J, type MigrationDefinition as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type DetailViewConfig as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAreaAttribute as T, type UserAttribute as U, type ViewType as V, type DetailViewDefinition as W, type DetailViewLayout as X, type SidePanelConfig as Y, type Field as Z, type AttributeGroupField as _, type RichtextAttribute as a, type ProcessingJobStatus as a$, type RelationGroup as a0, type Group as a1, type TableTab as a2, type CreateMode as a3, type Tab as a4, type ListViewConfig as a5, type ListViewDefinition as a6, type FlagValueType as a7, type FeatureFlagDefinition as a8, type FlagLevel as a9, type DocumentSlot as aA, type DocumentWithSlots as aB, type DocumentWithSubCount as aC, type DocumentsTab as aD, type ExtendedFilterRule as aE, type FeatureFlagsConfig as aF, type FilterCombinator as aG, type FilterGroup as aH, type FlagOverride as aI, type FolderPreset as aJ, type FormDensity as aK, type FormTab as aL, type FormsTab as aM, type InverseSource as aN, type ListViewLayout as aO, MAX_PRESET_DEPTH as aP, type MigrationError as aQ, NO_VALUE_OPERATORS as aR, type NoValueOperator as aS, type NumberUnit as aT, OPERATORS_BY_TYPE as aU, type ObjectAttribute as aV, type ObjectRecord as aW, type OptionPropertyAttribute as aX, type PhoneFilterValue as aY, type PresetNode as aZ, type ProcessingJob as a_, type FeatureFlagsRepository as aa, type StaticFlagDefault as ab, type ResolvedFlag as ac, type ViewDefinition as ad, type ListViewTab as ae, type FilterOperator as af, type FilterValue as ag, type FilterRule as ah, type ActivityTab as ai, type AdvancedFilterState as aj, type AttributeGroup as ak, type BaseAttribute as al, type BuiltInTransform as am, type CreateDocument as an, type CreateDocumentLink as ao, type CreateDocumentSlot as ap, type CreateProcessingJob as aq, type CurrencyFilterValue as ar, type CustomTab as as, DEFAULT_DOCUMENT_SLOT as at, type DateFormat as au, type DateValue as av, type Document as aw, type DocumentKind as ax, type DocumentLayoutVariant as ay, type DocumentListOptions as az, type MultiselectAttribute as b, type ProcessingJobType as b0, type PropertyAttribute as b1, type PropertyType as b2, type QueryState as b3, RELATION_TARGET_ANY as b4, RESERVED_ATTRIBUTE_NAMES as b5, type RecordDocuments as b6, type RelationSource as b7, type RelativeDateValue as b8, type ReservedAttributeName as b9, type RichtextTab as ba, SYSTEM_FIELD_NAMES as bb, type SlotStatus as bc, type SortDirection as bd, type StatusGroup as be, type SystemFieldName as bf, type TabType as bg, type TableSource as bh, type UpdateDocument as bi, type UpdateDocumentSlot as bj, type UpdateProcessingJob as bk, type ViewOperation as bl, type ViewOverlay as bm, type ViewTransform as bn, getRollupFilterOperators as bo, hasOptions as bp, inferInverseCardinality as bq, isAttributeSortable as br, isBilateralRelation as bs, isDetailView as bt, isFieldGroup as bu, isListView as bv, isNoValueOperator as bw, isRelationGroup as bx, isUniversalRelation as by, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type RatingAttribute as h, type TextAttribute as i, type CompletionStatus as j, type SortRule as k, type FilterState as l, type Timestamps as m, type AttributeType as n, type DocumentLayout as o, type ViewConfig as p, type ConfigOverrides as q, type SchemaOperation as r, type LocationGranularity as s, type Location as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type DocumentSlotConfig as x, type PropertySchema as y, type FeatureGate as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { A as Attribute, O as ObjectDefinition, j as CompletionStatus } from './filters-
|
|
3
|
-
import { V as ValidationMessages, a as ValidationResult } from './types-
|
|
2
|
+
import { A as Attribute, O as ObjectDefinition, j as CompletionStatus } from './filters-HDG4kLoo.mjs';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-C5DittlR.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a Zod schema for any attribute type.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { A as Attribute, O as ObjectDefinition, j as CompletionStatus } from './filters-
|
|
3
|
-
import { V as ValidationMessages, a as ValidationResult } from './types-
|
|
2
|
+
import { A as Attribute, O as ObjectDefinition, j as CompletionStatus } from './filters-DVBn5tov.js';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-Bdlhgrf7.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a Zod schema for any attribute type.
|