@treeseed/sdk 0.13.0-rc.123 → 0.13.0-rc.125
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/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +400 -400
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +5 -9
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +12 -12
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +112 -112
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +6 -0
- package/dist/agent-capacity/validation/agent-definition-schema.js +1 -0
- package/dist/content/validation/agent-operational-content-schemas.d.ts +24 -24
- package/dist/content/validation/auxiliary-content-schemas.d.ts +8 -8
- package/dist/content/validation/content-model-schemas.d.ts +990 -968
- package/dist/content/validation/content-model-schemas.js +1 -0
- package/dist/content/validation/portable-content-data.d.ts +54 -52
- package/dist/content/validation/schema-constraints.d.ts +2 -0
- package/dist/content/validation/schema-constraints.js +24 -3
- package/dist/deployment/schemas.d.ts +96 -96
- package/dist/operator-contracts/canonical-command-tree.js +2 -1
- package/dist/operator-contracts/catalog/admin-account-team-operations.js +1 -1
- package/dist/operator-contracts/catalog/inbox-operations.js +1 -1
- package/dist/operator-contracts/catalog/knowledge-share-operations.js +3 -3
- package/dist/operator-contracts/catalog/workdays/profile-operations.js +1 -1
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +4 -6
- package/dist/operator-contracts/control-plane-operation.js +2 -1
- package/dist/operator-contracts/control-plane-operations.js +50 -50
- package/dist/operator-contracts/operation-builder.js +1 -1
- package/dist/operator-contracts/workday-lifecycle.d.ts +10 -12
- package/dist/operator-contracts/workday-lifecycle.js +8 -13
- package/dist/treedx/types.d.ts +24 -24
- package/dist/types/agents/agent-activity-profile.d.ts +1 -0
- package/guarantees/verifiers/golden.verifiers.yaml +1 -1
- package/package.json +1 -1
- package/tests/acceptance/product/intent-runtime.ts +1 -1
|
@@ -126,6 +126,7 @@ const proposalSchema = conditionalFields(z.object({
|
|
|
126
126
|
id: identifier,
|
|
127
127
|
projectId: identifier,
|
|
128
128
|
title: nonEmpty,
|
|
129
|
+
groupIds: unique(identifiers).optional(),
|
|
129
130
|
request: nonEmpty,
|
|
130
131
|
summary: nonEmpty.optional(),
|
|
131
132
|
status: z.enum(["draft", "discussing", "ready", "decided", "withdrawn"]),
|
|
@@ -153,6 +153,7 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
153
153
|
parameters?: Record<string, unknown> | undefined;
|
|
154
154
|
} | undefined;
|
|
155
155
|
};
|
|
156
|
+
groupIds?: string[] | undefined;
|
|
156
157
|
} | {
|
|
157
158
|
status: string;
|
|
158
159
|
title: string;
|
|
@@ -227,6 +228,7 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
227
228
|
audience: string[];
|
|
228
229
|
title: string;
|
|
229
230
|
description: string;
|
|
231
|
+
groupIds: string[];
|
|
230
232
|
summary: string;
|
|
231
233
|
slug: string;
|
|
232
234
|
offer: {
|
|
@@ -237,7 +239,6 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
237
239
|
featured: boolean;
|
|
238
240
|
listingEnabled: boolean;
|
|
239
241
|
category: string;
|
|
240
|
-
groupIds: string[];
|
|
241
242
|
publisher: {
|
|
242
243
|
id: string;
|
|
243
244
|
name: string;
|
|
@@ -318,14 +319,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
318
319
|
maxLatencyMs?: number | undefined;
|
|
319
320
|
} | {
|
|
320
321
|
id: string;
|
|
321
|
-
format: "map" | "summary" | "list" | "brief" | "full" | "sources";
|
|
322
|
-
title: string;
|
|
323
|
-
description: string;
|
|
324
322
|
target: {
|
|
325
323
|
kind: "code" | "content" | "mixed" | "graph";
|
|
326
324
|
models?: string[] | undefined;
|
|
327
325
|
paths?: string[] | undefined;
|
|
328
326
|
};
|
|
327
|
+
format: "map" | "summary" | "list" | "brief" | "full" | "sources";
|
|
328
|
+
title: string;
|
|
329
|
+
description: string;
|
|
329
330
|
query: string;
|
|
330
331
|
revision: number;
|
|
331
332
|
purpose: string;
|
|
@@ -384,8 +385,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
384
385
|
id: string;
|
|
385
386
|
title: string;
|
|
386
387
|
description: string;
|
|
387
|
-
slug: string;
|
|
388
388
|
groupIds: string[];
|
|
389
|
+
slug: string;
|
|
389
390
|
parentTopicId?: string | undefined;
|
|
390
391
|
} | {
|
|
391
392
|
status: string;
|
|
@@ -432,46 +433,47 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
432
433
|
title: string;
|
|
433
434
|
request: string;
|
|
434
435
|
projectId: string;
|
|
436
|
+
groupIds?: string[] | undefined;
|
|
435
437
|
summary?: string | undefined;
|
|
436
438
|
evidenceRefs?: {
|
|
437
439
|
id: string;
|
|
438
440
|
model: string;
|
|
439
|
-
store: "
|
|
441
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
440
442
|
path?: string | undefined;
|
|
441
443
|
anchor?: string | undefined;
|
|
444
|
+
url?: string | undefined;
|
|
442
445
|
commit?: string | undefined;
|
|
443
446
|
repository?: string | undefined;
|
|
444
447
|
revision?: number | undefined;
|
|
445
448
|
digest?: string | undefined;
|
|
446
|
-
url?: string | undefined;
|
|
447
449
|
startLine?: number | undefined;
|
|
448
450
|
endLine?: number | undefined;
|
|
449
451
|
}[] | undefined;
|
|
450
452
|
objectiveRefs?: {
|
|
451
453
|
id: string;
|
|
452
454
|
model: string;
|
|
453
|
-
store: "
|
|
455
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
454
456
|
path?: string | undefined;
|
|
455
457
|
anchor?: string | undefined;
|
|
458
|
+
url?: string | undefined;
|
|
456
459
|
commit?: string | undefined;
|
|
457
460
|
repository?: string | undefined;
|
|
458
461
|
revision?: number | undefined;
|
|
459
462
|
digest?: string | undefined;
|
|
460
|
-
url?: string | undefined;
|
|
461
463
|
startLine?: number | undefined;
|
|
462
464
|
endLine?: number | undefined;
|
|
463
465
|
}[] | undefined;
|
|
464
466
|
discussionRef?: {
|
|
465
467
|
id: string;
|
|
466
468
|
model: string;
|
|
467
|
-
store: "
|
|
469
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
468
470
|
path?: string | undefined;
|
|
469
471
|
anchor?: string | undefined;
|
|
472
|
+
url?: string | undefined;
|
|
470
473
|
commit?: string | undefined;
|
|
471
474
|
repository?: string | undefined;
|
|
472
475
|
revision?: number | undefined;
|
|
473
476
|
digest?: string | undefined;
|
|
474
|
-
url?: string | undefined;
|
|
475
477
|
startLine?: number | undefined;
|
|
476
478
|
endLine?: number | undefined;
|
|
477
479
|
} | undefined;
|
|
@@ -480,7 +482,7 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
480
482
|
id: string;
|
|
481
483
|
objective: string;
|
|
482
484
|
agentClass: string;
|
|
483
|
-
review: "
|
|
485
|
+
review: "none" | "required";
|
|
484
486
|
dependsOn: string[];
|
|
485
487
|
activity: "acting";
|
|
486
488
|
acceptanceCriteria: string[];
|
|
@@ -502,14 +504,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
502
504
|
contextRefs?: {
|
|
503
505
|
id: string;
|
|
504
506
|
model: string;
|
|
505
|
-
store: "
|
|
507
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
506
508
|
path?: string | undefined;
|
|
507
509
|
anchor?: string | undefined;
|
|
510
|
+
url?: string | undefined;
|
|
508
511
|
commit?: string | undefined;
|
|
509
512
|
repository?: string | undefined;
|
|
510
513
|
revision?: number | undefined;
|
|
511
514
|
digest?: string | undefined;
|
|
512
|
-
url?: string | undefined;
|
|
513
515
|
startLine?: number | undefined;
|
|
514
516
|
endLine?: number | undefined;
|
|
515
517
|
}[] | undefined;
|
|
@@ -540,14 +542,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
540
542
|
subjectRefs: {
|
|
541
543
|
id: string;
|
|
542
544
|
model: string;
|
|
543
|
-
store: "
|
|
545
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
544
546
|
path?: string | undefined;
|
|
545
547
|
anchor?: string | undefined;
|
|
548
|
+
url?: string | undefined;
|
|
546
549
|
commit?: string | undefined;
|
|
547
550
|
repository?: string | undefined;
|
|
548
551
|
revision?: number | undefined;
|
|
549
552
|
digest?: string | undefined;
|
|
550
|
-
url?: string | undefined;
|
|
551
553
|
startLine?: number | undefined;
|
|
552
554
|
endLine?: number | undefined;
|
|
553
555
|
}[];
|
|
@@ -557,14 +559,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
557
559
|
from: {
|
|
558
560
|
id: string;
|
|
559
561
|
model: string;
|
|
560
|
-
store: "
|
|
562
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
561
563
|
path?: string | undefined;
|
|
562
564
|
anchor?: string | undefined;
|
|
565
|
+
url?: string | undefined;
|
|
563
566
|
commit?: string | undefined;
|
|
564
567
|
repository?: string | undefined;
|
|
565
568
|
revision?: number | undefined;
|
|
566
569
|
digest?: string | undefined;
|
|
567
|
-
url?: string | undefined;
|
|
568
570
|
startLine?: number | undefined;
|
|
569
571
|
endLine?: number | undefined;
|
|
570
572
|
} & {
|
|
@@ -573,14 +575,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
573
575
|
to: {
|
|
574
576
|
id: string;
|
|
575
577
|
model: string;
|
|
576
|
-
store: "
|
|
578
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
577
579
|
path?: string | undefined;
|
|
578
580
|
anchor?: string | undefined;
|
|
581
|
+
url?: string | undefined;
|
|
579
582
|
commit?: string | undefined;
|
|
580
583
|
repository?: string | undefined;
|
|
581
584
|
revision?: number | undefined;
|
|
582
585
|
digest?: string | undefined;
|
|
583
|
-
url?: string | undefined;
|
|
584
586
|
startLine?: number | undefined;
|
|
585
587
|
endLine?: number | undefined;
|
|
586
588
|
} & {
|
|
@@ -596,14 +598,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
596
598
|
subjectRef: {
|
|
597
599
|
id: string;
|
|
598
600
|
model: string;
|
|
599
|
-
store: "
|
|
601
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
600
602
|
path?: string | undefined;
|
|
601
603
|
anchor?: string | undefined;
|
|
604
|
+
url?: string | undefined;
|
|
602
605
|
commit?: string | undefined;
|
|
603
606
|
repository?: string | undefined;
|
|
604
607
|
revision?: number | undefined;
|
|
605
608
|
digest?: string | undefined;
|
|
606
|
-
url?: string | undefined;
|
|
607
609
|
startLine?: number | undefined;
|
|
608
610
|
endLine?: number | undefined;
|
|
609
611
|
};
|
|
@@ -613,14 +615,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
613
615
|
answerRefs?: {
|
|
614
616
|
id: string;
|
|
615
617
|
model: string;
|
|
616
|
-
store: "
|
|
618
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
617
619
|
path?: string | undefined;
|
|
618
620
|
anchor?: string | undefined;
|
|
621
|
+
url?: string | undefined;
|
|
619
622
|
commit?: string | undefined;
|
|
620
623
|
repository?: string | undefined;
|
|
621
624
|
revision?: number | undefined;
|
|
622
625
|
digest?: string | undefined;
|
|
623
|
-
url?: string | undefined;
|
|
624
626
|
startLine?: number | undefined;
|
|
625
627
|
endLine?: number | undefined;
|
|
626
628
|
}[] | undefined;
|
|
@@ -635,14 +637,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
635
637
|
evidenceRefs?: {
|
|
636
638
|
id: string;
|
|
637
639
|
model: string;
|
|
638
|
-
store: "
|
|
640
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
639
641
|
path?: string | undefined;
|
|
640
642
|
anchor?: string | undefined;
|
|
643
|
+
url?: string | undefined;
|
|
641
644
|
commit?: string | undefined;
|
|
642
645
|
repository?: string | undefined;
|
|
643
646
|
revision?: number | undefined;
|
|
644
647
|
digest?: string | undefined;
|
|
645
|
-
url?: string | undefined;
|
|
646
648
|
startLine?: number | undefined;
|
|
647
649
|
endLine?: number | undefined;
|
|
648
650
|
}[] | undefined;
|
|
@@ -654,28 +656,28 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
654
656
|
authorityRefs: {
|
|
655
657
|
id: string;
|
|
656
658
|
model: string;
|
|
657
|
-
store: "
|
|
659
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
658
660
|
path?: string | undefined;
|
|
659
661
|
anchor?: string | undefined;
|
|
662
|
+
url?: string | undefined;
|
|
660
663
|
commit?: string | undefined;
|
|
661
664
|
repository?: string | undefined;
|
|
662
665
|
revision?: number | undefined;
|
|
663
666
|
digest?: string | undefined;
|
|
664
|
-
url?: string | undefined;
|
|
665
667
|
startLine?: number | undefined;
|
|
666
668
|
endLine?: number | undefined;
|
|
667
669
|
}[];
|
|
668
670
|
subjectRef: {
|
|
669
671
|
id: string;
|
|
670
672
|
model: string;
|
|
671
|
-
store: "
|
|
673
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
672
674
|
path?: string | undefined;
|
|
673
675
|
anchor?: string | undefined;
|
|
676
|
+
url?: string | undefined;
|
|
674
677
|
commit?: string | undefined;
|
|
675
678
|
repository?: string | undefined;
|
|
676
679
|
revision?: number | undefined;
|
|
677
680
|
digest?: string | undefined;
|
|
678
|
-
url?: string | undefined;
|
|
679
681
|
startLine?: number | undefined;
|
|
680
682
|
endLine?: number | undefined;
|
|
681
683
|
};
|
|
@@ -685,14 +687,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
685
687
|
decidedByRefs: {
|
|
686
688
|
id: string;
|
|
687
689
|
model: string;
|
|
688
|
-
store: "
|
|
690
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
689
691
|
path?: string | undefined;
|
|
690
692
|
anchor?: string | undefined;
|
|
693
|
+
url?: string | undefined;
|
|
691
694
|
commit?: string | undefined;
|
|
692
695
|
repository?: string | undefined;
|
|
693
696
|
revision?: number | undefined;
|
|
694
697
|
digest?: string | undefined;
|
|
695
|
-
url?: string | undefined;
|
|
696
698
|
startLine?: number | undefined;
|
|
697
699
|
endLine?: number | undefined;
|
|
698
700
|
}[];
|
|
@@ -700,14 +702,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
700
702
|
findingRefs?: {
|
|
701
703
|
id: string;
|
|
702
704
|
model: string;
|
|
703
|
-
store: "
|
|
705
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
704
706
|
path?: string | undefined;
|
|
705
707
|
anchor?: string | undefined;
|
|
708
|
+
url?: string | undefined;
|
|
706
709
|
commit?: string | undefined;
|
|
707
710
|
repository?: string | undefined;
|
|
708
711
|
revision?: number | undefined;
|
|
709
712
|
digest?: string | undefined;
|
|
710
|
-
url?: string | undefined;
|
|
711
713
|
startLine?: number | undefined;
|
|
712
714
|
endLine?: number | undefined;
|
|
713
715
|
}[] | undefined;
|
|
@@ -715,14 +717,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
715
717
|
actorRef: {
|
|
716
718
|
id: string;
|
|
717
719
|
model: string;
|
|
718
|
-
store: "
|
|
720
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
719
721
|
path?: string | undefined;
|
|
720
722
|
anchor?: string | undefined;
|
|
723
|
+
url?: string | undefined;
|
|
721
724
|
commit?: string | undefined;
|
|
722
725
|
repository?: string | undefined;
|
|
723
726
|
revision?: number | undefined;
|
|
724
727
|
digest?: string | undefined;
|
|
725
|
-
url?: string | undefined;
|
|
726
728
|
startLine?: number | undefined;
|
|
727
729
|
endLine?: number | undefined;
|
|
728
730
|
};
|
|
@@ -763,20 +765,20 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
763
765
|
bookRef: {
|
|
764
766
|
id: string;
|
|
765
767
|
model: string;
|
|
766
|
-
store: "
|
|
768
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
767
769
|
path?: string | undefined;
|
|
768
770
|
anchor?: string | undefined;
|
|
771
|
+
url?: string | undefined;
|
|
769
772
|
commit?: string | undefined;
|
|
770
773
|
repository?: string | undefined;
|
|
771
774
|
revision?: number | undefined;
|
|
772
775
|
digest?: string | undefined;
|
|
773
|
-
url?: string | undefined;
|
|
774
776
|
startLine?: number | undefined;
|
|
775
777
|
endLine?: number | undefined;
|
|
776
778
|
};
|
|
777
779
|
description?: string | undefined;
|
|
778
|
-
summary?: string | undefined;
|
|
779
780
|
groupIds?: string[] | undefined;
|
|
781
|
+
summary?: string | undefined;
|
|
780
782
|
order?: number | undefined;
|
|
781
783
|
relatedBookIds?: string[] | undefined;
|
|
782
784
|
parentId?: string | undefined;
|
|
@@ -796,14 +798,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
796
798
|
relatedRefs?: {
|
|
797
799
|
id: string;
|
|
798
800
|
model: string;
|
|
799
|
-
store: "
|
|
801
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
800
802
|
path?: string | undefined;
|
|
801
803
|
anchor?: string | undefined;
|
|
804
|
+
url?: string | undefined;
|
|
802
805
|
commit?: string | undefined;
|
|
803
806
|
repository?: string | undefined;
|
|
804
807
|
revision?: number | undefined;
|
|
805
808
|
digest?: string | undefined;
|
|
806
|
-
url?: string | undefined;
|
|
807
809
|
startLine?: number | undefined;
|
|
808
810
|
endLine?: number | undefined;
|
|
809
811
|
}[] | undefined;
|
|
@@ -834,21 +836,21 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
834
836
|
subjectRef: {
|
|
835
837
|
id: string;
|
|
836
838
|
model: string;
|
|
837
|
-
store: "
|
|
839
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
838
840
|
path?: string | undefined;
|
|
839
841
|
anchor?: string | undefined;
|
|
842
|
+
url?: string | undefined;
|
|
840
843
|
commit?: string | undefined;
|
|
841
844
|
repository?: string | undefined;
|
|
842
845
|
revision?: number | undefined;
|
|
843
846
|
digest?: string | undefined;
|
|
844
|
-
url?: string | undefined;
|
|
845
847
|
startLine?: number | undefined;
|
|
846
848
|
endLine?: number | undefined;
|
|
847
849
|
};
|
|
848
850
|
participantClasses: string[];
|
|
851
|
+
groupIds?: string[] | undefined;
|
|
849
852
|
updatedAt?: string | undefined;
|
|
850
853
|
visibility?: "project" | "team" | "public" | "authenticated" | "admin" | undefined;
|
|
851
|
-
groupIds?: string[] | undefined;
|
|
852
854
|
topic?: string | undefined;
|
|
853
855
|
participantIds?: string[] | undefined;
|
|
854
856
|
agentIds?: string[] | undefined;
|
|
@@ -861,28 +863,28 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
861
863
|
discussionRef: {
|
|
862
864
|
id: string;
|
|
863
865
|
model: string;
|
|
864
|
-
store: "
|
|
866
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
865
867
|
path?: string | undefined;
|
|
866
868
|
anchor?: string | undefined;
|
|
869
|
+
url?: string | undefined;
|
|
867
870
|
commit?: string | undefined;
|
|
868
871
|
repository?: string | undefined;
|
|
869
872
|
revision?: number | undefined;
|
|
870
873
|
digest?: string | undefined;
|
|
871
|
-
url?: string | undefined;
|
|
872
874
|
startLine?: number | undefined;
|
|
873
875
|
endLine?: number | undefined;
|
|
874
876
|
};
|
|
875
877
|
authorRef: {
|
|
876
878
|
id: string;
|
|
877
879
|
model: string;
|
|
878
|
-
store: "
|
|
880
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
879
881
|
path?: string | undefined;
|
|
880
882
|
anchor?: string | undefined;
|
|
883
|
+
url?: string | undefined;
|
|
881
884
|
commit?: string | undefined;
|
|
882
885
|
repository?: string | undefined;
|
|
883
886
|
revision?: number | undefined;
|
|
884
887
|
digest?: string | undefined;
|
|
885
|
-
url?: string | undefined;
|
|
886
888
|
startLine?: number | undefined;
|
|
887
889
|
endLine?: number | undefined;
|
|
888
890
|
};
|
|
@@ -893,14 +895,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
893
895
|
replyToRef?: {
|
|
894
896
|
id: string;
|
|
895
897
|
model: string;
|
|
896
|
-
store: "
|
|
898
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
897
899
|
path?: string | undefined;
|
|
898
900
|
anchor?: string | undefined;
|
|
901
|
+
url?: string | undefined;
|
|
899
902
|
commit?: string | undefined;
|
|
900
903
|
repository?: string | undefined;
|
|
901
904
|
revision?: number | undefined;
|
|
902
905
|
digest?: string | undefined;
|
|
903
|
-
url?: string | undefined;
|
|
904
906
|
startLine?: number | undefined;
|
|
905
907
|
endLine?: number | undefined;
|
|
906
908
|
} | undefined;
|
|
@@ -914,14 +916,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
914
916
|
sourceMessageRefs?: {
|
|
915
917
|
id: string;
|
|
916
918
|
model: string;
|
|
917
|
-
store: "
|
|
919
|
+
store: "url" | "treedx" | "git" | "postgresql";
|
|
918
920
|
path?: string | undefined;
|
|
919
921
|
anchor?: string | undefined;
|
|
922
|
+
url?: string | undefined;
|
|
920
923
|
commit?: string | undefined;
|
|
921
924
|
repository?: string | undefined;
|
|
922
925
|
revision?: number | undefined;
|
|
923
926
|
digest?: string | undefined;
|
|
924
|
-
url?: string | undefined;
|
|
925
927
|
startLine?: number | undefined;
|
|
926
928
|
endLine?: number | undefined;
|
|
927
929
|
}[] | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type PostProcessCallback } from 'zod-to-json-schema';
|
|
3
|
+
/** Validate with the owning parser without changing the caller's property order. */
|
|
4
|
+
export declare function preserveInputOrder<T extends z.ZodType<Record<string, unknown>>>(parser: T): z.ZodEffects<z.ZodType<Record<string, unknown>, z.ZodTypeDef, Record<string, unknown>>, z.output<T>, Record<string, unknown>>;
|
|
3
5
|
/** Preserve inherited validation while requiring represented properties. */
|
|
4
6
|
export declare function requiredProperties<T extends z.AnyZodObject>(object: T, fields: readonly string[], message: string): z.ZodEffects<T, {
|
|
5
7
|
[x: string]: any;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
3
|
const exporters = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function preserveInputOrder(parser) {
|
|
5
|
+
const schema = z.custom((value) => Boolean(value && typeof value === "object" && !Array.isArray(value))).transform((value, context) => {
|
|
6
|
+
const parsed = parser.safeParse(value);
|
|
7
|
+
if (!parsed.success) {
|
|
8
|
+
for (const issue of parsed.error.issues) context.addIssue(issue);
|
|
9
|
+
return z.NEVER;
|
|
10
|
+
}
|
|
11
|
+
const ordered = Object.fromEntries(Object.keys(value).filter((key) => Object.hasOwn(parsed.data, key)).map((key) => [key, parsed.data[key]]));
|
|
12
|
+
return { ...ordered, ...parsed.data };
|
|
13
|
+
});
|
|
14
|
+
exporters.set(schema._def, (_exported, refs) => {
|
|
15
|
+
const { $schema: _dialect, ...exported } = zodToJsonSchema(parser, {
|
|
16
|
+
target: refs.target,
|
|
17
|
+
$refStrategy: "none",
|
|
18
|
+
postProcess: exportSchemaConstraints
|
|
19
|
+
});
|
|
20
|
+
return exported;
|
|
21
|
+
});
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
4
24
|
function requiredProperties(object, fields, message) {
|
|
5
25
|
const schema = object.superRefine((value, context) => {
|
|
6
26
|
for (const field of fields) if (Object.getOwnPropertyDescriptor(value, field)?.value === void 0)
|
|
@@ -121,10 +141,10 @@ function conditionalFields(object, rules) {
|
|
|
121
141
|
});
|
|
122
142
|
return schema;
|
|
123
143
|
}
|
|
124
|
-
const exportSchemaConstraints = (schema, definition) => {
|
|
144
|
+
const exportSchemaConstraints = (schema, definition, refs) => {
|
|
125
145
|
if ("typeName" in definition && definition.typeName === z.ZodFirstPartyTypeKind.ZodIntersection && "left" in definition && "right" in definition && definition.left instanceof z.ZodType && definition.right instanceof z.ZodType) {
|
|
126
146
|
return { allOf: [definition.left, definition.right].map((part) => {
|
|
127
|
-
const { $schema: _dialect, ...branch } = zodToJsonSchema(part, { $refStrategy: "none", postProcess: exportSchemaConstraints });
|
|
147
|
+
const { $schema: _dialect, ...branch } = zodToJsonSchema(part, { target: refs.target, $refStrategy: "none", postProcess: exportSchemaConstraints });
|
|
128
148
|
return branch;
|
|
129
149
|
}) };
|
|
130
150
|
}
|
|
@@ -135,7 +155,7 @@ const exportSchemaConstraints = (schema, definition) => {
|
|
|
135
155
|
return schema;
|
|
136
156
|
}
|
|
137
157
|
if (!schema) throw new Error("An owning constraint has no exported schema.");
|
|
138
|
-
return exportConstraint(schema);
|
|
158
|
+
return exportConstraint(schema, refs);
|
|
139
159
|
};
|
|
140
160
|
export {
|
|
141
161
|
alternativeProperties,
|
|
@@ -144,6 +164,7 @@ export {
|
|
|
144
164
|
exclusiveUnion,
|
|
145
165
|
exportSchemaConstraints,
|
|
146
166
|
minimumProperties,
|
|
167
|
+
preserveInputOrder,
|
|
147
168
|
requiredProperties,
|
|
148
169
|
uniqueArray
|
|
149
170
|
};
|