@critical-path/core 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +15 -3
  3. package/dist/domain/authorization.d.ts +23 -0
  4. package/dist/domain/authorization.d.ts.map +1 -0
  5. package/dist/domain/authorization.js +62 -0
  6. package/dist/domain/authorization.js.map +1 -0
  7. package/dist/domain/entities.d.ts +2 -2
  8. package/dist/domain/entities.d.ts.map +1 -1
  9. package/dist/domain/entities.js.map +1 -1
  10. package/dist/domain/errors.d.ts +6 -0
  11. package/dist/domain/errors.d.ts.map +1 -1
  12. package/dist/domain/errors.js +9 -0
  13. package/dist/domain/errors.js.map +1 -1
  14. package/dist/domain/index.d.ts +1 -0
  15. package/dist/domain/index.d.ts.map +1 -1
  16. package/dist/domain/index.js +1 -0
  17. package/dist/domain/index.js.map +1 -1
  18. package/dist/engine/actor.test.js +1 -0
  19. package/dist/engine/actor.test.js.map +1 -1
  20. package/dist/engine/authorization.test.d.ts +2 -0
  21. package/dist/engine/authorization.test.d.ts.map +1 -0
  22. package/dist/engine/authorization.test.js +150 -0
  23. package/dist/engine/authorization.test.js.map +1 -0
  24. package/dist/engine/index.d.ts +49 -19
  25. package/dist/engine/index.d.ts.map +1 -1
  26. package/dist/engine/index.js +321 -87
  27. package/dist/engine/index.js.map +1 -1
  28. package/dist/index.test.js +1 -5
  29. package/dist/index.test.js.map +1 -1
  30. package/dist/schemas/index.d.ts +127 -130
  31. package/dist/schemas/index.d.ts.map +1 -1
  32. package/dist/schemas/index.js +41 -50
  33. package/dist/schemas/index.js.map +1 -1
  34. package/dist/schemas/schemas.test.js +10 -11
  35. package/dist/schemas/schemas.test.js.map +1 -1
  36. package/dist/store/sqlite.d.ts.map +1 -1
  37. package/dist/store/sqlite.js +20 -9
  38. package/dist/store/sqlite.js.map +1 -1
  39. package/dist/types/index.d.ts +45 -1
  40. package/dist/types/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/domain/authorization.ts +82 -0
  43. package/src/domain/entities.ts +2 -1
  44. package/src/domain/errors.ts +10 -0
  45. package/src/domain/index.ts +1 -0
  46. package/src/engine/actor.test.ts +2 -1
  47. package/src/engine/authorization.test.ts +191 -0
  48. package/src/engine/index.ts +318 -100
  49. package/src/index.test.ts +1 -5
  50. package/src/schemas/index.ts +67 -51
  51. package/src/schemas/schemas.test.ts +19 -17
  52. package/src/store/sqlite.ts +20 -6
  53. package/src/types/index.ts +66 -1
  54. package/tsconfig.tsbuildinfo +1 -1
@@ -4,8 +4,9 @@
4
4
  * Exposed from `@critical-path/core/schemas` (not the package root) so browser bundles of core do
5
5
  * not pull in zod. Create schemas omit server-assigned fields (`id`, `createdAt`, `updatedAt`, task
6
6
  * `key`); update schemas additionally make every field optional and omit the owning `projectId`.
7
- * Unknown keys are stripped rather than rejected, so older clients that send whole objects keep
8
- * working while protected fields are never written.
7
+ * Schemas are strict: unknown or server-assigned keys are rejected with a 400 rather than ignored.
8
+ * Identity (authors, reactors, uploaders, time-entry users) is never taken from payloads; it comes
9
+ * from the caller resolved by the server (see `CriticalPathEngine.withActor`).
9
10
  */
10
11
  import { z } from 'zod';
