UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

112 lines (109 loc) 5.65 kB
import { z } from 'zod'; import { StixTypesWithAttackIds } from './attack-id.js'; import './stix-type.js'; declare const externalReferenceSchema: z.ZodObject<{ source_name: z.ZodString; description: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; external_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }>; declare const externalReferencesSchema: z.ZodArray<z.ZodObject<{ source_name: z.ZodString; description: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; external_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }>, "many">; declare const createAttackExternalReferencesSchema: (stixType: StixTypesWithAttackIds) => z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodObject<{ source_name: z.ZodString; description: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; external_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }>, "many">, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }[], { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }[]>, { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }[], { source_name: string; description?: string | undefined; url?: string | undefined; external_id?: string | undefined; }[]>; type ExternalReference = z.infer<typeof externalReferenceSchema>; type ExternalReferences = z.infer<typeof externalReferencesSchema>; declare const stixCreatedByRefSchema: 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>, `identity--${string}`, string>; type StixCreatedByRef = z.infer<typeof stixCreatedByRefSchema>; declare const granularMarkingSchema: z.ZodObject<{ marking_ref: 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>; selectors: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { marking_ref: `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}`; selectors: string[]; }, { marking_ref: string; selectors: string[]; }>; type GranularMarking = z.infer<typeof granularMarkingSchema>; declare const extensionSchema: z.ZodObject<{ extension_type: z.ZodString; extension_properties: z.ZodRecord<z.ZodString, z.ZodUnknown>; }, "strip", z.ZodTypeAny, { extension_type: string; extension_properties: Record<string, unknown>; }, { extension_type: string; extension_properties: Record<string, unknown>; }>; type Extension = z.infer<typeof extensionSchema>; declare const extensionsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ extension_type: z.ZodString; extension_properties: z.ZodRecord<z.ZodString, z.ZodUnknown>; }, "strip", z.ZodTypeAny, { extension_type: string; extension_properties: Record<string, unknown>; }, { extension_type: string; extension_properties: Record<string, unknown>; }>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>; type Extensions = z.infer<typeof extensionsSchema>; export { type Extension, type Extensions, type ExternalReference, type ExternalReferences, type GranularMarking, type StixCreatedByRef, createAttackExternalReferencesSchema, extensionSchema, extensionsSchema, externalReferenceSchema, externalReferencesSchema, granularMarkingSchema, stixCreatedByRefSchema };