@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
39 lines (36 loc) • 1.56 kB
TypeScript
import { z } from 'zod/v4';
/**
* Schema for validating object marking references (`object_marking_refs`).
*
* An array of STIX identifiers that reference marking-definition objects. These markings
* provide data classification and handling instructions for the object.
*
* @example
* ```typescript
* objectMarkingRefsSchema.parse([
* 'marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9'
* ]); // Valid
* objectMarkingRefsSchema.parse(['identity--12345']); // Invalid - must be marking-definition
* ```
*/
declare const objectMarkingRefsSchema: z.ZodArray<z.ZodString>;
type ObjectMarkingRefs = z.infer<typeof objectMarkingRefsSchema>;
/**
* Schema for validating created-by references (`created_by_ref`).
*
* A STIX identifier referencing an identity object that describes the entity that
* created this object. If omitted, the source of the information is undefined.
* Object creators may omit this to remain anonymous.
*
* @example
* ```typescript
* stixCreatedByRefSchema.parse('identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5'); // Valid
* stixCreatedByRefSchema.parse('malware--12345'); // Invalid - must be identity type
* ```
*/
declare const stixCreatedByRefSchema: z.ZodString & z.ZodType<`identity--${string}`, string, z.core.$ZodTypeInternals<`identity--${string}`, string>>;
/**
* Type representing a validated created-by reference.
*/
type StixCreatedByRef = z.infer<typeof stixCreatedByRefSchema>;
export { type ObjectMarkingRefs, type StixCreatedByRef, objectMarkingRefsSchema, stixCreatedByRefSchema };