@oxyhq/crowdsource-contracts 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/case-envelope.d.ts +50 -49
- package/dist/case-envelope.d.ts.map +1 -1
- package/dist/case-envelope.js +1 -1
- package/dist/case-envelope.js.map +1 -1
- package/dist/closed.d.ts +48 -0
- package/dist/closed.d.ts.map +1 -0
- package/dist/closed.js +33 -0
- package/dist/closed.js.map +1 -0
- package/dist/decisions.d.ts +7 -6
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/policies.d.ts +2 -1
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.js.map +1 -1
- package/dist/resources.d.ts +27 -27
- package/dist/reviews.d.ts +2 -2
- package/dist/webhooks.d.ts +6 -5
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js.map +1 -1
- package/package.json +3 -2
- package/src/case-envelope.ts +3 -2
- package/src/closed.ts +62 -0
- package/src/decisions.ts +5 -4
- package/src/index.ts +1 -0
- package/src/policies.ts +2 -1
- package/src/webhooks.ts +3 -2
package/dist/case-envelope.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* avatar — since a dangling id is the same defect wherever it appears.
|
|
27
27
|
*/
|
|
28
28
|
import { z } from 'zod';
|
|
29
|
+
import type { Closed } from './closed';
|
|
29
30
|
/**
|
|
30
31
|
* The contract version carried inside the payload.
|
|
31
32
|
*
|
|
@@ -286,13 +287,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
286
287
|
sha256: z.ZodString;
|
|
287
288
|
id: z.ZodString;
|
|
288
289
|
role: z.ZodEnum<{
|
|
289
|
-
|
|
290
|
+
context: "context";
|
|
290
291
|
subject: "subject";
|
|
291
292
|
attachment: "attachment";
|
|
292
|
-
context: "context";
|
|
293
293
|
parent: "parent";
|
|
294
294
|
quoted: "quoted";
|
|
295
295
|
evidence: "evidence";
|
|
296
|
+
metadata: "metadata";
|
|
296
297
|
policy_context: "policy_context";
|
|
297
298
|
}>;
|
|
298
299
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -314,13 +315,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
314
315
|
sha256: z.ZodOptional<z.ZodString>;
|
|
315
316
|
id: z.ZodString;
|
|
316
317
|
role: z.ZodEnum<{
|
|
317
|
-
|
|
318
|
+
context: "context";
|
|
318
319
|
subject: "subject";
|
|
319
320
|
attachment: "attachment";
|
|
320
|
-
context: "context";
|
|
321
321
|
parent: "parent";
|
|
322
322
|
quoted: "quoted";
|
|
323
323
|
evidence: "evidence";
|
|
324
|
+
metadata: "metadata";
|
|
324
325
|
policy_context: "policy_context";
|
|
325
326
|
}>;
|
|
326
327
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -348,13 +349,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
348
349
|
sha256: z.ZodOptional<z.ZodString>;
|
|
349
350
|
id: z.ZodString;
|
|
350
351
|
role: z.ZodEnum<{
|
|
351
|
-
|
|
352
|
+
context: "context";
|
|
352
353
|
subject: "subject";
|
|
353
354
|
attachment: "attachment";
|
|
354
|
-
context: "context";
|
|
355
355
|
parent: "parent";
|
|
356
356
|
quoted: "quoted";
|
|
357
357
|
evidence: "evidence";
|
|
358
|
+
metadata: "metadata";
|
|
358
359
|
policy_context: "policy_context";
|
|
359
360
|
}>;
|
|
360
361
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -379,13 +380,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
379
380
|
sha256: z.ZodOptional<z.ZodString>;
|
|
380
381
|
id: z.ZodString;
|
|
381
382
|
role: z.ZodEnum<{
|
|
382
|
-
|
|
383
|
+
context: "context";
|
|
383
384
|
subject: "subject";
|
|
384
385
|
attachment: "attachment";
|
|
385
|
-
context: "context";
|
|
386
386
|
parent: "parent";
|
|
387
387
|
quoted: "quoted";
|
|
388
388
|
evidence: "evidence";
|
|
389
|
+
metadata: "metadata";
|
|
389
390
|
policy_context: "policy_context";
|
|
390
391
|
}>;
|
|
391
392
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -411,13 +412,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
411
412
|
sha256: z.ZodOptional<z.ZodString>;
|
|
412
413
|
id: z.ZodString;
|
|
413
414
|
role: z.ZodEnum<{
|
|
414
|
-
|
|
415
|
+
context: "context";
|
|
415
416
|
subject: "subject";
|
|
416
417
|
attachment: "attachment";
|
|
417
|
-
context: "context";
|
|
418
418
|
parent: "parent";
|
|
419
419
|
quoted: "quoted";
|
|
420
420
|
evidence: "evidence";
|
|
421
|
+
metadata: "metadata";
|
|
421
422
|
policy_context: "policy_context";
|
|
422
423
|
}>;
|
|
423
424
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -435,13 +436,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
435
436
|
sha256: z.ZodString;
|
|
436
437
|
id: z.ZodString;
|
|
437
438
|
role: z.ZodEnum<{
|
|
438
|
-
|
|
439
|
+
context: "context";
|
|
439
440
|
subject: "subject";
|
|
440
441
|
attachment: "attachment";
|
|
441
|
-
context: "context";
|
|
442
442
|
parent: "parent";
|
|
443
443
|
quoted: "quoted";
|
|
444
444
|
evidence: "evidence";
|
|
445
|
+
metadata: "metadata";
|
|
445
446
|
policy_context: "policy_context";
|
|
446
447
|
}>;
|
|
447
448
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -459,13 +460,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
459
460
|
sha256: z.ZodString;
|
|
460
461
|
id: z.ZodString;
|
|
461
462
|
role: z.ZodEnum<{
|
|
462
|
-
|
|
463
|
+
context: "context";
|
|
463
464
|
subject: "subject";
|
|
464
465
|
attachment: "attachment";
|
|
465
|
-
context: "context";
|
|
466
466
|
parent: "parent";
|
|
467
467
|
quoted: "quoted";
|
|
468
468
|
evidence: "evidence";
|
|
469
|
+
metadata: "metadata";
|
|
469
470
|
policy_context: "policy_context";
|
|
470
471
|
}>;
|
|
471
472
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -480,13 +481,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
480
481
|
sha256: z.ZodString;
|
|
481
482
|
id: z.ZodString;
|
|
482
483
|
role: z.ZodEnum<{
|
|
483
|
-
|
|
484
|
+
context: "context";
|
|
484
485
|
subject: "subject";
|
|
485
486
|
attachment: "attachment";
|
|
486
|
-
context: "context";
|
|
487
487
|
parent: "parent";
|
|
488
488
|
quoted: "quoted";
|
|
489
489
|
evidence: "evidence";
|
|
490
|
+
metadata: "metadata";
|
|
490
491
|
policy_context: "policy_context";
|
|
491
492
|
}>;
|
|
492
493
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -506,13 +507,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
506
507
|
sha256: z.ZodString;
|
|
507
508
|
id: z.ZodString;
|
|
508
509
|
role: z.ZodEnum<{
|
|
509
|
-
|
|
510
|
+
context: "context";
|
|
510
511
|
subject: "subject";
|
|
511
512
|
attachment: "attachment";
|
|
512
|
-
context: "context";
|
|
513
513
|
parent: "parent";
|
|
514
514
|
quoted: "quoted";
|
|
515
515
|
evidence: "evidence";
|
|
516
|
+
metadata: "metadata";
|
|
516
517
|
policy_context: "policy_context";
|
|
517
518
|
}>;
|
|
518
519
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -529,13 +530,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
529
530
|
sha256: z.ZodString;
|
|
530
531
|
id: z.ZodString;
|
|
531
532
|
role: z.ZodEnum<{
|
|
532
|
-
|
|
533
|
+
context: "context";
|
|
533
534
|
subject: "subject";
|
|
534
535
|
attachment: "attachment";
|
|
535
|
-
context: "context";
|
|
536
536
|
parent: "parent";
|
|
537
537
|
quoted: "quoted";
|
|
538
538
|
evidence: "evidence";
|
|
539
|
+
metadata: "metadata";
|
|
539
540
|
policy_context: "policy_context";
|
|
540
541
|
}>;
|
|
541
542
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -548,13 +549,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
548
549
|
sha256: z.ZodString;
|
|
549
550
|
id: z.ZodString;
|
|
550
551
|
role: z.ZodEnum<{
|
|
551
|
-
|
|
552
|
+
context: "context";
|
|
552
553
|
subject: "subject";
|
|
553
554
|
attachment: "attachment";
|
|
554
|
-
context: "context";
|
|
555
555
|
parent: "parent";
|
|
556
556
|
quoted: "quoted";
|
|
557
557
|
evidence: "evidence";
|
|
558
|
+
metadata: "metadata";
|
|
558
559
|
policy_context: "policy_context";
|
|
559
560
|
}>;
|
|
560
561
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -568,13 +569,13 @@ export declare const CaseEnvelopeSchema: z.ZodObject<{
|
|
|
568
569
|
sha256: z.ZodString;
|
|
569
570
|
id: z.ZodString;
|
|
570
571
|
role: z.ZodEnum<{
|
|
571
|
-
|
|
572
|
+
context: "context";
|
|
572
573
|
subject: "subject";
|
|
573
574
|
attachment: "attachment";
|
|
574
|
-
context: "context";
|
|
575
575
|
parent: "parent";
|
|
576
576
|
quoted: "quoted";
|
|
577
577
|
evidence: "evidence";
|
|
578
|
+
metadata: "metadata";
|
|
578
579
|
policy_context: "policy_context";
|
|
579
580
|
}>;
|
|
580
581
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -736,13 +737,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
736
737
|
sha256: z.ZodString;
|
|
737
738
|
id: z.ZodString;
|
|
738
739
|
role: z.ZodEnum<{
|
|
739
|
-
|
|
740
|
+
context: "context";
|
|
740
741
|
subject: "subject";
|
|
741
742
|
attachment: "attachment";
|
|
742
|
-
context: "context";
|
|
743
743
|
parent: "parent";
|
|
744
744
|
quoted: "quoted";
|
|
745
745
|
evidence: "evidence";
|
|
746
|
+
metadata: "metadata";
|
|
746
747
|
policy_context: "policy_context";
|
|
747
748
|
}>;
|
|
748
749
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -764,13 +765,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
764
765
|
sha256: z.ZodOptional<z.ZodString>;
|
|
765
766
|
id: z.ZodString;
|
|
766
767
|
role: z.ZodEnum<{
|
|
767
|
-
|
|
768
|
+
context: "context";
|
|
768
769
|
subject: "subject";
|
|
769
770
|
attachment: "attachment";
|
|
770
|
-
context: "context";
|
|
771
771
|
parent: "parent";
|
|
772
772
|
quoted: "quoted";
|
|
773
773
|
evidence: "evidence";
|
|
774
|
+
metadata: "metadata";
|
|
774
775
|
policy_context: "policy_context";
|
|
775
776
|
}>;
|
|
776
777
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -798,13 +799,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
798
799
|
sha256: z.ZodOptional<z.ZodString>;
|
|
799
800
|
id: z.ZodString;
|
|
800
801
|
role: z.ZodEnum<{
|
|
801
|
-
|
|
802
|
+
context: "context";
|
|
802
803
|
subject: "subject";
|
|
803
804
|
attachment: "attachment";
|
|
804
|
-
context: "context";
|
|
805
805
|
parent: "parent";
|
|
806
806
|
quoted: "quoted";
|
|
807
807
|
evidence: "evidence";
|
|
808
|
+
metadata: "metadata";
|
|
808
809
|
policy_context: "policy_context";
|
|
809
810
|
}>;
|
|
810
811
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -829,13 +830,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
829
830
|
sha256: z.ZodOptional<z.ZodString>;
|
|
830
831
|
id: z.ZodString;
|
|
831
832
|
role: z.ZodEnum<{
|
|
832
|
-
|
|
833
|
+
context: "context";
|
|
833
834
|
subject: "subject";
|
|
834
835
|
attachment: "attachment";
|
|
835
|
-
context: "context";
|
|
836
836
|
parent: "parent";
|
|
837
837
|
quoted: "quoted";
|
|
838
838
|
evidence: "evidence";
|
|
839
|
+
metadata: "metadata";
|
|
839
840
|
policy_context: "policy_context";
|
|
840
841
|
}>;
|
|
841
842
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -861,13 +862,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
861
862
|
sha256: z.ZodOptional<z.ZodString>;
|
|
862
863
|
id: z.ZodString;
|
|
863
864
|
role: z.ZodEnum<{
|
|
864
|
-
|
|
865
|
+
context: "context";
|
|
865
866
|
subject: "subject";
|
|
866
867
|
attachment: "attachment";
|
|
867
|
-
context: "context";
|
|
868
868
|
parent: "parent";
|
|
869
869
|
quoted: "quoted";
|
|
870
870
|
evidence: "evidence";
|
|
871
|
+
metadata: "metadata";
|
|
871
872
|
policy_context: "policy_context";
|
|
872
873
|
}>;
|
|
873
874
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -885,13 +886,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
885
886
|
sha256: z.ZodString;
|
|
886
887
|
id: z.ZodString;
|
|
887
888
|
role: z.ZodEnum<{
|
|
888
|
-
|
|
889
|
+
context: "context";
|
|
889
890
|
subject: "subject";
|
|
890
891
|
attachment: "attachment";
|
|
891
|
-
context: "context";
|
|
892
892
|
parent: "parent";
|
|
893
893
|
quoted: "quoted";
|
|
894
894
|
evidence: "evidence";
|
|
895
|
+
metadata: "metadata";
|
|
895
896
|
policy_context: "policy_context";
|
|
896
897
|
}>;
|
|
897
898
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -909,13 +910,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
909
910
|
sha256: z.ZodString;
|
|
910
911
|
id: z.ZodString;
|
|
911
912
|
role: z.ZodEnum<{
|
|
912
|
-
|
|
913
|
+
context: "context";
|
|
913
914
|
subject: "subject";
|
|
914
915
|
attachment: "attachment";
|
|
915
|
-
context: "context";
|
|
916
916
|
parent: "parent";
|
|
917
917
|
quoted: "quoted";
|
|
918
918
|
evidence: "evidence";
|
|
919
|
+
metadata: "metadata";
|
|
919
920
|
policy_context: "policy_context";
|
|
920
921
|
}>;
|
|
921
922
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -930,13 +931,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
930
931
|
sha256: z.ZodString;
|
|
931
932
|
id: z.ZodString;
|
|
932
933
|
role: z.ZodEnum<{
|
|
933
|
-
|
|
934
|
+
context: "context";
|
|
934
935
|
subject: "subject";
|
|
935
936
|
attachment: "attachment";
|
|
936
|
-
context: "context";
|
|
937
937
|
parent: "parent";
|
|
938
938
|
quoted: "quoted";
|
|
939
939
|
evidence: "evidence";
|
|
940
|
+
metadata: "metadata";
|
|
940
941
|
policy_context: "policy_context";
|
|
941
942
|
}>;
|
|
942
943
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -956,13 +957,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
956
957
|
sha256: z.ZodString;
|
|
957
958
|
id: z.ZodString;
|
|
958
959
|
role: z.ZodEnum<{
|
|
959
|
-
|
|
960
|
+
context: "context";
|
|
960
961
|
subject: "subject";
|
|
961
962
|
attachment: "attachment";
|
|
962
|
-
context: "context";
|
|
963
963
|
parent: "parent";
|
|
964
964
|
quoted: "quoted";
|
|
965
965
|
evidence: "evidence";
|
|
966
|
+
metadata: "metadata";
|
|
966
967
|
policy_context: "policy_context";
|
|
967
968
|
}>;
|
|
968
969
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -979,13 +980,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
979
980
|
sha256: z.ZodString;
|
|
980
981
|
id: z.ZodString;
|
|
981
982
|
role: z.ZodEnum<{
|
|
982
|
-
|
|
983
|
+
context: "context";
|
|
983
984
|
subject: "subject";
|
|
984
985
|
attachment: "attachment";
|
|
985
|
-
context: "context";
|
|
986
986
|
parent: "parent";
|
|
987
987
|
quoted: "quoted";
|
|
988
988
|
evidence: "evidence";
|
|
989
|
+
metadata: "metadata";
|
|
989
990
|
policy_context: "policy_context";
|
|
990
991
|
}>;
|
|
991
992
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -998,13 +999,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
998
999
|
sha256: z.ZodString;
|
|
999
1000
|
id: z.ZodString;
|
|
1000
1001
|
role: z.ZodEnum<{
|
|
1001
|
-
|
|
1002
|
+
context: "context";
|
|
1002
1003
|
subject: "subject";
|
|
1003
1004
|
attachment: "attachment";
|
|
1004
|
-
context: "context";
|
|
1005
1005
|
parent: "parent";
|
|
1006
1006
|
quoted: "quoted";
|
|
1007
1007
|
evidence: "evidence";
|
|
1008
|
+
metadata: "metadata";
|
|
1008
1009
|
policy_context: "policy_context";
|
|
1009
1010
|
}>;
|
|
1010
1011
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -1018,13 +1019,13 @@ export declare const CreateReportRequestSchema: z.ZodObject<{
|
|
|
1018
1019
|
sha256: z.ZodString;
|
|
1019
1020
|
id: z.ZodString;
|
|
1020
1021
|
role: z.ZodEnum<{
|
|
1021
|
-
|
|
1022
|
+
context: "context";
|
|
1022
1023
|
subject: "subject";
|
|
1023
1024
|
attachment: "attachment";
|
|
1024
|
-
context: "context";
|
|
1025
1025
|
parent: "parent";
|
|
1026
1026
|
quoted: "quoted";
|
|
1027
1027
|
evidence: "evidence";
|
|
1028
|
+
metadata: "metadata";
|
|
1028
1029
|
policy_context: "policy_context";
|
|
1029
1030
|
}>;
|
|
1030
1031
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -1126,5 +1127,5 @@ export declare const CreateReportResponseSchema: z.ZodObject<{
|
|
|
1126
1127
|
}>;
|
|
1127
1128
|
merged: z.ZodBoolean;
|
|
1128
1129
|
}, z.core.$loose>;
|
|
1129
|
-
export type CreateReportResponse = z.infer<typeof CreateReportResponseSchema
|
|
1130
|
+
export type CreateReportResponse = Closed<z.infer<typeof CreateReportResponseSchema>>;
|
|
1130
1131
|
//# sourceMappingURL=case-envelope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"case-envelope.d.ts","sourceRoot":"","sources":["../src/case-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"case-envelope.d.ts","sourceRoot":"","sources":["../src/case-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAElE,eAAO,MAAM,+BAA+B,qCAA0C,CAAC;AAEvF,qCAAqC;AACrC,eAAO,MAAM,sBAAsB,sNAYzB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;iBAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,mCAAmC;AACnC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;kBAM5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,+EAMlB,CAAC;AACX,eAAO,MAAM,mBAAmB;;;;;;EAA0B,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,eA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CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC"}
|
package/dist/case-envelope.js
CHANGED
|
@@ -325,7 +325,7 @@ exports.CaseEnvelopeSchema = zod_1.z
|
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const key = `${relation.from}
|
|
328
|
+
const key = `${relation.from}\u0000${relation.type}\u0000${relation.to}`;
|
|
329
329
|
if (seenRelations.has(key)) {
|
|
330
330
|
ctx.addIssue({
|
|
331
331
|
code: 'custom',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"case-envelope.js","sourceRoot":"","sources":["../src/case-envelope.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAEH,6BAAwB;AAExB,6CAOsB;AACtB,yCAAiD;AACjD,2CAMqB;AACrB,yCAAuE;
|
|
1
|
+
{"version":3,"file":"case-envelope.js","sourceRoot":"","sources":["../src/case-envelope.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAEH,6BAAwB;AAExB,6CAOsB;AACtB,yCAAiD;AACjD,2CAMqB;AACrB,yCAAuE;AAGvE;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,qBAAqB,CAAC;AAErD,QAAA,+BAA+B,GAAG,OAAC,CAAC,OAAO,CAAC,oCAA4B,CAAC,CAAC;AAEvF,qCAAqC;AACxB,QAAA,sBAAsB,GAAG;IACpC,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,eAAe;IACf,iBAAiB;CACT,CAAC;AAEX;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,OAAC,CAAC,KAAK,CAAC;IACvC,OAAC,CAAC,IAAI,CAAC,8BAAsB,CAAC;IAC9B,OAAC;SACE,MAAM,EAAE;SACR,GAAG,CAA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,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAGL,0BAA0B;AACb,QAAA,eAAe,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AACpF,QAAA,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,uBAAe,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACU,QAAA,yBAAyB,GAAG,OAAC;KACvC,YAAY,CAAC;IACZ,gBAAgB,EAAE,6BAAgB;IAClC,QAAQ,EAAE,0BAAkB;CAC7B,CAAC;KACD,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IAC5B,IAAI,OAAO,CAAC,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QACnE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC;YACtC,OAAO,EAAE,0CAA0C;SACpD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAGL,6EAA6E;AAChE,QAAA,0BAA0B,GAAG,OAAC,CAAC,WAAW,CAAC;IACtD,QAAQ,EAAE,6BAAgB;IAC1B,MAAM,EAAE,6BAAgB;IACxB,MAAM,EAAE,0BAAkB;IAC1B,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC"}
|
package/dist/closed.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closing the forward-compatibility catchall, at the type level only.
|
|
3
|
+
*
|
|
4
|
+
* The outbound schemas in this package are deliberately loose — see the note in
|
|
5
|
+
* `index.ts`. A decision, a webhook envelope and an event payload all pass
|
|
6
|
+
* unknown fields through, so a newer CrowdSource never breaks an older client
|
|
7
|
+
* and a receiver that persists `event.data` keeps all of it. That runtime
|
|
8
|
+
* behaviour is a requirement (§10.11) and nothing here changes it.
|
|
9
|
+
*
|
|
10
|
+
* What it costs, unmodified, is every field-name check the compiler could have
|
|
11
|
+
* given an integrator. `z.infer` of a loose object carries an index signature,
|
|
12
|
+
* and an index signature makes ANY property access legal:
|
|
13
|
+
*
|
|
14
|
+
* receipt.externalReportId // compiles clean. `undefined` at runtime.
|
|
15
|
+
* decision.decisionId // compiles clean. The field is `id`.
|
|
16
|
+
* decision.policyVersion // compiles clean. The field is `policyVersions`.
|
|
17
|
+
*
|
|
18
|
+
* That is not a rough edge. It silently produces wrong code in the integrator's
|
|
19
|
+
* repository, with no error anywhere, and it is the same shape of defect as a
|
|
20
|
+
* duplicated dependency: the compiler reports success and the failure surfaces
|
|
21
|
+
* later as a value that is mysteriously absent.
|
|
22
|
+
*
|
|
23
|
+
* So the schema stays loose and the exported TYPE is closed. `Closed<T>` strips
|
|
24
|
+
* index signatures from `T` and from everything nested inside it, leaving the
|
|
25
|
+
* fields the contract actually declares — with their optionality, their
|
|
26
|
+
* `readonly` modifiers, and any discriminated union intact. A parse still
|
|
27
|
+
* accepts and preserves unknown fields; naming one you invented no longer
|
|
28
|
+
* compiles. Reaching a field the contract does not declare, deliberately, is
|
|
29
|
+
* what an index-signature access on the parsed value is for.
|
|
30
|
+
*/
|
|
31
|
+
/** `T` without the index signatures a loose object contributes. */
|
|
32
|
+
type StripIndex<T> = {
|
|
33
|
+
[K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `T` with every index signature removed, recursively.
|
|
37
|
+
*
|
|
38
|
+
* Functions and `Date` are returned untouched — mapping over their members would
|
|
39
|
+
* replace them with a structurally similar object that is no longer callable or
|
|
40
|
+
* no longer a `Date`. Arrays are rebuilt so their element type is closed too,
|
|
41
|
+
* preserving whether the array was readonly. Unions distribute, which is what
|
|
42
|
+
* keeps `KnownWebhookEvent` a discriminated union that still narrows on `type`.
|
|
43
|
+
*/
|
|
44
|
+
export type Closed<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer E)[] ? T extends unknown[] ? Closed<E>[] : readonly Closed<E>[] : T extends Date ? T : T extends object ? {
|
|
45
|
+
[K in keyof StripIndex<T>]: Closed<StripIndex<T>[K]>;
|
|
46
|
+
} : T;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=closed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closed.d.ts","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,mEAAmE;AACnE,KAAK,UAAU,CAAC,CAAC,IAAI;KAClB,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAC7B,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,GAC3D,CAAC,GACD,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC5B,CAAC,SAAS,OAAO,EAAE,GACjB,MAAM,CAAC,CAAC,CAAC,EAAE,GACX,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,GACtB,CAAC,SAAS,IAAI,GACZ,CAAC,GACD,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACxD,CAAC,CAAC"}
|
package/dist/closed.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Closing the forward-compatibility catchall, at the type level only.
|
|
4
|
+
*
|
|
5
|
+
* The outbound schemas in this package are deliberately loose — see the note in
|
|
6
|
+
* `index.ts`. A decision, a webhook envelope and an event payload all pass
|
|
7
|
+
* unknown fields through, so a newer CrowdSource never breaks an older client
|
|
8
|
+
* and a receiver that persists `event.data` keeps all of it. That runtime
|
|
9
|
+
* behaviour is a requirement (§10.11) and nothing here changes it.
|
|
10
|
+
*
|
|
11
|
+
* What it costs, unmodified, is every field-name check the compiler could have
|
|
12
|
+
* given an integrator. `z.infer` of a loose object carries an index signature,
|
|
13
|
+
* and an index signature makes ANY property access legal:
|
|
14
|
+
*
|
|
15
|
+
* receipt.externalReportId // compiles clean. `undefined` at runtime.
|
|
16
|
+
* decision.decisionId // compiles clean. The field is `id`.
|
|
17
|
+
* decision.policyVersion // compiles clean. The field is `policyVersions`.
|
|
18
|
+
*
|
|
19
|
+
* That is not a rough edge. It silently produces wrong code in the integrator's
|
|
20
|
+
* repository, with no error anywhere, and it is the same shape of defect as a
|
|
21
|
+
* duplicated dependency: the compiler reports success and the failure surfaces
|
|
22
|
+
* later as a value that is mysteriously absent.
|
|
23
|
+
*
|
|
24
|
+
* So the schema stays loose and the exported TYPE is closed. `Closed<T>` strips
|
|
25
|
+
* index signatures from `T` and from everything nested inside it, leaving the
|
|
26
|
+
* fields the contract actually declares — with their optionality, their
|
|
27
|
+
* `readonly` modifiers, and any discriminated union intact. A parse still
|
|
28
|
+
* accepts and preserves unknown fields; naming one you invented no longer
|
|
29
|
+
* compiles. Reaching a field the contract does not declare, deliberately, is
|
|
30
|
+
* what an index-signature access on the parsed value is for.
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
//# sourceMappingURL=closed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closed.js","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG"}
|
package/dist/decisions.d.ts
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* the inbound rule in `case-envelope.ts`, for the opposite reason.
|
|
20
20
|
*/
|
|
21
21
|
import { z } from 'zod';
|
|
22
|
+
import type { Closed } from './closed';
|
|
22
23
|
/** §3.2 decision states. */
|
|
23
24
|
export declare const DECISION_STATUSES: readonly ["provisional", "final", "superseded", "corrected"];
|
|
24
25
|
export declare const DecisionStatusSchema: z.ZodEnum<{
|
|
@@ -41,8 +42,8 @@ export declare const DecisionOutcomeSchema: z.ZodEnum<{
|
|
|
41
42
|
violation: "violation";
|
|
42
43
|
no_violation: "no_violation";
|
|
43
44
|
insufficient_context: "insufficient_context";
|
|
44
|
-
content_unavailable: "content_unavailable";
|
|
45
45
|
inconclusive: "inconclusive";
|
|
46
|
+
content_unavailable: "content_unavailable";
|
|
46
47
|
duplicate: "duplicate";
|
|
47
48
|
escalated: "escalated";
|
|
48
49
|
}>;
|
|
@@ -138,7 +139,7 @@ export declare const DecisionFindingSchema: z.ZodObject<{
|
|
|
138
139
|
}>>;
|
|
139
140
|
policyRuleIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
141
|
}, z.core.$loose>;
|
|
141
|
-
export type DecisionFinding = z.infer<typeof DecisionFindingSchema
|
|
142
|
+
export type DecisionFinding = Closed<z.infer<typeof DecisionFindingSchema>>;
|
|
142
143
|
/**
|
|
143
144
|
* A recommended action bound to what it applies to (Appendix B).
|
|
144
145
|
*
|
|
@@ -180,7 +181,7 @@ export declare const DecisionRecommendedActionSchema: z.ZodObject<{
|
|
|
180
181
|
}>;
|
|
181
182
|
targetResourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
183
|
}, z.core.$loose>;
|
|
183
|
-
export type DecisionRecommendedAction = z.infer<typeof DecisionRecommendedActionSchema
|
|
184
|
+
export type DecisionRecommendedAction = Closed<z.infer<typeof DecisionRecommendedActionSchema>>;
|
|
184
185
|
/**
|
|
185
186
|
* The panel that produced the decision (Appendix B).
|
|
186
187
|
*
|
|
@@ -201,7 +202,7 @@ export declare const DecisionJurySchema: z.ZodObject<{
|
|
|
201
202
|
agreement: z.ZodNumber;
|
|
202
203
|
specialistPresent: z.ZodBoolean;
|
|
203
204
|
}, z.core.$loose>;
|
|
204
|
-
export type DecisionJury = z.infer<typeof DecisionJurySchema
|
|
205
|
+
export type DecisionJury = Closed<z.infer<typeof DecisionJurySchema>>;
|
|
205
206
|
/**
|
|
206
207
|
* One immutable revision of a case's outcome (Appendix B).
|
|
207
208
|
*
|
|
@@ -224,8 +225,8 @@ export declare const DecisionSchema: z.ZodObject<{
|
|
|
224
225
|
violation: "violation";
|
|
225
226
|
no_violation: "no_violation";
|
|
226
227
|
insufficient_context: "insufficient_context";
|
|
227
|
-
content_unavailable: "content_unavailable";
|
|
228
228
|
inconclusive: "inconclusive";
|
|
229
|
+
content_unavailable: "content_unavailable";
|
|
229
230
|
duplicate: "duplicate";
|
|
230
231
|
escalated: "escalated";
|
|
231
232
|
}>;
|
|
@@ -349,5 +350,5 @@ export declare const DecisionSchema: z.ZodObject<{
|
|
|
349
350
|
supersedesDecisionId: z.ZodOptional<z.ZodString>;
|
|
350
351
|
publishedAt: z.ZodISODateTime;
|
|
351
352
|
}, z.core.$loose>;
|
|
352
|
-
export type Decision = z.infer<typeof DecisionSchema
|
|
353
|
+
export type Decision = Closed<z.infer<typeof DecisionSchema>>;
|
|
353
354
|
//# sourceMappingURL=decisions.d.ts.map
|
package/dist/decisions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCvB,CAAC;AACL,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC"}
|
package/dist/decisions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,6BAAwB;AAExB,6CAAsG;AACtG,yCAA8E;AAC9E,2CAA+C;AAC/C,uCAAqD;AACrD,yCAOoB;
|
|
1
|
+
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,6BAAwB;AAExB,6CAAsG;AACtG,yCAA8E;AAC9E,2CAA+C;AAC/C,uCAAqD;AACrD,yCAOoB;AAGpB,4BAA4B;AACf,QAAA,iBAAiB,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAU,CAAC;AACjF,QAAA,oBAAoB,GAAG,OAAC,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC;AAG9D;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG;IAC/B,WAAW;IACX,cAAc;IACd,sBAAsB;IACtB,cAAc;IACd,qBAAqB;IACrB,WAAW;IACX,WAAW;CACH,CAAC;AACE,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC;AAG/D;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,qBAAqB,GAAG,OAAC,CAAC,WAAW,CAAC;IACjD,IAAI,EAAE,6BAAkB;IACxB,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CA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H,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
__exportStar(require("./closed"), exports);
|
|
51
52
|
__exportStar(require("./primitives"), exports);
|
|
52
53
|
__exportStar(require("./taxonomy"), exports);
|
|
53
54
|
__exportStar(require("./policies"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,kDAAgC;AAChC,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,sDAAoC;AACpC,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,kDAAgC;AAChC,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,sDAAoC;AACpC,gDAA8B"}
|
package/dist/policies.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* decides to evaluate it.
|
|
19
19
|
*/
|
|
20
20
|
import { z } from 'zod';
|
|
21
|
+
import type { Closed } from './closed';
|
|
21
22
|
/** A namespaced policy set id, e.g. `mention.community`. */
|
|
22
23
|
export declare const PolicySetIdSchema: z.ZodString;
|
|
23
24
|
/** A rule id within a policy set, e.g. `mention.harassment.2`. */
|
|
@@ -74,7 +75,7 @@ export declare const DecisionPolicyVersionsSchema: z.ZodObject<{
|
|
|
74
75
|
application: z.ZodString;
|
|
75
76
|
oxyConduct: z.ZodString;
|
|
76
77
|
}, z.core.$loose>;
|
|
77
|
-
export type DecisionPolicyVersions = z.infer<typeof DecisionPolicyVersionsSchema
|
|
78
|
+
export type DecisionPolicyVersions = Closed<z.infer<typeof DecisionPolicyVersionsSchema>>;
|
|
78
79
|
/**
|
|
79
80
|
* The same three versions as carried by the internal reputation event (§11.6).
|
|
80
81
|
*
|
package/dist/policies.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
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AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqC/B,CAAC;AACL,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/policies.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,6BAAwB;AAExB,6CAAmF;AACnF,yCAAyF;
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,6BAAwB;AAExB,6CAAmF;AACnF,yCAAyF;AAGzF,4DAA4D;AAC/C,QAAA,iBAAiB,GAAG,OAAC;KAC/B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,4BAAe,CAAC,qBAAqB,CAAC;KAC1C,KAAK,CACJ,kCAAkC,EAClC,gEAAgE,CACjE,CAAC;AAEJ,kEAAkE;AACrD,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,4BAAe,CAAC,qBAAqB,CAAC;KAC1C,KAAK,CACJ,kCAAkC,EAClC,mEAAmE,CACpE,CAAC;AAEJ;;;;;;;GAOG;AACU,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,8BAA8B,EAC9B,qFAAqF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,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACtC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;gBAC5B,OAAO,EAAE,sBAAsB,IAAI,CAAC,EAAE,GAAG;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/resources.d.ts
CHANGED
|
@@ -43,13 +43,13 @@ export type PrincipalRef = z.infer<typeof PrincipalRefSchema>;
|
|
|
43
43
|
/** §5.2 `role`: why this resource is in the case. */
|
|
44
44
|
export declare const RESOURCE_ROLES: readonly ["subject", "attachment", "context", "parent", "quoted", "evidence", "metadata", "policy_context"];
|
|
45
45
|
export declare const ResourceRoleSchema: z.ZodEnum<{
|
|
46
|
-
|
|
46
|
+
context: "context";
|
|
47
47
|
subject: "subject";
|
|
48
48
|
attachment: "attachment";
|
|
49
|
-
context: "context";
|
|
50
49
|
parent: "parent";
|
|
51
50
|
quoted: "quoted";
|
|
52
51
|
evidence: "evidence";
|
|
52
|
+
metadata: "metadata";
|
|
53
53
|
policy_context: "policy_context";
|
|
54
54
|
}>;
|
|
55
55
|
export type ResourceRole = z.infer<typeof ResourceRoleSchema>;
|
|
@@ -58,12 +58,12 @@ export declare const RESOURCE_TYPES: readonly ["text", "image", "video", "audio"
|
|
|
58
58
|
export declare const ResourceTypeSchema: z.ZodEnum<{
|
|
59
59
|
custom: "custom";
|
|
60
60
|
metadata: "metadata";
|
|
61
|
-
link: "link";
|
|
62
61
|
text: "text";
|
|
63
62
|
image: "image";
|
|
64
63
|
video: "video";
|
|
65
64
|
audio: "audio";
|
|
66
65
|
document: "document";
|
|
66
|
+
link: "link";
|
|
67
67
|
profile: "profile";
|
|
68
68
|
conversation: "conversation";
|
|
69
69
|
listing: "listing";
|
|
@@ -116,13 +116,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
116
116
|
sha256: z.ZodString;
|
|
117
117
|
id: z.ZodString;
|
|
118
118
|
role: z.ZodEnum<{
|
|
119
|
-
|
|
119
|
+
context: "context";
|
|
120
120
|
subject: "subject";
|
|
121
121
|
attachment: "attachment";
|
|
122
|
-
context: "context";
|
|
123
122
|
parent: "parent";
|
|
124
123
|
quoted: "quoted";
|
|
125
124
|
evidence: "evidence";
|
|
125
|
+
metadata: "metadata";
|
|
126
126
|
policy_context: "policy_context";
|
|
127
127
|
}>;
|
|
128
128
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -144,13 +144,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
144
144
|
sha256: z.ZodOptional<z.ZodString>;
|
|
145
145
|
id: z.ZodString;
|
|
146
146
|
role: z.ZodEnum<{
|
|
147
|
-
|
|
147
|
+
context: "context";
|
|
148
148
|
subject: "subject";
|
|
149
149
|
attachment: "attachment";
|
|
150
|
-
context: "context";
|
|
151
150
|
parent: "parent";
|
|
152
151
|
quoted: "quoted";
|
|
153
152
|
evidence: "evidence";
|
|
153
|
+
metadata: "metadata";
|
|
154
154
|
policy_context: "policy_context";
|
|
155
155
|
}>;
|
|
156
156
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -178,13 +178,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
178
178
|
sha256: z.ZodOptional<z.ZodString>;
|
|
179
179
|
id: z.ZodString;
|
|
180
180
|
role: z.ZodEnum<{
|
|
181
|
-
|
|
181
|
+
context: "context";
|
|
182
182
|
subject: "subject";
|
|
183
183
|
attachment: "attachment";
|
|
184
|
-
context: "context";
|
|
185
184
|
parent: "parent";
|
|
186
185
|
quoted: "quoted";
|
|
187
186
|
evidence: "evidence";
|
|
187
|
+
metadata: "metadata";
|
|
188
188
|
policy_context: "policy_context";
|
|
189
189
|
}>;
|
|
190
190
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -209,13 +209,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
209
209
|
sha256: z.ZodOptional<z.ZodString>;
|
|
210
210
|
id: z.ZodString;
|
|
211
211
|
role: z.ZodEnum<{
|
|
212
|
-
|
|
212
|
+
context: "context";
|
|
213
213
|
subject: "subject";
|
|
214
214
|
attachment: "attachment";
|
|
215
|
-
context: "context";
|
|
216
215
|
parent: "parent";
|
|
217
216
|
quoted: "quoted";
|
|
218
217
|
evidence: "evidence";
|
|
218
|
+
metadata: "metadata";
|
|
219
219
|
policy_context: "policy_context";
|
|
220
220
|
}>;
|
|
221
221
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -241,13 +241,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
241
241
|
sha256: z.ZodOptional<z.ZodString>;
|
|
242
242
|
id: z.ZodString;
|
|
243
243
|
role: z.ZodEnum<{
|
|
244
|
-
|
|
244
|
+
context: "context";
|
|
245
245
|
subject: "subject";
|
|
246
246
|
attachment: "attachment";
|
|
247
|
-
context: "context";
|
|
248
247
|
parent: "parent";
|
|
249
248
|
quoted: "quoted";
|
|
250
249
|
evidence: "evidence";
|
|
250
|
+
metadata: "metadata";
|
|
251
251
|
policy_context: "policy_context";
|
|
252
252
|
}>;
|
|
253
253
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -265,13 +265,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
265
265
|
sha256: z.ZodString;
|
|
266
266
|
id: z.ZodString;
|
|
267
267
|
role: z.ZodEnum<{
|
|
268
|
-
|
|
268
|
+
context: "context";
|
|
269
269
|
subject: "subject";
|
|
270
270
|
attachment: "attachment";
|
|
271
|
-
context: "context";
|
|
272
271
|
parent: "parent";
|
|
273
272
|
quoted: "quoted";
|
|
274
273
|
evidence: "evidence";
|
|
274
|
+
metadata: "metadata";
|
|
275
275
|
policy_context: "policy_context";
|
|
276
276
|
}>;
|
|
277
277
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -289,13 +289,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
289
289
|
sha256: z.ZodString;
|
|
290
290
|
id: z.ZodString;
|
|
291
291
|
role: z.ZodEnum<{
|
|
292
|
-
|
|
292
|
+
context: "context";
|
|
293
293
|
subject: "subject";
|
|
294
294
|
attachment: "attachment";
|
|
295
|
-
context: "context";
|
|
296
295
|
parent: "parent";
|
|
297
296
|
quoted: "quoted";
|
|
298
297
|
evidence: "evidence";
|
|
298
|
+
metadata: "metadata";
|
|
299
299
|
policy_context: "policy_context";
|
|
300
300
|
}>;
|
|
301
301
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -310,13 +310,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
310
310
|
sha256: z.ZodString;
|
|
311
311
|
id: z.ZodString;
|
|
312
312
|
role: z.ZodEnum<{
|
|
313
|
-
|
|
313
|
+
context: "context";
|
|
314
314
|
subject: "subject";
|
|
315
315
|
attachment: "attachment";
|
|
316
|
-
context: "context";
|
|
317
316
|
parent: "parent";
|
|
318
317
|
quoted: "quoted";
|
|
319
318
|
evidence: "evidence";
|
|
319
|
+
metadata: "metadata";
|
|
320
320
|
policy_context: "policy_context";
|
|
321
321
|
}>;
|
|
322
322
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -336,13 +336,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
336
336
|
sha256: z.ZodString;
|
|
337
337
|
id: z.ZodString;
|
|
338
338
|
role: z.ZodEnum<{
|
|
339
|
-
|
|
339
|
+
context: "context";
|
|
340
340
|
subject: "subject";
|
|
341
341
|
attachment: "attachment";
|
|
342
|
-
context: "context";
|
|
343
342
|
parent: "parent";
|
|
344
343
|
quoted: "quoted";
|
|
345
344
|
evidence: "evidence";
|
|
345
|
+
metadata: "metadata";
|
|
346
346
|
policy_context: "policy_context";
|
|
347
347
|
}>;
|
|
348
348
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -359,13 +359,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
359
359
|
sha256: z.ZodString;
|
|
360
360
|
id: z.ZodString;
|
|
361
361
|
role: z.ZodEnum<{
|
|
362
|
-
|
|
362
|
+
context: "context";
|
|
363
363
|
subject: "subject";
|
|
364
364
|
attachment: "attachment";
|
|
365
|
-
context: "context";
|
|
366
365
|
parent: "parent";
|
|
367
366
|
quoted: "quoted";
|
|
368
367
|
evidence: "evidence";
|
|
368
|
+
metadata: "metadata";
|
|
369
369
|
policy_context: "policy_context";
|
|
370
370
|
}>;
|
|
371
371
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -378,13 +378,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
378
378
|
sha256: z.ZodString;
|
|
379
379
|
id: z.ZodString;
|
|
380
380
|
role: z.ZodEnum<{
|
|
381
|
-
|
|
381
|
+
context: "context";
|
|
382
382
|
subject: "subject";
|
|
383
383
|
attachment: "attachment";
|
|
384
|
-
context: "context";
|
|
385
384
|
parent: "parent";
|
|
386
385
|
quoted: "quoted";
|
|
387
386
|
evidence: "evidence";
|
|
387
|
+
metadata: "metadata";
|
|
388
388
|
policy_context: "policy_context";
|
|
389
389
|
}>;
|
|
390
390
|
language: z.ZodOptional<z.ZodString>;
|
|
@@ -398,13 +398,13 @@ export declare const ResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
398
398
|
sha256: z.ZodString;
|
|
399
399
|
id: z.ZodString;
|
|
400
400
|
role: z.ZodEnum<{
|
|
401
|
-
|
|
401
|
+
context: "context";
|
|
402
402
|
subject: "subject";
|
|
403
403
|
attachment: "attachment";
|
|
404
|
-
context: "context";
|
|
405
404
|
parent: "parent";
|
|
406
405
|
quoted: "quoted";
|
|
407
406
|
evidence: "evidence";
|
|
407
|
+
metadata: "metadata";
|
|
408
408
|
policy_context: "policy_context";
|
|
409
409
|
}>;
|
|
410
410
|
language: z.ZodOptional<z.ZodString>;
|
package/dist/reviews.d.ts
CHANGED
|
@@ -249,8 +249,8 @@ export type ReviewSubmission = z.infer<typeof ReviewSubmissionSchema>;
|
|
|
249
249
|
*/
|
|
250
250
|
export declare const RECUSAL_REASONS: readonly ["conflict_of_interest", "language", "too_sensitive", "insufficient_context"];
|
|
251
251
|
export declare const RecusalReasonSchema: z.ZodEnum<{
|
|
252
|
-
language: "language";
|
|
253
252
|
insufficient_context: "insufficient_context";
|
|
253
|
+
language: "language";
|
|
254
254
|
conflict_of_interest: "conflict_of_interest";
|
|
255
255
|
too_sensitive: "too_sensitive";
|
|
256
256
|
}>;
|
|
@@ -265,8 +265,8 @@ export type RecusalReason = z.infer<typeof RecusalReasonSchema>;
|
|
|
265
265
|
*/
|
|
266
266
|
export declare const RecusalSubmissionSchema: z.ZodObject<{
|
|
267
267
|
reason: z.ZodEnum<{
|
|
268
|
-
language: "language";
|
|
269
268
|
insufficient_context: "insufficient_context";
|
|
269
|
+
language: "language";
|
|
270
270
|
conflict_of_interest: "conflict_of_interest";
|
|
271
271
|
too_sensitive: "too_sensitive";
|
|
272
272
|
}>;
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* queue the processing" tells receivers to do.
|
|
21
21
|
*/
|
|
22
22
|
import { z } from 'zod';
|
|
23
|
+
import type { Closed } from './closed';
|
|
23
24
|
/** §10.6. */
|
|
24
25
|
export declare const WEBHOOK_EVENT_TYPES: readonly ["report.received", "case.created", "case.escalated", "case.decided", "decision.corrected", "appeal.created", "appeal.decided", "case.closed"];
|
|
25
26
|
export declare const WebhookEventTypeSchema: z.ZodEnum<{
|
|
@@ -55,7 +56,7 @@ export declare const WebhookEventEnvelopeSchema: z.ZodObject<{
|
|
|
55
56
|
organizationId: z.ZodString;
|
|
56
57
|
applicationId: z.ZodString;
|
|
57
58
|
}, z.core.$loose>;
|
|
58
|
-
export type WebhookEventEnvelope = z.infer<typeof WebhookEventEnvelopeSchema
|
|
59
|
+
export type WebhookEventEnvelope = Closed<z.infer<typeof WebhookEventEnvelopeSchema>>;
|
|
59
60
|
/**
|
|
60
61
|
* The eight events of §10.6, discriminated on `type`.
|
|
61
62
|
*
|
|
@@ -118,8 +119,8 @@ export declare const KnownWebhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
118
119
|
violation: "violation";
|
|
119
120
|
no_violation: "no_violation";
|
|
120
121
|
insufficient_context: "insufficient_context";
|
|
121
|
-
content_unavailable: "content_unavailable";
|
|
122
122
|
inconclusive: "inconclusive";
|
|
123
|
+
content_unavailable: "content_unavailable";
|
|
123
124
|
duplicate: "duplicate";
|
|
124
125
|
escalated: "escalated";
|
|
125
126
|
}>;
|
|
@@ -266,8 +267,8 @@ export declare const KnownWebhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
266
267
|
violation: "violation";
|
|
267
268
|
no_violation: "no_violation";
|
|
268
269
|
insufficient_context: "insufficient_context";
|
|
269
|
-
content_unavailable: "content_unavailable";
|
|
270
270
|
inconclusive: "inconclusive";
|
|
271
|
+
content_unavailable: "content_unavailable";
|
|
271
272
|
duplicate: "duplicate";
|
|
272
273
|
escalated: "escalated";
|
|
273
274
|
}>;
|
|
@@ -425,8 +426,8 @@ export declare const KnownWebhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
425
426
|
violation: "violation";
|
|
426
427
|
no_violation: "no_violation";
|
|
427
428
|
insufficient_context: "insufficient_context";
|
|
428
|
-
content_unavailable: "content_unavailable";
|
|
429
429
|
inconclusive: "inconclusive";
|
|
430
|
+
content_unavailable: "content_unavailable";
|
|
430
431
|
duplicate: "duplicate";
|
|
431
432
|
escalated: "escalated";
|
|
432
433
|
}>;
|
|
@@ -565,7 +566,7 @@ export declare const KnownWebhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
565
566
|
organizationId: z.ZodString;
|
|
566
567
|
applicationId: z.ZodString;
|
|
567
568
|
}, z.core.$loose>], "type">;
|
|
568
|
-
export type KnownWebhookEvent = z.infer<typeof KnownWebhookEventSchema
|
|
569
|
+
export type KnownWebhookEvent = Closed<z.infer<typeof KnownWebhookEventSchema>>;
|
|
569
570
|
/** §10.8 headers, in their canonical casing. HTTP header names are case-insensitive; look them up accordingly. */
|
|
570
571
|
export declare const WEBHOOK_EVENT_ID_HEADER = "X-CrowdSource-Event-Id";
|
|
571
572
|
export declare const WEBHOOK_TIMESTAMP_HEADER = "X-CrowdSource-Timestamp";
|
package/dist/webhooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,aAAa;AACb,eAAO,MAAM,mBAAmB,yJAStB,CAAC;AACX,eAAO,MAAM,sBAAsB;;;;;;;;;EAA8B,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sB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,MAAM,CAAC;AAEvD,gDAAgD;AAChD,eAAO,MAAM,4BAA4B,aAEQ,CAAC;AAElD,mEAAmE;AACnE,eAAO,MAAM,4BAA4B,aAE6C,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,SAAS,MAAM,EAO1D,CAAC"}
|
package/dist/webhooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAiLH,8DAEC;AAjLD,6BAAwB;AAExB,mDAA6D;AAC7D,2CAA6C;AAC7C,6CAAiE;AAGjE,aAAa;AACA,QAAA,mBAAmB,GAAG;IACjC,iBAAiB;IACjB,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;CACL,CAAC;AACE,QAAA,sBAAsB,GAAG,OAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,CAAC;AAGlE;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,OAAC;KACvC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,kCAAkC,EAAE,uCAAuC,CAAC,CAAC;AAEtF,MAAM,oBAAoB,GAAG;IAC3B,EAAE,EAAE,6BAAgB;IACpB,SAAS,EAAE,4BAAe;IAC1B,cAAc,EAAE,6BAAgB;IAChC,aAAa,EAAE,6BAAgB;CAChC,CAAC;AAEF;;;;;GAKG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xB,qBAAqB;CACtB,CAAC,CAAC;AAGH,kHAAkH;AACrG,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AACnD,QAAA,wBAAwB,GAAG,yBAAyB,CAAC;AACrD,QAAA,wBAAwB,GAAG,yBAAyB,CAAC;AAElE,qDAAqD;AACxC,QAAA,yBAAyB,GAAG,IAAI,CAAC;AAE9C,qEAAqE;AACxD,QAAA,mCAAmC,GAAG,GAAG,CAAC;AAEvD,gDAAgD;AACnC,QAAA,4BAA4B,GAAG,OAAC;KAC1C,MAAM,EAAE;KACR,KAAK,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC;AAElD,mEAAmE;AACtD,QAAA,4BAA4B,GAAG,OAAC;KAC1C,MAAM,EAAE;KACR,KAAK,CAAC,mBAAmB,EAAE,uDAAuD,CAAC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CAAC,SAAiB,EAAE,OAAe;IAC1E,OAAO,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACU,QAAA,8BAA8B,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC7E,EAAE;IACF,GAAG;IACH,GAAG;IACH,IAAK;IACL,KAAM;IACN,KAAM;CACP,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/crowdsource-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Versioned CrowdSource contracts: case envelope, resources, taxonomy, policies, reviews, decisions, webhooks and reputation events",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"require": "./dist/index.js",
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
15
16
|
},
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "tsc",
|
package/src/case-envelope.ts
CHANGED
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
ResourceSchema,
|
|
46
46
|
} from './resources';
|
|
47
47
|
import { SensitivityHintSchema, TaxonomyCodeSchema } from './taxonomy';
|
|
48
|
+
import type { Closed } from './closed';
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* The contract version carried inside the payload.
|
|
@@ -368,7 +369,7 @@ export const CaseEnvelopeSchema = z
|
|
|
368
369
|
});
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
|
-
const key = `${relation.from}
|
|
372
|
+
const key = `${relation.from}\u0000${relation.type}\u0000${relation.to}`;
|
|
372
373
|
if (seenRelations.has(key)) {
|
|
373
374
|
ctx.addIssue({
|
|
374
375
|
code: 'custom',
|
|
@@ -430,4 +431,4 @@ export const CreateReportResponseSchema = z.looseObject({
|
|
|
430
431
|
status: ReportStatusSchema,
|
|
431
432
|
merged: z.boolean(),
|
|
432
433
|
});
|
|
433
|
-
export type CreateReportResponse = z.infer<typeof CreateReportResponseSchema
|
|
434
|
+
export type CreateReportResponse = Closed<z.infer<typeof CreateReportResponseSchema>>;
|
package/src/closed.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closing the forward-compatibility catchall, at the type level only.
|
|
3
|
+
*
|
|
4
|
+
* The outbound schemas in this package are deliberately loose — see the note in
|
|
5
|
+
* `index.ts`. A decision, a webhook envelope and an event payload all pass
|
|
6
|
+
* unknown fields through, so a newer CrowdSource never breaks an older client
|
|
7
|
+
* and a receiver that persists `event.data` keeps all of it. That runtime
|
|
8
|
+
* behaviour is a requirement (§10.11) and nothing here changes it.
|
|
9
|
+
*
|
|
10
|
+
* What it costs, unmodified, is every field-name check the compiler could have
|
|
11
|
+
* given an integrator. `z.infer` of a loose object carries an index signature,
|
|
12
|
+
* and an index signature makes ANY property access legal:
|
|
13
|
+
*
|
|
14
|
+
* receipt.externalReportId // compiles clean. `undefined` at runtime.
|
|
15
|
+
* decision.decisionId // compiles clean. The field is `id`.
|
|
16
|
+
* decision.policyVersion // compiles clean. The field is `policyVersions`.
|
|
17
|
+
*
|
|
18
|
+
* That is not a rough edge. It silently produces wrong code in the integrator's
|
|
19
|
+
* repository, with no error anywhere, and it is the same shape of defect as a
|
|
20
|
+
* duplicated dependency: the compiler reports success and the failure surfaces
|
|
21
|
+
* later as a value that is mysteriously absent.
|
|
22
|
+
*
|
|
23
|
+
* So the schema stays loose and the exported TYPE is closed. `Closed<T>` strips
|
|
24
|
+
* index signatures from `T` and from everything nested inside it, leaving the
|
|
25
|
+
* fields the contract actually declares — with their optionality, their
|
|
26
|
+
* `readonly` modifiers, and any discriminated union intact. A parse still
|
|
27
|
+
* accepts and preserves unknown fields; naming one you invented no longer
|
|
28
|
+
* compiles. Reaching a field the contract does not declare, deliberately, is
|
|
29
|
+
* what an index-signature access on the parsed value is for.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/** `T` without the index signatures a loose object contributes. */
|
|
33
|
+
type StripIndex<T> = {
|
|
34
|
+
[K in keyof T as string extends K
|
|
35
|
+
? never
|
|
36
|
+
: number extends K
|
|
37
|
+
? never
|
|
38
|
+
: symbol extends K
|
|
39
|
+
? never
|
|
40
|
+
: K]: T[K];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* `T` with every index signature removed, recursively.
|
|
45
|
+
*
|
|
46
|
+
* Functions and `Date` are returned untouched — mapping over their members would
|
|
47
|
+
* replace them with a structurally similar object that is no longer callable or
|
|
48
|
+
* no longer a `Date`. Arrays are rebuilt so their element type is closed too,
|
|
49
|
+
* preserving whether the array was readonly. Unions distribute, which is what
|
|
50
|
+
* keeps `KnownWebhookEvent` a discriminated union that still narrows on `type`.
|
|
51
|
+
*/
|
|
52
|
+
export type Closed<T> = T extends (...args: never[]) => unknown
|
|
53
|
+
? T
|
|
54
|
+
: T extends readonly (infer E)[]
|
|
55
|
+
? T extends unknown[]
|
|
56
|
+
? Closed<E>[]
|
|
57
|
+
: readonly Closed<E>[]
|
|
58
|
+
: T extends Date
|
|
59
|
+
? T
|
|
60
|
+
: T extends object
|
|
61
|
+
? { [K in keyof StripIndex<T>]: Closed<StripIndex<T>[K]> }
|
|
62
|
+
: T;
|
package/src/decisions.ts
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
SeveritySchema,
|
|
34
34
|
TaxonomyCodeSchema,
|
|
35
35
|
} from './taxonomy';
|
|
36
|
+
import type { Closed } from './closed';
|
|
36
37
|
|
|
37
38
|
/** §3.2 decision states. */
|
|
38
39
|
export const DECISION_STATUSES = ['provisional', 'final', 'superseded', 'corrected'] as const;
|
|
@@ -86,7 +87,7 @@ export const DecisionFindingSchema = z.looseObject({
|
|
|
86
87
|
attribution: FindingAttributionSchema.optional(),
|
|
87
88
|
policyRuleIds: z.array(PolicyRuleIdSchema).max(CONTRACT_LIMITS.POLICY_RULE_IDS_MAX).optional(),
|
|
88
89
|
});
|
|
89
|
-
export type DecisionFinding = z.infer<typeof DecisionFindingSchema
|
|
90
|
+
export type DecisionFinding = Closed<z.infer<typeof DecisionFindingSchema>>;
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
93
|
* A recommended action bound to what it applies to (Appendix B).
|
|
@@ -109,7 +110,7 @@ export const DecisionRecommendedActionSchema = z.looseObject({
|
|
|
109
110
|
.max(CONTRACT_LIMITS.RESOURCE_REFS_PER_FINDING_MAX)
|
|
110
111
|
.optional(),
|
|
111
112
|
});
|
|
112
|
-
export type DecisionRecommendedAction = z.infer<typeof DecisionRecommendedActionSchema
|
|
113
|
+
export type DecisionRecommendedAction = Closed<z.infer<typeof DecisionRecommendedActionSchema>>;
|
|
113
114
|
|
|
114
115
|
/** Floating point: `winningVotes / decisiveVotes` will not be exact. */
|
|
115
116
|
const AGREEMENT_TOLERANCE = 1e-6;
|
|
@@ -162,7 +163,7 @@ export const DecisionJurySchema = z
|
|
|
162
163
|
});
|
|
163
164
|
}
|
|
164
165
|
});
|
|
165
|
-
export type DecisionJury = z.infer<typeof DecisionJurySchema
|
|
166
|
+
export type DecisionJury = Closed<z.infer<typeof DecisionJurySchema>>;
|
|
166
167
|
|
|
167
168
|
/**
|
|
168
169
|
* One immutable revision of a case's outcome (Appendix B).
|
|
@@ -213,4 +214,4 @@ export const DecisionSchema = z
|
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
216
|
});
|
|
216
|
-
export type Decision = z.infer<typeof DecisionSchema
|
|
217
|
+
export type Decision = Closed<z.infer<typeof DecisionSchema>>;
|
package/src/index.ts
CHANGED
package/src/policies.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { z } from 'zod';
|
|
|
22
22
|
|
|
23
23
|
import { CONTRACT_LIMITS, LanguageTagSchema, TimestampSchema } from './primitives';
|
|
24
24
|
import { RecommendedActionSchema, SeveritySchema, TaxonomyCodeSchema } from './taxonomy';
|
|
25
|
+
import type { Closed } from './closed';
|
|
25
26
|
|
|
26
27
|
/** A namespaced policy set id, e.g. `mention.community`. */
|
|
27
28
|
export const PolicySetIdSchema = z
|
|
@@ -105,7 +106,7 @@ export const DecisionPolicyVersionsSchema = z.looseObject({
|
|
|
105
106
|
application: PolicyVersionSchema,
|
|
106
107
|
oxyConduct: PolicyVersionSchema,
|
|
107
108
|
});
|
|
108
|
-
export type DecisionPolicyVersions = z.infer<typeof DecisionPolicyVersionsSchema
|
|
109
|
+
export type DecisionPolicyVersions = Closed<z.infer<typeof DecisionPolicyVersionsSchema>>;
|
|
109
110
|
|
|
110
111
|
/**
|
|
111
112
|
* The same three versions as carried by the internal reputation event (§11.6).
|
package/src/webhooks.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { z } from 'zod';
|
|
|
25
25
|
import { CreateReportResponseSchema } from './case-envelope';
|
|
26
26
|
import { DecisionSchema } from './decisions';
|
|
27
27
|
import { IdentifierSchema, TimestampSchema } from './primitives';
|
|
28
|
+
import type { Closed } from './closed';
|
|
28
29
|
|
|
29
30
|
/** §10.6. */
|
|
30
31
|
export const WEBHOOK_EVENT_TYPES = [
|
|
@@ -71,7 +72,7 @@ export const WebhookEventEnvelopeSchema = z.looseObject({
|
|
|
71
72
|
type: AnyWebhookEventTypeSchema,
|
|
72
73
|
data: z.record(z.string(), z.unknown()),
|
|
73
74
|
});
|
|
74
|
-
export type WebhookEventEnvelope = z.infer<typeof WebhookEventEnvelopeSchema
|
|
75
|
+
export type WebhookEventEnvelope = Closed<z.infer<typeof WebhookEventEnvelopeSchema>>;
|
|
75
76
|
|
|
76
77
|
const ReportReceivedEventSchema = z.looseObject({
|
|
77
78
|
...webhookEnvelopeShape,
|
|
@@ -157,7 +158,7 @@ export const KnownWebhookEventSchema = z.discriminatedUnion('type', [
|
|
|
157
158
|
AppealDecidedEventSchema,
|
|
158
159
|
CaseClosedEventSchema,
|
|
159
160
|
]);
|
|
160
|
-
export type KnownWebhookEvent = z.infer<typeof KnownWebhookEventSchema
|
|
161
|
+
export type KnownWebhookEvent = Closed<z.infer<typeof KnownWebhookEventSchema>>;
|
|
161
162
|
|
|
162
163
|
/** §10.8 headers, in their canonical casing. HTTP header names are case-insensitive; look them up accordingly. */
|
|
163
164
|
export const WEBHOOK_EVENT_ID_HEADER = 'X-CrowdSource-Event-Id';
|