All files / lib/schemas exports.js

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26              2x               4x               4x    
import { type } from 'arktype';
 
import { ID, NamespacedMetadataID } from './common.js';
import { MetadataRecord } from './metadata.js';
import { AnalyzedObservation } from './results.js';
import { Session } from './sessions.js';
 
export const Analysis = type({
	observations: type
		.Record('string', AnalyzedObservation)
		.describe("Associe l'ID d'une observation à son label et les valeurs de ses métadonnées"),
	session: Session.omit('metadata')
		.and({
			metadata: MetadataRecord(NamespacedMetadataID),
			// TODO(2026-02-17): remove the default in a little while
			protocolMetadata: MetadataRecord(ID).default(() => ({}))
		})
		.describe("La session d'analyse"),
	files: type
		.Record('string', 'string')
		.describe(
			"Associe une référence de fichier à son chemin dans le .zip d'exportation. Les références de fichiers sont les valeurs des métadonnées de type 'file'"
		)
		.default(() => ({}))
});