11
12
  /**
@@ -19,7 +20,7 @@ export declare const StatusDefinitionSchema: z.ZodObject<{
19
20
  key: z.ZodString;
20
21
  label: z.ZodString;
21
22
  category: z.ZodEnum<["not_started", "in_progress", "completed", "canceled"]>;
22
- }, "strip", z.ZodTypeAny, {
23
+ }, "strict", z.ZodTypeAny, {
23
24
  key: string;
24
25
  category: "in_progress" | "canceled" | "not_started" | "completed";
25
26
  label: string;
@@ -39,14 +40,14 @@ export declare const WorkScheduleSchema: z.ZodObject<{
39
40
  hours: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
41
  start: z.ZodString;
41
42
  end: z.ZodString;
42
- }, "strip", z.ZodTypeAny, {
43
+ }, "strict", z.ZodTypeAny, {
43
44
  start: string;
44
45
  end: string;
45
46
  }, {
46
47
  start: string;
47
48
  end: string;
48
49
  }>, "many">>;
49
- }, "strip", z.ZodTypeAny, {
50
+ }, "strict", z.ZodTypeAny, {
50
51
  isWorkingDay: boolean;
51
52
  dayOfWeek: number;
52
53
  hours?: {
@@ -65,7 +66,7 @@ export declare const WorkScheduleSchema: z.ZodObject<{
65
66
  date: z.ZodString;
66
67
  name: z.ZodOptional<z.ZodString>;
67
68
  halfDay: z.ZodOptional<z.ZodBoolean>;
68
- }, "strip", z.ZodTypeAny, {
69
+ }, "strict", z.ZodTypeAny, {
69
70
  date: string;
70
71
  name?: string | undefined;
71
72
  halfDay?: boolean | undefined;
@@ -74,7 +75,7 @@ export declare const WorkScheduleSchema: z.ZodObject<{
74
75
  name?: string | undefined;
75
76
  halfDay?: boolean | undefined;
76
77
  }>, "many">>;
77
- }, "strip", z.ZodTypeAny, {
78
+ }, "strict", z.ZodTypeAny, {
78
79
  days: {
79
80
  isWorkingDay: boolean;
80
81
  dayOfWeek: number;
@@ -119,7 +120,7 @@ export declare const CustomFieldDefinitionSchema: z.ZodObject<{
119
120
  options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
121
  required: z.ZodOptional<z.ZodBoolean>;
121
122
  defaultValue: z.ZodOptional<z.ZodUnknown>;
122
- }, "strip", z.ZodTypeAny, {
123
+ }, "strict", z.ZodTypeAny, {
123
124
  id: string;
124
125
  key: string;
125
126
  type: "number" | "boolean" | "text" | "date" | "single_select" | "multi_select" | "user";
@@ -143,7 +144,7 @@ export declare const TaskTypeDefinitionSchema: z.ZodObject<{
143
144
  icon: z.ZodOptional<z.ZodString>;
144
145
  defaultStatusKey: z.ZodOptional<z.ZodString>;
145
146
  workflowId: z.ZodOptional<z.ZodString>;
146
- }, "strip", z.ZodTypeAny, {
147
+ }, "strict", z.ZodTypeAny, {
147
148
  key: string;
148
149
  label: string;
149
150
  description?: string | undefined;
@@ -165,7 +166,7 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
165
166
  key: z.ZodString;
166
167
  label: z.ZodString;
167
168
  category: z.ZodEnum<["not_started", "in_progress", "completed", "canceled"]>;
168
- }, "strip", z.ZodTypeAny, {
169
+ }, "strict", z.ZodTypeAny, {
169
170
  key: string;
170
171
  category: "in_progress" | "canceled" | "not_started" | "completed";
171
172
  label: string;
@@ -179,7 +180,7 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
179
180
  name: z.ZodOptional<z.ZodString>;
180
181
  fromStatusKey: z.ZodString;
181
182
  toStatusKey: z.ZodString;
182
- }, "strip", z.ZodTypeAny, {
183
+ }, "strict", z.ZodTypeAny, {
183
184
  fromStatusKey: string;
184
185
  toStatusKey: string;
185
186
  id?: string | undefined;
@@ -197,7 +198,7 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
197
198
  icon: z.ZodOptional<z.ZodString>;
198
199
  defaultStatusKey: z.ZodOptional<z.ZodString>;
199
200
  workflowId: z.ZodOptional<z.ZodString>;
200
- }, "strip", z.ZodTypeAny, {
201
+ }, "strict", z.ZodTypeAny, {
201
202
  key: string;
202
203
  label: string;
203
204
  description?: string | undefined;
@@ -214,7 +215,7 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
214
215
  }>, "many">>;
215
216
  defaultStatusKey: z.ZodOptional<z.ZodString>;
216
217
  isDefault: z.ZodOptional<z.ZodBoolean>;
217
- }, "strip", z.ZodTypeAny, {
218
+ }, "strict", z.ZodTypeAny, {
218
219
  name: string;
219
220
  transitions: {
220
221
  fromStatusKey: string;
@@ -270,7 +271,7 @@ export declare const UpdateWorkflowSchema: z.ZodObject<{
270
271
  key: z.ZodString;
271
272
  label: z.ZodString;
272
273
  category: z.ZodEnum<["not_started", "in_progress", "completed", "canceled"]>;
273
- }, "strip", z.ZodTypeAny, {
274
+ }, "strict", z.ZodTypeAny, {
274
275
  key: string;
275
276
  category: "in_progress" | "canceled" | "not_started" | "completed";
276
277
  label: string;
@@ -284,7 +285,7 @@ export declare const UpdateWorkflowSchema: z.ZodObject<{
284
285
  name: z.ZodOptional<z.ZodString>;
285
286
  fromStatusKey: z.ZodString;
286
287
  toStatusKey: z.ZodString;
287
- }, "strip", z.ZodTypeAny, {
288
+ }, "strict", z.ZodTypeAny, {
288
289
  fromStatusKey: string;
289
290
  toStatusKey: string;
290
291
  id?: string | undefined;
@@ -302,7 +303,7 @@ export declare const UpdateWorkflowSchema: z.ZodObject<{
302
303
  icon: z.ZodOptional<z.ZodString>;
303
304
  defaultStatusKey: z.ZodOptional<z.ZodString>;
304
305
  workflowId: z.ZodOptional<z.ZodString>;
305
- }, "strip", z.ZodTypeAny, {
306
+ }, "strict", z.ZodTypeAny, {
306
307
  key: string;
307
308
  label: string;
308
309
  description?: string | undefined;
@@ -319,7 +320,7 @@ export declare const UpdateWorkflowSchema: z.ZodObject<{
319
320
  }>, "many">>>;
320
321
  defaultStatusKey: z.ZodOptional<z.ZodOptional<z.ZodString>>;
321
322
  isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
322
- }, "strip", z.ZodTypeAny, {
323
+ }, "strict", z.ZodTypeAny, {
323
324
  description?: string | undefined;
324
325
  name?: string | undefined;
325
326
  taskTypes?: {
@@ -373,7 +374,16 @@ export declare const CreateProjectSchema: z.ZodObject<{
373
374
  name: z.ZodString;
374
375
  description: z.ZodOptional<z.ZodString>;
375
376
  ownerId: z.ZodOptional<z.ZodString>;
376
- members: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
377
+ members: z.ZodOptional<z.ZodArray<z.ZodObject<{
378
+ userId: z.ZodString;
379
+ role: z.ZodEnum<["admin", "project_manager", "contributor", "viewer"]>;
380
+ }, "strict", z.ZodTypeAny, {
381
+ userId: string;
382
+ role: "admin" | "project_manager" | "contributor" | "viewer";
383
+ }, {
384
+ userId: string;
385
+ role: "admin" | "project_manager" | "contributor" | "viewer";
386
+ }>, "many">>;
377
387
  teamIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
378
388
  workflowId: z.ZodOptional<z.ZodString>;
379
389
  taskTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -383,7 +393,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
383
393
  icon: z.ZodOptional<z.ZodString>;
384
394
  defaultStatusKey: z.ZodOptional<z.ZodString>;
385
395
  workflowId: z.ZodOptional<z.ZodString>;
386
- }, "strip", z.ZodTypeAny, {
396
+ }, "strict", z.ZodTypeAny, {
387
397
  key: string;
388
398
  label: string;
389
399
  description?: string | undefined;
@@ -402,7 +412,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
402
412
  key: z.ZodString;
403
413
  label: z.ZodString;
404
414
  category: z.ZodEnum<["not_started", "in_progress", "completed", "canceled"]>;
405
- }, "strip", z.ZodTypeAny, {
415
+ }, "strict", z.ZodTypeAny, {
406
416
  key: string;
407
417
  category: "in_progress" | "canceled" | "not_started" | "completed";
408
418
  label: string;
@@ -415,7 +425,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
415
425
  key: z.ZodString;
416
426
  label: z.ZodString;
417
427
  level: z.ZodOptional<z.ZodNumber>;
418
- }, "strip", z.ZodTypeAny, {
428
+ }, "strict", z.ZodTypeAny, {
419
429
  key: string;
420
430
  label: string;
421
431
  level?: number | undefined;
@@ -432,7 +442,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
432
442
  options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
433
443
  required: z.ZodOptional<z.ZodBoolean>;
434
444
  defaultValue: z.ZodOptional<z.ZodUnknown>;
435
- }, "strip", z.ZodTypeAny, {
445
+ }, "strict", z.ZodTypeAny, {
436
446
  id: string;
437
447
  key: string;
438
448
  type: "number" | "boolean" | "text" | "date" | "single_select" | "multi_select" | "user";
@@ -460,14 +470,14 @@ export declare const CreateProjectSchema: z.ZodObject<{
460
470
  hours: z.ZodOptional<z.ZodArray<z.ZodObject<{
461
471
  start: z.ZodString;
462
472
  end: z.ZodString;
463
- }, "strip", z.ZodTypeAny, {
473
+ }, "strict", z.ZodTypeAny, {
464
474
  start: string;
465
475
  end: string;
466
476
  }, {
467
477
  start: string;
468
478
  end: string;
469
479
  }>, "many">>;
470
- }, "strip", z.ZodTypeAny, {
480
+ }, "strict", z.ZodTypeAny, {
471
481
  isWorkingDay: boolean;
472
482
  dayOfWeek: number;
473
483
  hours?: {
@@ -486,7 +496,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
486
496
  date: z.ZodString;
487
497
  name: z.ZodOptional<z.ZodString>;
488
498
  halfDay: z.ZodOptional<z.ZodBoolean>;
489
- }, "strip", z.ZodTypeAny, {
499
+ }, "strict", z.ZodTypeAny, {
490
500
  date: string;
491
501
  name?: string | undefined;
492
502
  halfDay?: boolean | undefined;
@@ -495,7 +505,7 @@ export declare const CreateProjectSchema: z.ZodObject<{
495
505
  name?: string | undefined;
496
506
  halfDay?: boolean | undefined;
497
507
  }>, "many">>;
498
- }, "strip", z.ZodTypeAny, {
508
+ }, "strict", z.ZodTypeAny, {
499
509
  days: {
500
510
  isWorkingDay: boolean;
501
511
  dayOfWeek: number;
@@ -534,12 +544,15 @@ export declare const CreateProjectSchema: z.ZodObject<{
534
544
  }>>;
535
545
  startDate: z.ZodOptional<z.ZodString>;
536
546
  targetEndDate: z.ZodOptional<z.ZodString>;
537
- }, "strip", z.ZodTypeAny, {
547
+ }, "strict", z.ZodTypeAny, {
538
548
  name: string;
539
549
  key?: string | undefined;
540
550
  description?: string | undefined;
541
551
  ownerId?: string | undefined;
542
- members?: string[] | undefined;
552
+ members?: {
553
+ userId: string;
554
+ role: "admin" | "project_manager" | "contributor" | "viewer";
555
+ }[] | undefined;
543
556
  teamIds?: string[] | undefined;
544
557
  workflowId?: string | undefined;
545
558
  taskTypes?: {
@@ -595,7 +608,10 @@ export declare const CreateProjectSchema: z.ZodObject<{
595
608
  key?: string | undefined;
596
609
  description?: string | undefined;
597
610
  ownerId?: string | undefined;
598
- members?: string[] | undefined;
611
+ members?: {
612
+ userId: string;
613
+ role: "admin" | "project_manager" | "contributor" | "viewer";
614
+ }[] | undefined;
599
615
  teamIds?: string[] | undefined;
600
616
  workflowId?: string | undefined;
601
617
  taskTypes?: {
@@ -652,7 +668,16 @@ export declare const UpdateProjectSchema: z.ZodObject<{
652
668
  name: z.ZodOptional<z.ZodString>;
653
669
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
654
670
  ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
655
- members: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
671
+ members: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
672
+ userId: z.ZodString;
673
+ role: z.ZodEnum<["admin", "project_manager", "contributor", "viewer"]>;
674
+ }, "strict", z.ZodTypeAny, {
675
+ userId: string;
676
+ role: "admin" | "project_manager" | "contributor" | "viewer";
677
+ }, {
678
+ userId: string;
679
+ role: "admin" | "project_manager" | "contributor" | "viewer";
680
+ }>, "many">>>;
656
681
  teamIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
657
682
  workflowId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
658
683
  taskTypes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -662,7 +687,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
662
687
  icon: z.ZodOptional<z.ZodString>;
663
688
  defaultStatusKey: z.ZodOptional<z.ZodString>;
664
689
  workflowId: z.ZodOptional<z.ZodString>;
665
- }, "strip", z.ZodTypeAny, {
690
+ }, "strict", z.ZodTypeAny, {
666
691
  key: string;
667
692
  label: string;
668
693
  description?: string | undefined;
@@ -681,7 +706,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
681
706
  key: z.ZodString;
682
707
  label: z.ZodString;
683
708
  category: z.ZodEnum<["not_started", "in_progress", "completed", "canceled"]>;
684
- }, "strip", z.ZodTypeAny, {
709
+ }, "strict", z.ZodTypeAny, {
685
710
  key: string;
686
711
  category: "in_progress" | "canceled" | "not_started" | "completed";
687
712
  label: string;
@@ -694,7 +719,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
694
719
  key: z.ZodString;
695
720
  label: z.ZodString;
696
721
  level: z.ZodOptional<z.ZodNumber>;
697
- }, "strip", z.ZodTypeAny, {
722
+ }, "strict", z.ZodTypeAny, {
698
723
  key: string;
699
724
  label: string;
700
725
  level?: number | undefined;
@@ -711,7 +736,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
711
736
  options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
712
737
  required: z.ZodOptional<z.ZodBoolean>;
713
738
  defaultValue: z.ZodOptional<z.ZodUnknown>;
714
- }, "strip", z.ZodTypeAny, {
739
+ }, "strict", z.ZodTypeAny, {
715
740
  id: string;
716
741
  key: string;
717
742
  type: "number" | "boolean" | "text" | "date" | "single_select" | "multi_select" | "user";
@@ -739,14 +764,14 @@ export declare const UpdateProjectSchema: z.ZodObject<{
739
764
  hours: z.ZodOptional<z.ZodArray<z.ZodObject<{
740
765
  start: z.ZodString;
741
766
  end: z.ZodString;
742
- }, "strip", z.ZodTypeAny, {
767
+ }, "strict", z.ZodTypeAny, {
743
768
  start: string;
744
769
  end: string;
745
770
  }, {
746
771
  start: string;
747
772
  end: string;
748
773
  }>, "many">>;
749
- }, "strip", z.ZodTypeAny, {
774
+ }, "strict", z.ZodTypeAny, {
750
775
  isWorkingDay: boolean;
751
776
  dayOfWeek: number;
752
777
  hours?: {
@@ -765,7 +790,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
765
790
  date: z.ZodString;
766
791
  name: z.ZodOptional<z.ZodString>;
767
792
  halfDay: z.ZodOptional<z.ZodBoolean>;
768
- }, "strip", z.ZodTypeAny, {
793
+ }, "strict", z.ZodTypeAny, {
769
794
  date: string;
770
795
  name?: string | undefined;
771
796
  halfDay?: boolean | undefined;
@@ -774,7 +799,7 @@ export declare const UpdateProjectSchema: z.ZodObject<{
774
799
  name?: string | undefined;
775
800
  halfDay?: boolean | undefined;
776
801
  }>, "many">>;
777
- }, "strip", z.ZodTypeAny, {
802
+ }, "strict", z.ZodTypeAny, {
778
803
  days: {
779
804
  isWorkingDay: boolean;
780
805
  dayOfWeek: number;
@@ -813,12 +838,15 @@ export declare const UpdateProjectSchema: z.ZodObject<{
813
838
  }>>>;
814
839
  startDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
815
840
  targetEndDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
816
- }, "strip", z.ZodTypeAny, {
841
+ }, "strict", z.ZodTypeAny, {
817
842
  key?: string | undefined;
818
843
  description?: string | undefined;
819
844
  name?: string | undefined;
820
845
  ownerId?: string | undefined;
821
- members?: string[] | undefined;
846
+ members?: {
847
+ userId: string;
848
+ role: "admin" | "project_manager" | "contributor" | "viewer";
849
+ }[] | undefined;
822
850
  teamIds?: string[] | undefined;
823
851
  workflowId?: string | undefined;
824
852
  taskTypes?: {
@@ -874,7 +902,10 @@ export declare const UpdateProjectSchema: z.ZodObject<{
874
902
  description?: string | undefined;
875
903
  name?: string | undefined;
876
904
  ownerId?: string | undefined;
877
- members?: string[] | undefined;
905
+ members?: {
906
+ userId: string;
907
+ role: "admin" | "project_manager" | "contributor" | "viewer";
908
+ }[] | undefined;
878
909
  teamIds?: string[] | undefined;
879
910
  workflowId?: string | undefined;
880
911
  taskTypes?: {
@@ -940,7 +971,7 @@ export declare const CreateTaskSchema: z.ZodObject<{
940
971
  role: z.ZodOptional<z.ZodString>;
941
972
  type: z.ZodOptional<z.ZodEnum<["user", "agent", "team"]>>;
942
973
  avatarUrl: z.ZodOptional<z.ZodString>;
943
- }, "strip", z.ZodTypeAny, {
974
+ }, "strict", z.ZodTypeAny, {
944
975
  id: string;
945
976
  name?: string | undefined;
946
977
  type?: "user" | "agent" | "team" | undefined;
@@ -985,7 +1016,7 @@ export declare const CreateTaskSchema: z.ZodObject<{
985
1016
  completed: z.ZodBoolean;
986
1017
  createdAt: z.ZodOptional<z.ZodString>;
987
1018
  completedAt: z.ZodOptional<z.ZodString>;
988
- }, "strip", z.ZodTypeAny, {
1019
+ }, "strict", z.ZodTypeAny, {
989
1020
  completed: boolean;
990
1021
  id: string;
991
1022
  title: string;
@@ -1001,7 +1032,7 @@ export declare const CreateTaskSchema: z.ZodObject<{
1001
1032
  customFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1002
1033
  parentId: z.ZodOptional<z.ZodString>;
1003
1034
  projectId: z.ZodString;
1004
- }, "strip", z.ZodTypeAny, {
1035
+ }, "strict", z.ZodTypeAny, {
1005
1036
  projectId: string;
1006
1037
  title: string;
1007
1038
  status?: string | undefined;
@@ -1118,7 +1149,7 @@ export declare const UpdateTaskSchema: z.ZodObject<{
1118
1149
  role: z.ZodOptional<z.ZodString>;
1119
1150
  type: z.ZodOptional<z.ZodEnum<["user", "agent", "team"]>>;
1120
1151
  avatarUrl: z.ZodOptional<z.ZodString>;
1121
- }, "strip", z.ZodTypeAny, {
1152
+ }, "strict", z.ZodTypeAny, {
1122
1153
  id: string;
1123
1154
  name?: string | undefined;
1124
1155
  type?: "user" | "agent" | "team" | undefined;
@@ -1163,7 +1194,7 @@ export declare const UpdateTaskSchema: z.ZodObject<{
1163
1194
  completed: z.ZodBoolean;
1164
1195
  createdAt: z.ZodOptional<z.ZodString>;
1165
1196
  completedAt: z.ZodOptional<z.ZodString>;
1166
- }, "strip", z.ZodTypeAny, {
1197
+ }, "strict", z.ZodTypeAny, {
1167
1198
  completed: boolean;
1168
1199
  id: string;
1169
1200
  title: string;
@@ -1178,24 +1209,7 @@ export declare const UpdateTaskSchema: z.ZodObject<{
1178
1209
  }>, "many">>>;
1179
1210
  customFields: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1180
1211
  parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1181
- } & {
1182
- actorId: z.ZodOptional<z.ZodString>;
1183
- actorName: z.ZodOptional<z.ZodString>;
1184
- actorType: z.ZodOptional<z.ZodString>;
1185
- actor: z.ZodOptional<z.ZodObject<{
1186
- userId: z.ZodString;
1187
- username: z.ZodOptional<z.ZodString>;
1188
- actorType: z.ZodOptional<z.ZodString>;
1189
- }, "strip", z.ZodTypeAny, {
1190
- userId: string;
1191
- username?: string | undefined;
1192
- actorType?: string | undefined;
1193
- }, {
1194
- userId: string;
1195
- username?: string | undefined;
1196
- actorType?: string | undefined;
1197
- }>>;
1198
- }, "strip", z.ZodTypeAny, {
1212
+ }, "strict", z.ZodTypeAny, {
1199
1213
  status?: string | undefined;
1200
1214
  priority?: string | undefined;
1201
1215
  title?: string | undefined;
@@ -1245,14 +1259,6 @@ export declare const UpdateTaskSchema: z.ZodObject<{
1245
1259
  }[] | undefined;
1246
1260
  customFields?: Record<string, unknown> | undefined;
1247
1261
  parentId?: string | undefined;
1248
- actorId?: string | undefined;
1249
- actorName?: string | undefined;
1250
- actor?: {
1251
- userId: string;
1252
- username?: string | undefined;
1253
- actorType?: string | undefined;
1254
- } | undefined;
1255
- actorType?: string | undefined;
1256
1262
  }, {
1257
1263
  status?: string | undefined;
1258
1264
  priority?: string | undefined;
@@ -1303,19 +1309,11 @@ export declare const UpdateTaskSchema: z.ZodObject<{
1303
1309
  }[] | undefined;
1304
1310
  customFields?: Record<string, unknown> | undefined;
1305
1311
  parentId?: string | undefined;
1306
- actorId?: string | undefined;
1307
- actorName?: string | undefined;
1308
- actor?: {
1309
- userId: string;
1310
- username?: string | undefined;
1311
- actorType?: string | undefined;
1312
- } | undefined;
1313
- actorType?: string | undefined;
1314
1312
  }>;
1315
1313
  export declare const CreateDependencySchema: z.ZodObject<{
1316
1314
  dependsOnTaskId: z.ZodString;
1317
1315
  type: z.ZodDefault<z.ZodEnum<["blocking", "blocked_by", "relates_to"]>>;
1318
- }, "strip", z.ZodTypeAny, {
1316
+ }, "strict", z.ZodTypeAny, {
1319
1317
  type: "blocking" | "blocked_by" | "relates_to";
1320
1318
  dependsOnTaskId: string;
1321
1319
  }, {
@@ -1335,7 +1333,7 @@ export declare const CreateDeliverableSchema: z.ZodObject<{
1335
1333
  outputUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1336
1334
  customFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1337
1335
  projectId: z.ZodString;
1338
- }, "strip", z.ZodTypeAny, {
1336
+ }, "strict", z.ZodTypeAny, {
1339
1337
  projectId: string;
1340
1338
  title: string;
1341
1339
  status?: string | undefined;
@@ -1374,7 +1372,7 @@ export declare const UpdateDeliverableSchema: z.ZodObject<{
1374
1372
  deliveredAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1375
1373
  outputUrls: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
1376
1374
  customFields: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1377
- }, "strip", z.ZodTypeAny, {
1375
+ }, "strict", z.ZodTypeAny, {
1378
1376
  status?: string | undefined;
1379
1377
  title?: string | undefined;
1380
1378
  description?: string | undefined;
@@ -1416,14 +1414,14 @@ export declare const CreateTeamSchema: z.ZodObject<{
1416
1414
  hours: z.ZodOptional<z.ZodArray<z.ZodObject<{
1417
1415
  start: z.ZodString;
1418
1416
  end: z.ZodString;
1419
- }, "strip", z.ZodTypeAny, {
1417
+ }, "strict", z.ZodTypeAny, {
1420
1418
  start: string;
1421
1419
  end: string;
1422
1420
  }, {
1423
1421
  start: string;
1424
1422
  end: string;
1425
1423
  }>, "many">>;
1426
- }, "strip", z.ZodTypeAny, {
1424
+ }, "strict", z.ZodTypeAny, {
1427
1425
  isWorkingDay: boolean;
1428
1426
  dayOfWeek: number;
1429
1427
  hours?: {
@@ -1442,7 +1440,7 @@ export declare const CreateTeamSchema: z.ZodObject<{
1442
1440
  date: z.ZodString;
1443
1441
  name: z.ZodOptional<z.ZodString>;
1444
1442
  halfDay: z.ZodOptional<z.ZodBoolean>;
1445
- }, "strip", z.ZodTypeAny, {
1443
+ }, "strict", z.ZodTypeAny, {
1446
1444
  date: string;
1447
1445
  name?: string | undefined;
1448
1446
  halfDay?: boolean | undefined;
@@ -1451,7 +1449,7 @@ export declare const CreateTeamSchema: z.ZodObject<{
1451
1449
  name?: string | undefined;
1452
1450
  halfDay?: boolean | undefined;
1453
1451
  }>, "many">>;
1454
- }, "strip", z.ZodTypeAny, {
1452
+ }, "strict", z.ZodTypeAny, {
1455
1453
  days: {
1456
1454
  isWorkingDay: boolean;
1457
1455
  dayOfWeek: number;
@@ -1488,7 +1486,7 @@ export declare const CreateTeamSchema: z.ZodObject<{
1488
1486
  halfDay?: boolean | undefined;
1489
1487
  }[] | undefined;
1490
1488
  }>>;
1491
- }, "strip", z.ZodTypeAny, {
1489
+ }, "strict", z.ZodTypeAny, {
1492
1490
  name: string;
1493
1491
  memberIds: string[];
1494
1492
  description?: string | undefined;
@@ -1556,14 +1554,14 @@ export declare const UpdateTeamSchema: z.ZodObject<{
1556
1554
  hours: z.ZodOptional<z.ZodArray<z.ZodObject<{
1557
1555
  start: z.ZodString;
1558
1556
  end: z.ZodString;
1559
- }, "strip", z.ZodTypeAny, {
1557
+ }, "strict", z.ZodTypeAny, {
1560
1558
  start: string;
1561
1559
  end: string;
1562
1560
  }, {
1563
1561
  start: string;
1564
1562
  end: string;
1565
1563
  }>, "many">>;
1566
- }, "strip", z.ZodTypeAny, {
1564
+ }, "strict", z.ZodTypeAny, {
1567
1565
  isWorkingDay: boolean;
1568
1566
  dayOfWeek: number;
1569
1567
  hours?: {
@@ -1582,7 +1580,7 @@ export declare const UpdateTeamSchema: z.ZodObject<{
1582
1580
  date: z.ZodString;
1583
1581
  name: z.ZodOptional<z.ZodString>;
1584
1582
  halfDay: z.ZodOptional<z.ZodBoolean>;
1585
- }, "strip", z.ZodTypeAny, {
1583
+ }, "strict", z.ZodTypeAny, {
1586
1584
  date: string;
1587
1585
  name?: string | undefined;
1588
1586
  halfDay?: boolean | undefined;
@@ -1591,7 +1589,7 @@ export declare const UpdateTeamSchema: z.ZodObject<{
1591
1589
  name?: string | undefined;
1592
1590
  halfDay?: boolean | undefined;
1593
1591
  }>, "many">>;
1594
- }, "strip", z.ZodTypeAny, {
1592
+ }, "strict", z.ZodTypeAny, {
1595
1593
  days: {
1596
1594
  isWorkingDay: boolean;
1597
1595
  dayOfWeek: number;
@@ -1628,7 +1626,7 @@ export declare const UpdateTeamSchema: z.ZodObject<{
1628
1626
  halfDay?: boolean | undefined;
1629
1627
  }[] | undefined;
1630
1628
  }>>>;
1631
- }, "strip", z.ZodTypeAny, {
1629
+ }, "strict", z.ZodTypeAny, {
1632
1630
  description?: string | undefined;
1633
1631
  name?: string | undefined;
1634
1632
  schedule?: {
@@ -1686,7 +1684,7 @@ export declare const CreateContainerSchema: z.ZodObject<{
1686
1684
  type: z.ZodOptional<z.ZodString>;
1687
1685
  color: z.ZodOptional<z.ZodString>;
1688
1686
  projectId: z.ZodString;
1689
- }, "strip", z.ZodTypeAny, {
1687
+ }, "strict", z.ZodTypeAny, {
1690
1688
  projectId: string;
1691
1689
  name: string;
1692
1690
  description?: string | undefined;
@@ -1707,7 +1705,7 @@ export declare const UpdateContainerSchema: z.ZodObject<{
1707
1705
  parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1708
1706
  type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1709
1707
  color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1710
- }, "strip", z.ZodTypeAny, {
1708
+ }, "strict", z.ZodTypeAny, {
1711
1709
  description?: string | undefined;
1712
1710
  parentId?: string | undefined;
1713
1711
  name?: string | undefined;
@@ -1728,7 +1726,7 @@ export declare const CreateIterationSchema: z.ZodObject<{
1728
1726
  endDate: z.ZodOptional<z.ZodString>;
1729
1727
  status: z.ZodDefault<z.ZodEnum<["planning", "active", "completed"]>>;
1730
1728
  projectId: z.ZodString;
1731
- }, "strip", z.ZodTypeAny, {
1729
+ }, "strict", z.ZodTypeAny, {
1732
1730
  status: "completed" | "planning" | "active";
1733
1731
  projectId: string;
1734
1732
  name: string;
@@ -1769,28 +1767,21 @@ export declare const UpdateIterationSchema: z.ZodObject<{
1769
1767
  }>;
1770
1768
  export declare const CreateCommentSchema: z.ZodObject<{
1771
1769
  taskId: z.ZodString;
1772
- /** Required unless the server resolves the caller, in which case it is replaced. */
1773
- authorId: z.ZodOptional<z.ZodString>;
1774
- authorType: z.ZodOptional<z.ZodEnum<["user", "agent", "system"]>>;
1775
1770
  parentId: z.ZodOptional<z.ZodString>;
