@disclosureos/records 1.0.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.
- package/CHANGELOG.md +36 -0
- package/README.md +11 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +28 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/{enum-guard-DzPkp2oJ.d.ts → enum-guard-Myp2-SoT.d.ts} +23 -1
- package/dist/experimental/v2/index.d.ts +4419 -0
- package/dist/experimental/v2/index.js +645 -0
- package/dist/experimental/v2/index.js.map +1 -0
- package/dist/factories/index.d.ts +1 -1
- package/dist/factories/index.js +28 -0
- package/dist/factories/index.js.map +1 -1
- package/dist/guards/index.d.ts +2 -2
- package/dist/guards/index.js +28 -0
- package/dist/guards/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +44 -2
- package/dist/index.js.map +1 -1
- package/dist/labels/index.d.ts +1 -1
- package/dist/observation/index.d.ts +1 -1
- package/dist/observation/index.js +28 -0
- package/dist/observation/index.js.map +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +15 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/source/sensor/index.d.ts +77 -0
- package/dist/source/sensor/index.js +28 -0
- package/dist/source/sensor/index.js.map +1 -1
- package/dist/{types-CzNfaip-.d.ts → types-Dp7GbYBS.d.ts} +26 -0
- package/dist/validators/index.js +28 -0
- package/dist/validators/index.js.map +1 -1
- package/package.json +16 -4
- package/schema/experimental/claim-history-0.1.0.schema.json +6545 -0
- package/schema/experimental/observation-0.1.0.schema.json +6040 -0
- package/schema/experimental/v2-primitives-0.2.0.schema.json +1761 -0
- package/schema/experimental/v2-primitives.schema.json +828 -0
- package/schema/records.schema.json +31 -2
package/dist/index.js
CHANGED
|
@@ -239,6 +239,13 @@ var DetectionMethodSchema = z.enum([
|
|
|
239
239
|
"lidar",
|
|
240
240
|
"spectroscopic",
|
|
241
241
|
"radio_frequency",
|
|
242
|
+
"particle",
|
|
243
|
+
"gnss",
|
|
244
|
+
"time_reference",
|
|
245
|
+
"chemical",
|
|
246
|
+
"inertial",
|
|
247
|
+
"physiological",
|
|
248
|
+
"pressure",
|
|
242
249
|
"multiple",
|
|
243
250
|
"other",
|
|
244
251
|
"unknown"
|
|
@@ -259,12 +266,33 @@ var SensorTypeSchema = z.enum([
|
|
|
259
266
|
"security_camera",
|
|
260
267
|
"dashcam",
|
|
261
268
|
"phone_camera",
|
|
269
|
+
"infrasonic_sensor",
|
|
270
|
+
"ultrasonic_sensor",
|
|
271
|
+
"adsb_receiver",
|
|
272
|
+
"rf_spectrum_analyzer",
|
|
273
|
+
"passive_radar",
|
|
274
|
+
"particle_detector",
|
|
275
|
+
"atomic_clock",
|
|
276
|
+
"gnss_receiver",
|
|
277
|
+
"fluxgate_magnetometer",
|
|
278
|
+
"air_quality_sensor",
|
|
279
|
+
"barometer",
|
|
280
|
+
"lightning_detector",
|
|
281
|
+
"imu",
|
|
282
|
+
"eeg",
|
|
283
|
+
"gsr",
|
|
284
|
+
"pulse_oximeter",
|
|
285
|
+
"pupillometer",
|
|
286
|
+
"hardware_rng",
|
|
262
287
|
"other"
|
|
263
288
|
]).describe("Class of sensor that produced a reading.");
|
|
264
289
|
var SensorReadingSchema = z.object({
|
|
265
290
|
id: z.string().min(1).describe('Stable id, addressable by a claim `evidenceRef` ("sensor:<id>").'),
|
|
266
291
|
sensorType: SensorTypeSchema,
|
|
267
292
|
detectionMethod: DetectionMethodSchema,
|
|
293
|
+
sensorRef: z.string().optional().describe(
|
|
294
|
+
'Reference to a published sensor-manifest entry ("<org-slug>:<sensor-id>", e.g. "eldaeon:dionysus-passive-radar") carrying the instrument\u2019s full spec, timing, and calibration provenance.'
|
|
295
|
+
),
|
|
268
296
|
platform: z.string().optional().describe('Platform carrying the sensor (e.g. "USS Princeton", "F/A-18F").'),
|
|
269
297
|
operator: z.string().optional().describe("Person or unit operating the sensor."),
|
|
270
298
|
timestamp: z.string().optional().describe("When the reading was recorded (ISO timestamp)."),
|
|
@@ -500,6 +528,20 @@ var ClaimSchema = AttributionSchema.extend({
|
|
|
500
528
|
evidenceRefs: z.array(z.string().min(1)).optional().describe('Refs to in-record evidence justifying this claim, e.g. "media:<id>", "sensor:<id>".')
|
|
501
529
|
}).describe("An attributed, evidence-backed assertion (Attribution + the evidence that justifies it).");
|
|
502
530
|
|
|
531
|
+
// src/shared/sensor-ref.ts
|
|
532
|
+
var SENSOR_REF_PATTERN = /^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9-]*$/;
|
|
533
|
+
function sensorRef(orgSlug, sensorId) {
|
|
534
|
+
return `${orgSlug}:${sensorId}`;
|
|
535
|
+
}
|
|
536
|
+
function isSensorRef(value) {
|
|
537
|
+
return typeof value === "string" && SENSOR_REF_PATTERN.test(value);
|
|
538
|
+
}
|
|
539
|
+
function parseSensorRef(value) {
|
|
540
|
+
if (!isSensorRef(value)) return null;
|
|
541
|
+
const idx = value.indexOf(":");
|
|
542
|
+
return { orgSlug: value.slice(0, idx), sensorId: value.slice(idx + 1) };
|
|
543
|
+
}
|
|
544
|
+
|
|
503
545
|
// src/shared/validation.ts
|
|
504
546
|
function issuesFrom(error) {
|
|
505
547
|
return error.issues.map((issue) => ({
|
|
@@ -1334,7 +1376,7 @@ function formatTimeOfDay(tod) {
|
|
|
1334
1376
|
function formatCoordinatePrecision(precision) {
|
|
1335
1377
|
return COORDINATE_PRECISION_LABELS[precision];
|
|
1336
1378
|
}
|
|
1337
|
-
var RECORDS_SCHEMA_VERSION = "1.
|
|
1379
|
+
var RECORDS_SCHEMA_VERSION = "1.1.0";
|
|
1338
1380
|
var RECORDS_SCHEMA_ID = schemaId("records", "observation", RECORDS_SCHEMA_VERSION);
|
|
1339
1381
|
function recordsJsonSchema() {
|
|
1340
1382
|
const schema = z.toJSONSchema(ObservationSchema, { target: "draft-2020-12" });
|
|
@@ -1345,6 +1387,6 @@ function recordsJsonSchema() {
|
|
|
1345
1387
|
return jsonSchemaEnvelope(schema, { id: RECORDS_SCHEMA_ID, version: RECORDS_SCHEMA_VERSION });
|
|
1346
1388
|
}
|
|
1347
1389
|
|
|
1348
|
-
export { AIRSPACE_CLASSES, AirspaceClassSchema, AttributionSchema, AviationSchema, CHAIN_OF_CUSTODY_LABELS, CHAIN_OF_CUSTODY_STATUSES, CONFIDENCE_LEVELS2 as CONFIDENCE_LEVELS, CONFIDENCE_LEVEL_LABELS, COORDINATE_PRECISIONS, COORDINATE_PRECISION_LABELS, ClaimSchema, ConfidenceLevelSchema, ConfidenceSchema, CoordinatePrecisionSchema, DATE_GRANULARITIES, DATE_GRANULARITY_LABELS, DATE_RANGE_TYPES, DATE_RANGE_TYPE_LABELS, DETECTION_METHODS, DateGranularitySchema, DateRangeSchema, DateRangeTypeSchema, DetectionMethodSchema, EVIDENCE_QUALITIES, EVIDENCE_QUALITY_LABELS, EVIDENCE_REF_KINDS, EVIDENCE_TYPES, EnvironmentSchema, FuzzyDateSchema, GeoBoundsSchema, GeoPolygonSchema, HASH_ALGORITHMS, InvestigationSchema, LOCATION_SENSITIVITIES, LOCATION_SENSITIVITY_LABELS, LocationDataSchema, LocationSensitivitySchema, MANEUVER_TYPES, MEDIA_TYPES, MEDIA_TYPE_LABELS, ManeuverTypeSchema, MediaAttachmentSchema, MediaTypeSchema, MovementSchema, OBJECT_SHAPES, OBJECT_SHAPE_LABELS, ObjectCharacteristicsSchema, ObjectShapeSchema, ObservationSchema, PUBLICATION_STATUSES, PUBLICATION_STATUS_LABELS, ProximitySiteSchema, PublicationStatusSchema, RECORDS_SCHEMA_ID, RECORDS_SCHEMA_VERSION, RELATION_KINDS, RELATION_KIND_LABELS, RELATIVE_RELATION_LABELS, RelationEdgeSchema, RelationKindSchema, RelationsSchema, RelativeDateSchema, ResponseImpactSchema, SENSOR_TYPES, SITE_TYPES, SOURCE_CREDIBILITIES, SOURCE_CREDIBILITY_LABELS, SOURCE_TYPES, SOURCE_TYPE_LABELS, SensorEvidenceDataSchema, SensorReadingSchema, SensorTypeSchema, SiteTypeSchema, SourceCredibilitySchema, SourceDataSchema, SourceReferenceSchema, SourceTypeSchema, TEMPORAL_CERTAINTIES, TEMPORAL_CERTAINTY_LABELS, TERRAIN_TYPES, TIMES_OF_DAY, TIME_OF_DAY_LABELS, TemporalCertaintySchema, TemporalDataSchema, TerrainTypeSchema, TimeOfDaySchema, VERIFICATION_METHODS, VERIFICATION_RESULTS, VERIFICATION_RESULT_LABELS, WITNESS_CATEGORIES, WitnessesSchema, asConfidence, asObservationId, assertConfidence, createEnumGuard, createMediaAttachment, createObservation, createSensorReading, createTemporalData, evidenceRef, formatCoordinatePrecision, formatDateRange, formatFuzzyDate, formatRelativeDate, formatSourceType, formatTemporalData, formatTimeOfDay, isAirspaceClass, isChainOfCustody, isConfidence, isConfidenceLevel, isCoordinatePrecision, isDateGranularity, isDateRange, isDateRangeType, isDetectionMethod, isEvidenceQuality, isEvidenceRef, isEvidenceType, isFuzzyDate, isHashAlgorithm, isLocationSensitivity, isManeuverType, isMediaType, isObjectShape, isPublicationStatus, isRelationKind, isRelativeDate, isSensorType, isSiteType, isSourceCredibility, isSourceType, isTemporalCertainty, isTerrainType, isTimeOfDay, isValidISODate, isValidLatitude, isValidLongitude, isVerificationMethod, isVerificationResult, isWitnessCategory, issuesFrom, makeGuard, parseEvidenceRef, recordsJsonSchema, validateObservation };
|
|
1390
|
+
export { AIRSPACE_CLASSES, AirspaceClassSchema, AttributionSchema, AviationSchema, CHAIN_OF_CUSTODY_LABELS, CHAIN_OF_CUSTODY_STATUSES, CONFIDENCE_LEVELS2 as CONFIDENCE_LEVELS, CONFIDENCE_LEVEL_LABELS, COORDINATE_PRECISIONS, COORDINATE_PRECISION_LABELS, ClaimSchema, ConfidenceLevelSchema, ConfidenceSchema, CoordinatePrecisionSchema, DATE_GRANULARITIES, DATE_GRANULARITY_LABELS, DATE_RANGE_TYPES, DATE_RANGE_TYPE_LABELS, DETECTION_METHODS, DateGranularitySchema, DateRangeSchema, DateRangeTypeSchema, DetectionMethodSchema, EVIDENCE_QUALITIES, EVIDENCE_QUALITY_LABELS, EVIDENCE_REF_KINDS, EVIDENCE_TYPES, EnvironmentSchema, FuzzyDateSchema, GeoBoundsSchema, GeoPolygonSchema, HASH_ALGORITHMS, InvestigationSchema, LOCATION_SENSITIVITIES, LOCATION_SENSITIVITY_LABELS, LocationDataSchema, LocationSensitivitySchema, MANEUVER_TYPES, MEDIA_TYPES, MEDIA_TYPE_LABELS, ManeuverTypeSchema, MediaAttachmentSchema, MediaTypeSchema, MovementSchema, OBJECT_SHAPES, OBJECT_SHAPE_LABELS, ObjectCharacteristicsSchema, ObjectShapeSchema, ObservationSchema, PUBLICATION_STATUSES, PUBLICATION_STATUS_LABELS, ProximitySiteSchema, PublicationStatusSchema, RECORDS_SCHEMA_ID, RECORDS_SCHEMA_VERSION, RELATION_KINDS, RELATION_KIND_LABELS, RELATIVE_RELATION_LABELS, RelationEdgeSchema, RelationKindSchema, RelationsSchema, RelativeDateSchema, ResponseImpactSchema, SENSOR_TYPES, SITE_TYPES, SOURCE_CREDIBILITIES, SOURCE_CREDIBILITY_LABELS, SOURCE_TYPES, SOURCE_TYPE_LABELS, SensorEvidenceDataSchema, SensorReadingSchema, SensorTypeSchema, SiteTypeSchema, SourceCredibilitySchema, SourceDataSchema, SourceReferenceSchema, SourceTypeSchema, TEMPORAL_CERTAINTIES, TEMPORAL_CERTAINTY_LABELS, TERRAIN_TYPES, TIMES_OF_DAY, TIME_OF_DAY_LABELS, TemporalCertaintySchema, TemporalDataSchema, TerrainTypeSchema, TimeOfDaySchema, VERIFICATION_METHODS, VERIFICATION_RESULTS, VERIFICATION_RESULT_LABELS, WITNESS_CATEGORIES, WitnessesSchema, asConfidence, asObservationId, assertConfidence, createEnumGuard, createMediaAttachment, createObservation, createSensorReading, createTemporalData, evidenceRef, formatCoordinatePrecision, formatDateRange, formatFuzzyDate, formatRelativeDate, formatSourceType, formatTemporalData, formatTimeOfDay, isAirspaceClass, isChainOfCustody, isConfidence, isConfidenceLevel, isCoordinatePrecision, isDateGranularity, isDateRange, isDateRangeType, isDetectionMethod, isEvidenceQuality, isEvidenceRef, isEvidenceType, isFuzzyDate, isHashAlgorithm, isLocationSensitivity, isManeuverType, isMediaType, isObjectShape, isPublicationStatus, isRelationKind, isRelativeDate, isSensorRef, isSensorType, isSiteType, isSourceCredibility, isSourceType, isTemporalCertainty, isTerrainType, isTimeOfDay, isValidISODate, isValidLatitude, isValidLongitude, isVerificationMethod, isVerificationResult, isWitnessCategory, issuesFrom, makeGuard, parseEvidenceRef, parseSensorRef, recordsJsonSchema, sensorRef, validateObservation };
|
|
1349
1391
|
//# sourceMappingURL=index.js.map
|
|
1350
1392
|
//# sourceMappingURL=index.js.map
|