@disclosureos/records 1.1.0 → 2.0.0-beta.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.
@@ -0,0 +1,828 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string",
7
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
8
+ },
9
+ "eventTime": {
10
+ "oneOf": [
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "state": {
15
+ "type": "string",
16
+ "const": "known"
17
+ },
18
+ "value": {
19
+ "oneOf": [
20
+ {
21
+ "type": "object",
22
+ "properties": {
23
+ "kind": {
24
+ "type": "string",
25
+ "const": "year"
26
+ },
27
+ "value": {
28
+ "type": "string",
29
+ "pattern": "^(?!0000)[0-9]{4}$"
30
+ }
31
+ },
32
+ "required": [
33
+ "kind",
34
+ "value"
35
+ ],
36
+ "additionalProperties": false
37
+ },
38
+ {
39
+ "type": "object",
40
+ "properties": {
41
+ "kind": {
42
+ "type": "string",
43
+ "const": "month"
44
+ },
45
+ "value": {
46
+ "type": "string",
47
+ "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$"
48
+ }
49
+ },
50
+ "required": [
51
+ "kind",
52
+ "value"
53
+ ],
54
+ "additionalProperties": false
55
+ },
56
+ {
57
+ "type": "object",
58
+ "properties": {
59
+ "kind": {
60
+ "type": "string",
61
+ "const": "date"
62
+ },
63
+ "value": {
64
+ "type": "string",
65
+ "allOf": [
66
+ {
67
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
68
+ },
69
+ {
70
+ "pattern": "^(?!0000)"
71
+ }
72
+ ]
73
+ }
74
+ },
75
+ "required": [
76
+ "kind",
77
+ "value"
78
+ ],
79
+ "additionalProperties": false
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "kind": {
85
+ "type": "string",
86
+ "const": "instant"
87
+ },
88
+ "value": {
89
+ "type": "string",
90
+ "allOf": [
91
+ {
92
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
93
+ },
94
+ {
95
+ "pattern": "^(?!0000)"
96
+ }
97
+ ]
98
+ },
99
+ "timeScale": {
100
+ "type": "string",
101
+ "const": "UTC"
102
+ }
103
+ },
104
+ "required": [
105
+ "kind",
106
+ "value",
107
+ "timeScale"
108
+ ],
109
+ "additionalProperties": false
110
+ }
111
+ ]
112
+ },
113
+ "sourceRefs": {
114
+ "minItems": 1,
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string",
118
+ "pattern": "^(source|product|assertion):[^\\s:]+$"
119
+ }
120
+ }
121
+ },
122
+ "required": [
123
+ "state",
124
+ "value",
125
+ "sourceRefs"
126
+ ],
127
+ "additionalProperties": false
128
+ },
129
+ {
130
+ "type": "object",
131
+ "properties": {
132
+ "state": {
133
+ "type": "string",
134
+ "const": "approximate"
135
+ },
136
+ "value": {
137
+ "oneOf": [
138
+ {
139
+ "type": "object",
140
+ "properties": {
141
+ "kind": {
142
+ "type": "string",
143
+ "const": "year"
144
+ },
145
+ "value": {
146
+ "type": "string",
147
+ "pattern": "^(?!0000)[0-9]{4}$"
148
+ }
149
+ },
150
+ "required": [
151
+ "kind",
152
+ "value"
153
+ ],
154
+ "additionalProperties": false
155
+ },
156
+ {
157
+ "type": "object",
158
+ "properties": {
159
+ "kind": {
160
+ "type": "string",
161
+ "const": "month"
162
+ },
163
+ "value": {
164
+ "type": "string",
165
+ "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$"
166
+ }
167
+ },
168
+ "required": [
169
+ "kind",
170
+ "value"
171
+ ],
172
+ "additionalProperties": false
173
+ },
174
+ {
175
+ "type": "object",
176
+ "properties": {
177
+ "kind": {
178
+ "type": "string",
179
+ "const": "date"
180
+ },
181
+ "value": {
182
+ "type": "string",
183
+ "allOf": [
184
+ {
185
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
186
+ },
187
+ {
188
+ "pattern": "^(?!0000)"
189
+ }
190
+ ]
191
+ }
192
+ },
193
+ "required": [
194
+ "kind",
195
+ "value"
196
+ ],
197
+ "additionalProperties": false
198
+ },
199
+ {
200
+ "type": "object",
201
+ "properties": {
202
+ "kind": {
203
+ "type": "string",
204
+ "const": "instant"
205
+ },
206
+ "value": {
207
+ "type": "string",
208
+ "allOf": [
209
+ {
210
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
211
+ },
212
+ {
213
+ "pattern": "^(?!0000)"
214
+ }
215
+ ]
216
+ },
217
+ "timeScale": {
218
+ "type": "string",
219
+ "const": "UTC"
220
+ }
221
+ },
222
+ "required": [
223
+ "kind",
224
+ "value",
225
+ "timeScale"
226
+ ],
227
+ "additionalProperties": false
228
+ }
229
+ ]
230
+ },
231
+ "sourceRefs": {
232
+ "minItems": 1,
233
+ "type": "array",
234
+ "items": {
235
+ "type": "string",
236
+ "pattern": "^(source|product|assertion):[^\\s:]+$"
237
+ }
238
+ },
239
+ "precision": {
240
+ "type": "string",
241
+ "minLength": 1,
242
+ "pattern": "\\S"
243
+ }
244
+ },
245
+ "required": [
246
+ "state",
247
+ "value",
248
+ "sourceRefs",
249
+ "precision"
250
+ ],
251
+ "additionalProperties": false
252
+ },
253
+ {
254
+ "type": "object",
255
+ "properties": {
256
+ "state": {
257
+ "type": "string",
258
+ "const": "unknown"
259
+ },
260
+ "reason": {
261
+ "type": "string",
262
+ "enum": [
263
+ "not_recorded",
264
+ "not_collected",
265
+ "unavailable"
266
+ ]
267
+ }
268
+ },
269
+ "required": [
270
+ "state",
271
+ "reason"
272
+ ],
273
+ "additionalProperties": false
274
+ },
275
+ {
276
+ "type": "object",
277
+ "properties": {
278
+ "state": {
279
+ "type": "string",
280
+ "const": "redacted"
281
+ },
282
+ "reason": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "pattern": "\\S"
286
+ }
287
+ },
288
+ "required": [
289
+ "state",
290
+ "reason"
291
+ ],
292
+ "additionalProperties": false
293
+ }
294
+ ]
295
+ },
296
+ "position": {
297
+ "oneOf": [
298
+ {
299
+ "type": "object",
300
+ "properties": {
301
+ "state": {
302
+ "type": "string",
303
+ "const": "known"
304
+ },
305
+ "value": {
306
+ "type": "object",
307
+ "properties": {
308
+ "latitude": {
309
+ "type": "number",
310
+ "minimum": -90,
311
+ "maximum": 90
312
+ },
313
+ "longitude": {
314
+ "type": "number",
315
+ "minimum": -180,
316
+ "maximum": 180
317
+ },
318
+ "datum": {
319
+ "type": "string",
320
+ "const": "WGS84"
321
+ }
322
+ },
323
+ "required": [
324
+ "latitude",
325
+ "longitude",
326
+ "datum"
327
+ ],
328
+ "additionalProperties": false
329
+ },
330
+ "sourceRefs": {
331
+ "minItems": 1,
332
+ "type": "array",
333
+ "items": {
334
+ "type": "string",
335
+ "pattern": "^(source|product|assertion):[^\\s:]+$"
336
+ }
337
+ }
338
+ },
339
+ "required": [
340
+ "state",
341
+ "value",
342
+ "sourceRefs"
343
+ ],
344
+ "additionalProperties": false
345
+ },
346
+ {
347
+ "type": "object",
348
+ "properties": {
349
+ "state": {
350
+ "type": "string",
351
+ "const": "approximate"
352
+ },
353
+ "value": {
354
+ "type": "object",
355
+ "properties": {
356
+ "latitude": {
357
+ "type": "number",
358
+ "minimum": -90,
359
+ "maximum": 90
360
+ },
361
+ "longitude": {
362
+ "type": "number",
363
+ "minimum": -180,
364
+ "maximum": 180
365
+ },
366
+ "datum": {
367
+ "type": "string",
368
+ "const": "WGS84"
369
+ }
370
+ },
371
+ "required": [
372
+ "latitude",
373
+ "longitude",
374
+ "datum"
375
+ ],
376
+ "additionalProperties": false
377
+ },
378
+ "sourceRefs": {
379
+ "minItems": 1,
380
+ "type": "array",
381
+ "items": {
382
+ "type": "string",
383
+ "pattern": "^(source|product|assertion):[^\\s:]+$"
384
+ }
385
+ },
386
+ "precision": {
387
+ "type": "string",
388
+ "minLength": 1,
389
+ "pattern": "\\S"
390
+ }
391
+ },
392
+ "required": [
393
+ "state",
394
+ "value",
395
+ "sourceRefs",
396
+ "precision"
397
+ ],
398
+ "additionalProperties": false
399
+ },
400
+ {
401
+ "type": "object",
402
+ "properties": {
403
+ "state": {
404
+ "type": "string",
405
+ "const": "unknown"
406
+ },
407
+ "reason": {
408
+ "type": "string",
409
+ "enum": [
410
+ "not_recorded",
411
+ "not_collected",
412
+ "unavailable"
413
+ ]
414
+ }
415
+ },
416
+ "required": [
417
+ "state",
418
+ "reason"
419
+ ],
420
+ "additionalProperties": false
421
+ },
422
+ {
423
+ "type": "object",
424
+ "properties": {
425
+ "state": {
426
+ "type": "string",
427
+ "const": "redacted"
428
+ },
429
+ "reason": {
430
+ "type": "string",
431
+ "minLength": 1,
432
+ "pattern": "\\S"
433
+ }
434
+ },
435
+ "required": [
436
+ "state",
437
+ "reason"
438
+ ],
439
+ "additionalProperties": false
440
+ }
441
+ ]
442
+ },
443
+ "assertions": {
444
+ "type": "array",
445
+ "items": {
446
+ "oneOf": [
447
+ {
448
+ "type": "object",
449
+ "properties": {
450
+ "id": {
451
+ "type": "string",
452
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
453
+ },
454
+ "field": {
455
+ "type": "string",
456
+ "const": "eventTime"
457
+ },
458
+ "value": {
459
+ "oneOf": [
460
+ {
461
+ "type": "object",
462
+ "properties": {
463
+ "kind": {
464
+ "type": "string",
465
+ "const": "year"
466
+ },
467
+ "value": {
468
+ "type": "string",
469
+ "pattern": "^(?!0000)[0-9]{4}$"
470
+ }
471
+ },
472
+ "required": [
473
+ "kind",
474
+ "value"
475
+ ],
476
+ "additionalProperties": false
477
+ },
478
+ {
479
+ "type": "object",
480
+ "properties": {
481
+ "kind": {
482
+ "type": "string",
483
+ "const": "month"
484
+ },
485
+ "value": {
486
+ "type": "string",
487
+ "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$"
488
+ }
489
+ },
490
+ "required": [
491
+ "kind",
492
+ "value"
493
+ ],
494
+ "additionalProperties": false
495
+ },
496
+ {
497
+ "type": "object",
498
+ "properties": {
499
+ "kind": {
500
+ "type": "string",
501
+ "const": "date"
502
+ },
503
+ "value": {
504
+ "type": "string",
505
+ "allOf": [
506
+ {
507
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
508
+ },
509
+ {
510
+ "pattern": "^(?!0000)"
511
+ }
512
+ ]
513
+ }
514
+ },
515
+ "required": [
516
+ "kind",
517
+ "value"
518
+ ],
519
+ "additionalProperties": false
520
+ },
521
+ {
522
+ "type": "object",
523
+ "properties": {
524
+ "kind": {
525
+ "type": "string",
526
+ "const": "instant"
527
+ },
528
+ "value": {
529
+ "type": "string",
530
+ "allOf": [
531
+ {
532
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
533
+ },
534
+ {
535
+ "pattern": "^(?!0000)"
536
+ }
537
+ ]
538
+ },
539
+ "timeScale": {
540
+ "type": "string",
541
+ "const": "UTC"
542
+ }
543
+ },
544
+ "required": [
545
+ "kind",
546
+ "value",
547
+ "timeScale"
548
+ ],
549
+ "additionalProperties": false
550
+ }
551
+ ]
552
+ },
553
+ "provenance": {
554
+ "type": "object",
555
+ "properties": {
556
+ "sourceRef": {
557
+ "type": "string",
558
+ "pattern": "^(source|product):[^\\s:]+$"
559
+ },
560
+ "sourceDigest": {
561
+ "type": "object",
562
+ "properties": {
563
+ "algorithm": {
564
+ "type": "string",
565
+ "const": "sha256"
566
+ },
567
+ "value": {
568
+ "type": "string",
569
+ "pattern": "^[a-f0-9]{64}$"
570
+ }
571
+ },
572
+ "required": [
573
+ "algorithm",
574
+ "value"
575
+ ],
576
+ "additionalProperties": false
577
+ },
578
+ "locator": {
579
+ "oneOf": [
580
+ {
581
+ "type": "object",
582
+ "properties": {
583
+ "kind": {
584
+ "type": "string",
585
+ "const": "page"
586
+ },
587
+ "page": {
588
+ "type": "integer",
589
+ "minimum": 1,
590
+ "maximum": 9007199254740991
591
+ }
592
+ },
593
+ "required": [
594
+ "kind",
595
+ "page"
596
+ ],
597
+ "additionalProperties": false
598
+ },
599
+ {
600
+ "type": "object",
601
+ "properties": {
602
+ "kind": {
603
+ "type": "string",
604
+ "const": "time_range"
605
+ },
606
+ "startSeconds": {
607
+ "type": "number",
608
+ "minimum": 0
609
+ },
610
+ "endSeconds": {
611
+ "type": "number",
612
+ "minimum": 0
613
+ }
614
+ },
615
+ "required": [
616
+ "kind",
617
+ "startSeconds",
618
+ "endSeconds"
619
+ ],
620
+ "additionalProperties": false
621
+ },
622
+ {
623
+ "type": "object",
624
+ "properties": {
625
+ "kind": {
626
+ "type": "string",
627
+ "const": "json_pointer"
628
+ },
629
+ "pointer": {
630
+ "type": "string",
631
+ "pattern": "^(?:\\/(?:[^~]|~[01])*)?(?![\\s\\S])"
632
+ }
633
+ },
634
+ "required": [
635
+ "kind",
636
+ "pointer"
637
+ ],
638
+ "additionalProperties": false
639
+ }
640
+ ]
641
+ },
642
+ "attributedTo": {
643
+ "type": "string",
644
+ "minLength": 1,
645
+ "pattern": "\\S"
646
+ },
647
+ "extractedBy": {
648
+ "type": "string",
649
+ "minLength": 1,
650
+ "pattern": "\\S"
651
+ }
652
+ },
653
+ "required": [
654
+ "sourceRef"
655
+ ],
656
+ "additionalProperties": false
657
+ }
658
+ },
659
+ "required": [
660
+ "id",
661
+ "field",
662
+ "value",
663
+ "provenance"
664
+ ],
665
+ "additionalProperties": false
666
+ },
667
+ {
668
+ "type": "object",
669
+ "properties": {
670
+ "id": {
671
+ "type": "string",
672
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
673
+ },
674
+ "field": {
675
+ "type": "string",
676
+ "const": "position"
677
+ },
678
+ "value": {
679
+ "type": "object",
680
+ "properties": {
681
+ "latitude": {
682
+ "type": "number",
683
+ "minimum": -90,
684
+ "maximum": 90
685
+ },
686
+ "longitude": {
687
+ "type": "number",
688
+ "minimum": -180,
689
+ "maximum": 180
690
+ },
691
+ "datum": {
692
+ "type": "string",
693
+ "const": "WGS84"
694
+ }
695
+ },
696
+ "required": [
697
+ "latitude",
698
+ "longitude",
699
+ "datum"
700
+ ],
701
+ "additionalProperties": false
702
+ },
703
+ "provenance": {
704
+ "type": "object",
705
+ "properties": {
706
+ "sourceRef": {
707
+ "type": "string",
708
+ "pattern": "^(source|product):[^\\s:]+$"
709
+ },
710
+ "sourceDigest": {
711
+ "type": "object",
712
+ "properties": {
713
+ "algorithm": {
714
+ "type": "string",
715
+ "const": "sha256"
716
+ },
717
+ "value": {
718
+ "type": "string",
719
+ "pattern": "^[a-f0-9]{64}$"
720
+ }
721
+ },
722
+ "required": [
723
+ "algorithm",
724
+ "value"
725
+ ],
726
+ "additionalProperties": false
727
+ },
728
+ "locator": {
729
+ "oneOf": [
730
+ {
731
+ "type": "object",
732
+ "properties": {
733
+ "kind": {
734
+ "type": "string",
735
+ "const": "page"
736
+ },
737
+ "page": {
738
+ "type": "integer",
739
+ "minimum": 1,
740
+ "maximum": 9007199254740991
741
+ }
742
+ },
743
+ "required": [
744
+ "kind",
745
+ "page"
746
+ ],
747
+ "additionalProperties": false
748
+ },
749
+ {
750
+ "type": "object",
751
+ "properties": {
752
+ "kind": {
753
+ "type": "string",
754
+ "const": "time_range"
755
+ },
756
+ "startSeconds": {
757
+ "type": "number",
758
+ "minimum": 0
759
+ },
760
+ "endSeconds": {
761
+ "type": "number",
762
+ "minimum": 0
763
+ }
764
+ },
765
+ "required": [
766
+ "kind",
767
+ "startSeconds",
768
+ "endSeconds"
769
+ ],
770
+ "additionalProperties": false
771
+ },
772
+ {
773
+ "type": "object",
774
+ "properties": {
775
+ "kind": {
776
+ "type": "string",
777
+ "const": "json_pointer"
778
+ },
779
+ "pointer": {
780
+ "type": "string",
781
+ "pattern": "^(?:\\/(?:[^~]|~[01])*)?(?![\\s\\S])"
782
+ }
783
+ },
784
+ "required": [
785
+ "kind",
786
+ "pointer"
787
+ ],
788
+ "additionalProperties": false
789
+ }
790
+ ]
791
+ },
792
+ "attributedTo": {
793
+ "type": "string",
794
+ "minLength": 1,
795
+ "pattern": "\\S"
796
+ },
797
+ "extractedBy": {
798
+ "type": "string",
799
+ "minLength": 1,
800
+ "pattern": "\\S"
801
+ }
802
+ },
803
+ "required": [
804
+ "sourceRef"
805
+ ],
806
+ "additionalProperties": false
807
+ }
808
+ },
809
+ "required": [
810
+ "id",
811
+ "field",
812
+ "value",
813
+ "provenance"
814
+ ],
815
+ "additionalProperties": false
816
+ }
817
+ ]
818
+ }
819
+ }
820
+ },
821
+ "required": [
822
+ "id",
823
+ "eventTime",
824
+ "position"
825
+ ],
826
+ "additionalProperties": false,
827
+ "$id": "urn:disclosureos:experimental:records-v2-primitives:0.1.0"
828
+ }