UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

11 lines (7 loc) 1.54 kB
import { z } from 'zod'; import { StixType } from './stix-type.js'; type StixIdentifier = `${StixType}--${string}`; declare const stixIdentifierSchema: z.ZodEffects<z.ZodString, `attack-pattern--${string}` | `bundle--${string}` | `campaign--${string}` | `course-of-action--${string}` | `identity--${string}` | `intrusion-set--${string}` | `malware--${string}` | `tool--${string}` | `marking-definition--${string}` | `x-mitre-data-component--${string}` | `x-mitre-data-source--${string}` | `x-mitre-tactic--${string}` | `x-mitre-asset--${string}` | `x-mitre-matrix--${string}` | `x-mitre-collection--${string}` | `relationship--${string}` | `file--${string}` | `artifact--${string}`, string>; declare function createStixIdValidator<T extends StixType>(expectedType: T): z.ZodEffects<z.ZodEffects<z.ZodString, `attack-pattern--${string}` | `bundle--${string}` | `campaign--${string}` | `course-of-action--${string}` | `identity--${string}` | `intrusion-set--${string}` | `malware--${string}` | `tool--${string}` | `marking-definition--${string}` | `x-mitre-data-component--${string}` | `x-mitre-data-source--${string}` | `x-mitre-tactic--${string}` | `x-mitre-asset--${string}` | `x-mitre-matrix--${string}` | `x-mitre-collection--${string}` | `relationship--${string}` | `file--${string}` | `artifact--${string}`, string>, `${T}--${string}`, string>; type TypeSpecificStixIdentifier<T extends StixType> = `${T}--${string}`; export { type StixIdentifier, type TypeSpecificStixIdentifier, createStixIdValidator, stixIdentifierSchema };