UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

21 lines (18 loc) 967 B
import { StixType } from '../schemas/common/property-schemas/stix-type.cjs'; import { SDO, SRO } from '../schemas/common/stix-core.cjs'; import { MarkingDefinition } from '../schemas/smo/marking-definition.schema.cjs'; import 'zod/v4'; /** * Generates sample valid STIX objects for testing. * Static objects are used for now, but this could eventually be replaced with a fake data * generator like `zod-mock`, once it supports zod v4. * * @param stixType - The STIX type that should be created (e.g., 'x-mitre-detection-strategy') * @returns A valid object of the desired type, with dummy data. * * @example * const sampleDetectionStrategy = createSyntheticStixObject('x-mitre-detection-strategy'); * result = detectionStrategySchema.safeParse(sampleDetectionStrategy); // This should always be successful */ declare function createSyntheticStixObject(stixType: StixType): SDO | SRO | MarkingDefinition | undefined; export { createSyntheticStixObject };