1776
1771
  content: z.ZodString;
1777
1772
  mentions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1778
1773
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1779
- }, "strip", z.ZodTypeAny, {
1774
+ }, "strict", z.ZodTypeAny, {
1780
1775
  taskId: string;
1781
1776
  content: string;
1782
1777
  parentId?: string | undefined;
1783
1778
  metadata?: Record<string, unknown> | undefined;
1784
- authorId?: string | undefined;
1785
- authorType?: "user" | "agent" | "system" | undefined;
1786
1779
  mentions?: string[] | undefined;
1787
1780
  }, {
1788
1781
  taskId: string;
1789
1782
  content: string;
1790
1783
  parentId?: string | undefined;
1791
1784
  metadata?: Record<string, unknown> | undefined;
1792
- authorId?: string | undefined;
1793
- authorType?: "user" | "agent" | "system" | undefined;
1794
1785
  mentions?: string[] | undefined;
1795
1786
  }>;
1796
1787
  export declare const UpdateCommentSchema: z.ZodObject<{
@@ -1808,14 +1799,10 @@ export declare const UpdateCommentSchema: z.ZodObject<{
1808
1799
  }>;
1809
1800
  export declare const CommentReactionSchema: z.ZodObject<{
1810
1801
  emoji: z.ZodString;
1811
- /** Required unless the server resolves the caller, in which case it is replaced. */
1812
- userId: z.ZodOptional<z.ZodString>;
1813
- }, "strip", z.ZodTypeAny, {
1802
+ }, "strict", z.ZodTypeAny, {
1814
1803
  emoji: string;
1815
- userId?: string | undefined;
1816
1804
  }, {
1817
1805
  emoji: string;
1818
- userId?: string | undefined;
1819
1806
  }>;
1820
1807
  export declare const CreateAttachmentSchema: z.ZodObject<{
1821
1808
  filename: z.ZodString;
@@ -1826,12 +1813,9 @@ export declare const CreateAttachmentSchema: z.ZodObject<{
1826
1813
  taskId: z.ZodOptional<z.ZodString>;
1827
1814
  projectId: z.ZodOptional<z.ZodString>;
1828
1815
  commentId: z.ZodOptional<z.ZodString>;
1829
- /** Required unless the server resolves the caller, in which case it is replaced. */
1830
- uploaderId: z.ZodOptional<z.ZodString>;
1831
- uploaderType: z.ZodOptional<z.ZodEnum<["user", "agent", "system"]>>;
1832
1816
  artifactType: z.ZodOptional<z.ZodEnum<["plan", "spec", "deliverable", "review", "general"]>>;
1833
1817
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1834
- }, "strip", z.ZodTypeAny, {
1818
+ }, "strict", z.ZodTypeAny, {
1835
1819
  filename: string;
1836
1820
  mimeType: string;
1837
1821
  sizeBytes: number;
@@ -1839,8 +1823,6 @@ export declare const CreateAttachmentSchema: z.ZodObject<{
1839
1823
  projectId?: string | undefined;
1840
1824
  taskId?: string | undefined;
1841
1825
  commentId?: string | undefined;
1842
- uploaderId?: string | undefined;
1843
- uploaderType?: "user" | "agent" | "system" | undefined;
1844
1826
  storageKey?: string | undefined;
1845
1827
  artifactType?: "plan" | "spec" | "deliverable" | "review" | "general" | undefined;
1846
1828
  metadata?: Record<string, unknown> | undefined;
@@ -1850,8 +1832,6 @@ export declare const CreateAttachmentSchema: z.ZodObject<{
1850
1832
  projectId?: string | undefined;
1851
1833
  taskId?: string | undefined;
1852
1834
  commentId?: string | undefined;
1853
- uploaderId?: string | undefined;
1854
- uploaderType?: "user" | "agent" | "system" | undefined;
1855
1835
  mimeType?: string | undefined;
1856
1836
  sizeBytes?: number | undefined;
1857
1837
  storageKey?: string | undefined;
@@ -1867,19 +1847,14 @@ export declare const UploadAttachmentSchema: z.ZodObject<{
1867
1847
  taskId: z.ZodOptional<z.ZodString>;
1868
1848
  projectId: z.ZodOptional<z.ZodString>;
1869
1849
  commentId: z.ZodOptional<z.ZodString>;
1870
- /** Required unless the server resolves the caller, in which case it is replaced. */
1871
- uploaderId: z.ZodOptional<z.ZodString>;
1872
- uploaderType: z.ZodOptional<z.ZodEnum<["user", "agent", "system"]>>;
1873
1850
  artifactType: z.ZodOptional<z.ZodEnum<["plan", "spec", "deliverable", "review", "general"]>>;
1874
1851
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1875
- }, "strip", z.ZodTypeAny, {
1852
+ }, "strict", z.ZodTypeAny, {
1876
1853
  filename: string;
1877
1854
  data: string;
1878
1855
  projectId?: string | undefined;
1879
1856
  taskId?: string | undefined;
1880
1857
  commentId?: string | undefined;
1881
- uploaderId?: string | undefined;
1882
- uploaderType?: "user" | "agent" | "system" | undefined;
1883
1858
  mimeType?: string | undefined;
1884
1859
  artifactType?: "plan" | "spec" | "deliverable" | "review" | "general" | undefined;
1885
1860
  metadata?: Record<string, unknown> | undefined;
@@ -1891,8 +1866,6 @@ export declare const UploadAttachmentSchema: z.ZodObject<{
1891
1866
  projectId?: string | undefined;
1892
1867
  taskId?: string | undefined;
1893
1868
  commentId?: string | undefined;
1894
- uploaderId?: string | undefined;
1895
- uploaderType?: "user" | "agent" | "system" | undefined;
1896
1869
  mimeType?: string | undefined;
1897
1870
  artifactType?: "plan" | "spec" | "deliverable" | "review" | "general" | undefined;
1898
1871
  metadata?: Record<string, unknown> | undefined;
@@ -1900,14 +1873,18 @@ export declare const UploadAttachmentSchema: z.ZodObject<{
1900
1873
  encoding?: "base64" | "utf-8" | "binary" | undefined;
1901
1874
  }>;
1902
1875
  export declare const PresignAttachmentSchema: z.ZodObject<{
1876
+ /** Project the upload belongs to; scoped callers may only write under `projects/<projectId>/`. */
1877
+ projectId: z.ZodString;
1903
1878
  storageKey: z.ZodString;
1904
1879
  expiresInSeconds: z.ZodOptional<z.ZodNumber>;
1905
1880
  contentType: z.ZodOptional<z.ZodString>;
1906
- }, "strip", z.ZodTypeAny, {
1881
+ }, "strict", z.ZodTypeAny, {
1882
+ projectId: string;
1907
1883
  storageKey: string;
1908
1884
  contentType?: string | undefined;
1909
1885
  expiresInSeconds?: number | undefined;
1910
1886
  }, {
1887
+ projectId: string;
1911
1888
  storageKey: string;
1912
1889
  contentType?: string | undefined;
1913
1890
  expiresInSeconds?: number | undefined;
@@ -1917,25 +1894,45 @@ export declare const LogTimeSchema: z.ZodObject<{
1917
1894
  hours: z.ZodNumber;
1918
1895
  isBillable: z.ZodOptional<z.ZodBoolean>;
1919
1896
  description: z.ZodOptional<z.ZodString>;
1920
- userId: z.ZodOptional<z.ZodString>;
1921
1897
  loggedAt: z.ZodOptional<z.ZodString>;
1922
- }, "strip", z.ZodTypeAny, {
1898
+ }, "strict", z.ZodTypeAny, {
1923
1899
  taskId: string;
1924
1900
  hours: number;
1925
1901
  description?: string | undefined;
1926
1902
  loggedAt?: string | undefined;
1927
- userId?: string | undefined;
1928
1903
  isBillable?: boolean | undefined;
1929
1904
  }, {
1930
1905
  taskId: string;
1931
1906
  hours: number;
1932
1907
  description?: string | undefined;
1933
1908
  loggedAt?: string | undefined;
1934
- userId?: string | undefined;
1935
1909
  isBillable?: boolean | undefined;
1936
1910
  }>;
1937
1911
  export type CreateTaskPayload = z.infer<typeof CreateTaskSchema>;
1938
1912
  export type UpdateTaskPayload = z.infer<typeof UpdateTaskSchema>;
1939
1913
  export type CreateProjectPayload = z.infer<typeof CreateProjectSchema>;
1940
1914
  export type UpdateProjectPayload = z.infer<typeof UpdateProjectSchema>;
1915
+ /** Request body types (before defaults are applied), for typed API clients. */
1916
+ export type CreateWorkflowBody = z.input<typeof CreateWorkflowSchema>;
1917
+ export type UpdateWorkflowBody = z.input<typeof UpdateWorkflowSchema>;
1918
+ export type CreateProjectBody = z.input<typeof CreateProjectSchema>;
1919
+ export type UpdateProjectBody = z.input<typeof UpdateProjectSchema>;
1920
+ export type CreateTaskBody = z.input<typeof CreateTaskSchema>;
1921
+ export type UpdateTaskBody = z.input<typeof UpdateTaskSchema>;
1922
+ export type CreateDependencyBody = z.input<typeof CreateDependencySchema>;
1923
+ export type CreateDeliverableBody = z.input<typeof CreateDeliverableSchema>;
1924
+ export type UpdateDeliverableBody = z.input<typeof UpdateDeliverableSchema>;
1925
+ export type CreateTeamBody = z.input<typeof CreateTeamSchema>;
1926
+ export type UpdateTeamBody = z.input<typeof UpdateTeamSchema>;
1927
+ export type CreateContainerBody = z.input<typeof CreateContainerSchema>;
1928
+ export type UpdateContainerBody = z.input<typeof UpdateContainerSchema>;
1929
+ export type CreateIterationBody = z.input<typeof CreateIterationSchema>;
1930
+ export type UpdateIterationBody = z.input<typeof UpdateIterationSchema>;
1931
+ export type CreateCommentBody = z.input<typeof CreateCommentSchema>;
1932
+ export type UpdateCommentBody = z.input<typeof UpdateCommentSchema>;
1933
+ export type CommentReactionBody = z.input<typeof CommentReactionSchema>;
1934
+ export type CreateAttachmentBody = z.input<typeof CreateAttachmentSchema>;
1935
+ export type UploadAttachmentBody = z.input<typeof UploadAttachmentSchema>;
1936
+ export type PresignAttachmentBody = z.input<typeof PresignAttachmentSchema>;
1937
+ export type LogTimeBody = z.input<typeof LogTimeSchema>;
1941
1938
  //# sourceMappingURL=index.d.ts.map