All files / lib/schemas observations.js

100% Statements 21/21
100% Branches 0/0
100% Functions 0/0
100% Lines 21/21

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 241x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x  
import { type } from 'arktype';
import { Dimensions, ID, References } from './common.js';
import { MetadataValues } from './metadata.js';
 
export const Image = type({
	id: /\d+(_\d+)*/,
	filename: 'string',
	addedAt: 'string.date.iso.parse',
	dimensions: Dimensions,
	metadata: MetadataValues,
	contentType: /\w+\/\w+/,
	fileId: ID.or('null').describe("ID vers l'objet ImageFile associé"),
	/** Si les boîtes englobantes ont été analysées. Pratique en particulier pour savoir s'il faut calculer les boîtes englobantes pour une image qui n'a aucune observation associée (chaque bounding box crée une image) */
	boundingBoxesAnalyzed: 'boolean = false'
});
 
export const Observation = type({
	id: ID,
	label: 'string',
	addedAt: 'string.date.iso.parse',
	metadataOverrides: MetadataValues,
	images: References
});