@disclosureos/records 1.0.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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/attachment-Hrg8uHuf.d.ts +23 -0
- package/dist/confidence-level-CV3P1W5_.d.ts +25 -0
- package/dist/constants/index.d.ts +28 -0
- package/dist/constants/index.js +885 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/credibility-CcQ0MUfQ.d.ts +14 -0
- package/dist/digital-ADBJTqSi.d.ts +278 -0
- package/dist/domains-CjIFZGBh.d.ts +330 -0
- package/dist/enum-guard-DzPkp2oJ.d.ts +101 -0
- package/dist/extensions/document/index.d.ts +47 -0
- package/dist/extensions/document/index.js +31 -0
- package/dist/extensions/document/index.js.map +1 -0
- package/dist/extensions/identifiers/index.d.ts +139 -0
- package/dist/extensions/identifiers/index.js +47 -0
- package/dist/extensions/identifiers/index.js.map +1 -0
- package/dist/extensions/physical/index.d.ts +84 -0
- package/dist/extensions/physical/index.js +84 -0
- package/dist/extensions/physical/index.js.map +1 -0
- package/dist/extensions/provenance/index.d.ts +153 -0
- package/dist/extensions/provenance/index.js +120 -0
- package/dist/extensions/provenance/index.js.map +1 -0
- package/dist/extensions/testimony/index.d.ts +400 -0
- package/dist/extensions/testimony/index.js +203 -0
- package/dist/extensions/testimony/index.js.map +1 -0
- package/dist/factories/index.d.ts +31 -0
- package/dist/factories/index.js +905 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/formatters/index.d.ts +18 -0
- package/dist/formatters/index.js +156 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/geo/index.d.ts +16 -0
- package/dist/geo/index.js +146 -0
- package/dist/geo/index.js.map +1 -0
- package/dist/guards/index.d.ts +74 -0
- package/dist/guards/index.js +892 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1350 -0
- package/dist/index.js.map +1 -0
- package/dist/labels/index.d.ts +33 -0
- package/dist/labels/index.js +181 -0
- package/dist/labels/index.js.map +1 -0
- package/dist/location-56xtMNtC.d.ts +408 -0
- package/dist/media/index.d.ts +3 -0
- package/dist/media/index.js +21 -0
- package/dist/media/index.js.map +1 -0
- package/dist/observation/index.d.ts +7 -0
- package/dist/observation/index.js +865 -0
- package/dist/observation/index.js.map +1 -0
- package/dist/shared/index.d.ts +29 -0
- package/dist/shared/index.js +87 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/source/index.d.ts +51 -0
- package/dist/source/index.js +45 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/sensor/index.d.ts +170 -0
- package/dist/source/sensor/index.js +69 -0
- package/dist/source/sensor/index.js.map +1 -0
- package/dist/temporal/index.d.ts +20 -0
- package/dist/temporal/index.js +78 -0
- package/dist/temporal/index.js.map +1 -0
- package/dist/temporal-data-t8Mzu8Ui.d.ts +148 -0
- package/dist/time-of-day-DLDBwTrn.d.ts +165 -0
- package/dist/types-CzNfaip-.d.ts +1267 -0
- package/dist/types-DH_-SdHj.d.ts +11 -0
- package/dist/types-clxXEQOH.d.ts +27 -0
- package/dist/validation-C-_QLXXf.d.ts +34 -0
- package/dist/validators/index.d.ts +15 -0
- package/dist/validators/index.js +895 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +146 -0
- package/schema/records.schema.json +2538 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const MediaTypeSchema: z.ZodEnum<{
|
|
4
|
+
image: "image";
|
|
5
|
+
video: "video";
|
|
6
|
+
document: "document";
|
|
7
|
+
audio: "audio";
|
|
8
|
+
}>;
|
|
9
|
+
type MediaType = z.infer<typeof MediaTypeSchema>;
|
|
10
|
+
|
|
11
|
+
export { type MediaType as M, MediaTypeSchema as a };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const SourceTypeSchema: z.ZodEnum<{
|
|
4
|
+
other: "other";
|
|
5
|
+
foia: "foia";
|
|
6
|
+
official_report: "official_report";
|
|
7
|
+
official_statement: "official_statement";
|
|
8
|
+
congressional_testimony: "congressional_testimony";
|
|
9
|
+
congressional_report: "congressional_report";
|
|
10
|
+
military_document: "military_document";
|
|
11
|
+
intelligence_document: "intelligence_document";
|
|
12
|
+
whistleblower: "whistleblower";
|
|
13
|
+
firsthand_witness: "firsthand_witness";
|
|
14
|
+
secondhand_account: "secondhand_account";
|
|
15
|
+
news_article: "news_article";
|
|
16
|
+
documentary: "documentary";
|
|
17
|
+
interview: "interview";
|
|
18
|
+
book: "book";
|
|
19
|
+
academic_paper: "academic_paper";
|
|
20
|
+
investigation_report: "investigation_report";
|
|
21
|
+
database_entry: "database_entry";
|
|
22
|
+
social_media: "social_media";
|
|
23
|
+
website: "website";
|
|
24
|
+
}>;
|
|
25
|
+
type SourceType = z.infer<typeof SourceTypeSchema>;
|
|
26
|
+
|
|
27
|
+
export { type SourceType as S, SourceTypeSchema as a };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ZodError } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A single, flat validation problem. Shared by the hand-rolled
|
|
5
|
+
* `validateObservation` and the schema-driven path so every package speaks one
|
|
6
|
+
* issue shape (`{ path, message }`).
|
|
7
|
+
*/
|
|
8
|
+
interface ValidationIssue {
|
|
9
|
+
path: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Map a `ZodError` into the ecosystem's flat issue shape. Lets schema-based
|
|
14
|
+
* validation and the legacy hand-rolled validator return identical structures.
|
|
15
|
+
*/
|
|
16
|
+
declare function issuesFrom(error: ZodError): ValidationIssue[];
|
|
17
|
+
/**
|
|
18
|
+
* Validate a value against any Zod schema and return the flat issue list (empty
|
|
19
|
+
* when valid) — the ecosystem's single validation contract, so the per-package
|
|
20
|
+
* `validateX` functions don't each re-write `safeParse` + `issuesFrom`.
|
|
21
|
+
*
|
|
22
|
+
* Typed STRUCTURALLY (just needs `.safeParse`) so it stays free of Zod's
|
|
23
|
+
* cross-package version brand when called from `observables`/`origins`.
|
|
24
|
+
*/
|
|
25
|
+
declare function validateWith(schema: {
|
|
26
|
+
safeParse(value: unknown): {
|
|
27
|
+
success: true;
|
|
28
|
+
} | {
|
|
29
|
+
success: false;
|
|
30
|
+
error: ZodError;
|
|
31
|
+
};
|
|
32
|
+
}, value: unknown): ValidationIssue[];
|
|
33
|
+
|
|
34
|
+
export { type ValidationIssue as V, issuesFrom as i, validateWith as v };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { V as ValidationIssue } from '../validation-C-_QLXXf.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
|
|
4
|
+
declare function isValidLatitude(lat: number): boolean;
|
|
5
|
+
declare function isValidLongitude(lng: number): boolean;
|
|
6
|
+
declare function isValidISODate(date: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Validate an observation against the single source of truth ({@link ObservationSchema}).
|
|
9
|
+
* Returns a flat list of issues (empty when valid). Satellite slots
|
|
10
|
+
* (`observableAssessments`, `origin`, …) are not part of the core schema and are
|
|
11
|
+
* validated by their owning packages; they are ignored here, not rejected.
|
|
12
|
+
*/
|
|
13
|
+
declare function validateObservation(obs: unknown): ValidationIssue[];
|
|
14
|
+
|
|
15
|
+
export { ValidationIssue, isValidISODate, isValidLatitude, isValidLongitude, validateObservation };
|